🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
2 messages
2 total messages Started by Thorsten Kettner Tue, 13 May 2003 14:36
Loading a 16x16 icon from resource
#16445
Author: Thorsten Kettner
Date: Tue, 13 May 2003 14:36
15 lines
1341 bytes
Hi,
I am not able to load my 16x16 icon from my res file. I always
get them as 32x32. Here is my code:

  HICON hIcon = LoadImage(HInstance, MAKEINTRESOURCE(ID_SMALLICON), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);

I have tried zeros instead of 16 and tried also other flags, but
nothing helps.

I am using BCB6 ent. German, Build 10.166 on Win NT 4.00.1381.

Who can help?
Thanx in advance.
Thorsten.
Re: Loading a 16x16 icon from resource
#16464
Author: Bob Gonder
Date: Tue, 13 May 2003 20:38
15 lines
1680 bytes
"Thorsten Kettner" <QUESTIONBYthorsten.kettner@otto.de> wrote:

>I am not able to load my 16x16 icon from my res file. I always
>get them as 32x32. Here is my code:
>
>  HICON hIcon = LoadImage(HInstance, MAKEINTRESOURCE(ID_SMALLICON), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
>
>I have tried zeros instead of 16 and tried also other flags, but
>nothing helps.

Yes, the description for the LR_DEFAULTSIZE is self contradictory.
Don't know _the_ answer, but you could probably work around this by
getting the actual size that MS loaded, create a new DC with 16x16 and
stretch (shrink) the icon back.  Course, you could also get around it
by using BMPs instead of ICONs.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads