![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Как сохранить TImage в gif?
nester © (2003-10-05 16:18:00)
Как сохранить содержимое TImage в gif? Читать то читать он умеет гифы а как в них сохранять? как не мучался, все равно в bmp сохраняет
nester (2003-10-06 13:14:00) [1]
Благодарю
ZEE (2003-10-06 10:32:00) [2]
вот выдернул из демки к TGifImage скачивал с http://torry.net/
procedure TFormMain.ButtonConvertClick(Sender: TObject);
var
Bitmap : TBitmap;
GIF : TGIFImage;
begin
ButtonConvert.Enabled := False;
try
Bitmap := TBitmap.Create;
try
// Load the bitmap that will be converted
Bitmap.LoadFromFile(ExtractFIlePath(Application.ExeName)+"test.bmp");
// Display the bitmap
ImageBMP.Picture.Assign(Bitmap);
// Clear previous GIF view
ImageGIF.Picture.Assign(nil);
ShowMessage("This demo loads a bitmap from the file TEST.BMP,"+#13+
"converts it to a GIF and saves it as TEST.GIF");
GIF := TGIFImage.Create;
try
GIF.OnProgress := OnProgress;
// Convert the bitmap to a GIF
GIF.Assign(Bitmap);
// Save the GIF
GIF.SaveToFile("test.gif");
// Display the GIF
ImageGIF.Picture.Assign(GIF);
finally
GIF.Free;
end;
finally
Bitmap.Free;
end;
finally
ButtonConvert.Enabled := True;
end;
end;