var
ico: TIcon;
begin
opendialog1.Execute;
ico := TIcon.Create;
ico.Handle:=ExtractIcon(HInstance, PChar(opendialog1.FileName), 0);
ico.SaveToFile('c:\123.ico');
ico.Free;
end;
上面是保存下来,如果你显示在image组件上:
var
ico: TIcon;
begin
if opendialog1.Execute then
begin
Image1.picture.Assign(nil);
ico := TIcon.Create;
ico.Handle:=ExtractIcon(HInstance, PChar(opendialog1.FileName), 0);
DrawIcon(self.Image1.Canvas.Handle,33,33,ico.Handle);
ico.Free;
end;
end;
posted on 2009-01-14 00:22
小叶子 阅读(483)
评论(0) 编辑 收藏 引用 所属分类:
笔记