1、需要GriphcsEx 8.7构件
2、自己写一部代码:以下代码是转成GIF的,与转成Png是差不多的。
procedure TMainForm.ButtonConvertClick(Sender: TObject);
var
Bitmap : TBitmap;
GIF : TGIFImage;
begin
if SaveDialog1.Execute then begin
ButtonConvert.Enabled := False;
try
Bitmap := TBitmap.Create;
try
// Display the bitmap
Bitmap.Assign(OutImage.Picture.Bitmap);
// Clear previous GIF view
GIF := TGIFImage.Create;
try
// Convert the bitmap to a GIF
GIF.Assign(Bitmap);
// Save the GIF
Gif.ColorReduction :=rmMonochrome;
Gif.Pack;
GIF.SaveToFile(SaveDialog1.FileName);
// Display the GIF
finally
GIF.Free;
end;
finally
Bitmap.Free;
end;
finally
ButtonConvert.Enabled := True;
end;
end;
StatusBar1.Panels[1].text := '已经保存';
StateSave := True;
end;