Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

wrong width and height of icon in Delphi 7

Status
Not open for further replies.

martinmos

Programmer
Aug 6, 2007
3
GB
DElphi 7
I am trying to convert icons to bitmaps like this

Icon := TIcon.Create;
try
Icon.LoadFromFile(ImagePath);
Ibmap.Height := Icon.Height;//wrong if icon is
Ibmap.Width := Icon.Width;//bigger than 32 x 32
Ibmap.Canvas.Draw(0, 0, Icon);
{Save the BMP}
Ibmap.SaveToFile('c:\temp\test.bmp');
finally
Icon.Free;
end;


The height and width of the icon are returned as 32 when the icon is lager than 32 x 32.
Can anyone tell me how to get the correct height and width of an icon?
 
There have been limitaions on Delphis native Icon formats, colour depth is another one. It may be that the icon.loadfromfile method cannot cope with oversize icons.

This does not nessacarily mean that you cannot display these icons in your programmes.




Steve [The sane]: Delphi a feersum engin indeed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top