Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- SrcBitmap: TBitmap;
- DstBitmap: TBitmap;
- JPEGImage: TJPEGImage;
- begin
- SrcBitmap := TBitmap.Create;
- try
- JPEGImage := TJPEGImage.Create;
- try
- JPEGImage.LoadFromFile('C:\Image.jpg');
- SrcBitmap.Assign(JPEGImage);
- finally
- JPEGImage.Free;
- end;
- DstBitmap := TBitmap.Create;
- try
- DstBitmap.Width := 100;
- DstBitmap.Height := 100;
- SetStretchBltMode(DstBitmap.Canvas.Handle, HALFTONE);
- StretchBlt(
- DstBitmap.Canvas.Handle, 0, 0, DstBitmap.Width, DstBitmap.Height,
- SrcBitmap.Canvas.Handle, 0, 0, SrcBitmap.Width, SrcBitmap.Height,
- SRCCOPY
- );
- Image1.Picture.Assign(DstBitmap);
- finally
- DstBitmap.Free;
- end;
- finally
- SrcBitmap.Free;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment