//需要装GIFImage控件;
//已知BUG:粘贴后动画死了,不动了[
]
procedure TForm1.Button1Click(Sender: TObject);
begin
if Clipboard.HasFormat(CF_BITMAP) then
Image1.Picture.Bitmap.Assign(Clipboard);
end;
procedure TForm1.Button3Click(Sender: TObject);
var
Data: THandle;
Format: Word;
Palette: HPALETTE;
gif: TGIFImage;
begin
Clipboard.Open;
try
Format := EnumClipboardFormats(0);
while Format <> 0do
begin
if TPicture.SupportsClipboardFormat(Format) then
begin
Data := GetClipboardData(Format);
Palette := GetClipboardData(CF_PALETTE);
gif:= TGIFImage.Create;
try
gif.LoadFromClipboardFormat(Format, Data, Palette);
gif.Animate:= true;
gif.SaveToFile('d:/out.gif');
finally
gif.Free;
end;
Exit;
end;
Format := EnumClipboardFormats(Format);
end;
raise Exception.Create('Invalid Clipoard Format!');
finally
Clipboard.Close;
end;
end;