Important alert: (current site time 7/16/2013 5:08:45 AM EDT)
 

article

Delphi bug 32bit icons

Email
Submitted on: 10/19/2003 10:34:33 AM
By: mark gascoyne 
Level: Intermediate
User Rating: By 1 Users
Compatibility: Delphi 6
Views: 12823
 
     i have found a bug in BRCC32 delphi 6. read on about how to combat this bug

 
 
Terms of Agreement:   
By using this article, you agree to the following terms...   
  1. You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.
				the resorce compiler BRCC32 in delphi does not compile 32bit icons (win xp+).it thinks they are 16bit.
The result then is that any 32bit icons you build in your resorce over write the main icon and others the solution to this is as follows

Function Tform1.LoadIconFromrc(ResName:pchar):Ticon;
var
Stream: TResourceStream;
icon1:ticon;
begin
try
icon1:=ticon.create;
Stream := TResourceStream.Create(hInstance, ResName, 'Data');
icon1.LoadFromStream(Stream);
Result:=icon1; //remember free this at the end
finally
stream.Free;
end;
end;

simple eh a bit slower but more relyable the the api loadicon. all you need to put in the resorce before it is compled now is

IconName DATA "FileName"

vistit my site where there are a few free apps and a 32bit icon genorator :D if you like anything plz vote i dont often post here
mgazzasoft.150m.com
www.mgazzasoft.150m.com

sometimes only one works :D any one who know some of the delphi team plz fwd this artical on id like to see the ticon.savetofile function updated


Other 5 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Intermediate category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)
 

To post feedback, first please login.