procedure TForm1.btn1Click(Sender: TObject);
var
bmp : TBitmap;
begin
if(dlgOpenPic1.Execute()) then
begin
img1.Picture.LoadFromFile(dlgOpenPic1.FileName);
bmp := TBitmap.Create;
try
bmp.Width := img1.Picture.Width;
bmp.Height := img1.Picture.Height;
bmp.Canvas.Draw(0, 0, img1.Picture.Graphic);
Canvas.Draw(btn1.Left, btn1.Top + btn1.Height + 20, bmp);
finally
bmp.Free;
end;
end;
end;
Just dont forget to include the jpeg unit if you want to work with the jpegs, and for delphi 2009 and up you could add the PNGImage to work with png files on your delphi projectHave fun dear friends! ;)
Tidak ada komentar:
Posting Komentar