Hi!
A demo with the BGRA library.
I use it because it makes good images if you zoom in.
You can download the BGRAbitmapPack from the Online Package Manager.
Take a Form, an Image and a Button.
uses ...., BGRABitmap, BGRADefaultBitmap, BGRABitmapTypes;
procedure TForm1.Button1Click(Sender: TObject);
var R, small : Trect;
bmp: TBGRABitmap;
begin
Image1.Canvas.brush.color := clWhite;
Image1.Canvas.fillrect (0,0,Image1.width, Image1.Height);
bmp := TBGRAbitmap.create;
bmp.LoadFromDevice(Form1.Canvas.Handle);
small := Rect(50,50,50+bmp.width div 2, 50+bmp.height div 2);
BGRAReplace(bmp,bmp.GetPart(small));
BGRAReplace (bmp,bmp.Resample(bmp.width * 2, bmp.Height * 2) );
R := Rect(0,0,bmp.width, bmp.height);
Image1.Canvas.CopyRect (R,bmp.canvas,R);
bmp.free;
end;
We copy the canvas of Form1 into bmp.
Then we take a part of the image starting at 50/50.
Now we resize it to the double size.
And finally we draw it on the Image.canvas.
Winni