Delphi中如何将剪贴板中图片保存到文件中

2024-11-30 01:00:46
推荐回答(1个)
回答1:

uses Clipbrd;

procedure TForm1.Button1Click(Sender: TObject);
var
Abmp:Tbitmap;
begin
Image1.Picture.Metafile.Assign(ClipBoard);
Abmp := Tbitmap.Create;
Abmp.Height:=Image1.Picture.Metafile.Height;
Abmp.Width:=Image1.Picture.Metafile.Width;
Abmp.Canvas.Draw(0,0,Image1.Picture.Metafile);
Abmp.SaveToFile ('c:\abcd.bmp');
Abmp.free;
end;