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); 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;利用上面的一小段倒是能把BMP转成gif,
但是转的gif质量很差,问问大侠们,有没有什么方法让转的gif质量好些,
有什么其他的DLL或者控件转gif失真少些么?或者哪位有代码看下不胜感激。
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); 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;利用上面的一小段倒是能把BMP转成gif,
但是转的gif质量很差,问问大侠们,有没有什么方法让转的gif质量好些,
有什么其他的DLL或者控件转gif失真少些么?或者哪位有代码看下不胜感激。
解决方案 »
- 求一个用属性读写的简单的例子,明白怎么声明,但是不怎么结合窗体上面的
- alphax 和 yayx 来领分
- BSTR类型的dll返回值在的Delphi中对应什么类型的变量?求教
- 不通过双击“关闭”按钮添加过程代码,直接在unit写过程代码,但是运行出问题了
- 100分请教 delphi适合开发什么 有什么优缺点 如何打包 公司让我调查非常急 在线等诸位大哥哥帮帮忙
- 兩個編輯框的數據轉換問題!!!
- 關於賦值。。。。。。。。。。。。。
- 怎么实现在EDIT中只能输入IP,不能输入其他字符!要分的进!
- 获取一幅图片上的文字
- 请教用delphi 4.0编写ms sqlserver6.5 应用时出现'table does not support this operation because it is not uniquely indexed '
- 在回调函数中使用with结构导致界面无响应
- 问delphi (2011 or XE) 自身的一个小问题
ps之所以转换后效果感觉好些,是因为他生成的图像经过了去杂边,仿色等优化运算,而你的转换代码米有,原理素这个,解决方法不知道,我对图像优化研究不深..............