直接把ico文件的后缀名由.ico改为.bmp就行啦
解决方案 »
- delphi关闭程序
- delphi中的大数异或
- IXMLHttpRequest和IXMLDOMDocument在哪个单元里?如何引用?
- 怎样自动加1?
- 来看看这样的问题??
- 两个表中查询同一个字段
- __strSQL:=StringReplace(__strSQL, ''Y'', ''√'',rfReplaceAll);这条语句出错在哪?请教!
- 请问各位大侠,为什么我每次来csdn,都只能看见 4页 未解决问题?
- 请各位大侠,帮小弟一下关于active form的问题,多谢,多谢
- 请问,如何让查找到的 记录 的那一行用不同的颜色显示?
- 怎么将table1数据库的所有字段增加combobox1中。
- DELPHI下的SNMP编程,大家讨论以下了?谢谢
对,格式一样的。
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,jpeg,
StdCtrls, ExtCtrls;type
TForm1 = class(TForm)
Button1: TButton;
Image1: TImage; //存放你的ico图片
Image2: TImage; //生成的bmp图片
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
var
bmp:tbitmap;
ic:ticon;
begin
bmp:=tbitmap.create;
try
with bmp do
begin
width:=image1.picture.width;
height:=image1.picture.height;
canvas.Draw(0,0,image1.picture.graphic);
image2.picture.assign(bmp);
savetofile('d:\tmp.bmp');//保存路径名
end;
finally
bmp.free;
end;
end;end.
var
Icon : TIcon;
Bitmap : TBitmap;
begin
Icon := TIcon.Create;
Bitmap := TBitmap.Create;
Icon.LoadFromFile('c:\picture.ico'); //Load an ICO
from File
Bitmap.Width := Icon.Width;
Bitmap.Height := Icon.Height;
Bitmap.Canvas.Draw(0, 0, Icon );
Bitmap.SaveToFile('c:\picture.bmp'); //Convert ICO to
BMP!
Icon.Free;
Bitmap.Free;
end;
很不明确的问题居然这么多人能回答。
哈哈哈......