-
January 9th, 2009, 04:38 AM
#1
Change Size of Standard Icon
I'd like to load a standard icon in my application, such as IDI_QUESTION. Using LoadIcon, this works fine, but the icon loaded is 32x32, whereas I'd like 16x16.
I've tried the following code to load the icon using LoadImage, but nothing is shown.
Code:
HICON hIcon = ( HICON ) LoadImage( AfxGetInstanceHandle(), MAKEINTRESOURCE( IDI_QUESTION ), IMAGE_ICON, 16, 16, 0 );
So, how can I change the size of a windows standard icon?
-
January 9th, 2009, 06:45 AM
#2
Re: Change Size of Standard Icon
For default system icons do not use MAKEINTRESOURCE or AfxGetInstanceHandle.
First parameter must be NULL and directly use IDI_QUESTION.
try this code:
Code:
LoadImage(NULL, IDI_QUESTION, IMAGE_ICON,
16, 16, LR_DEFAULTCOLOR);
Last edited by codecX; January 9th, 2009 at 06:48 AM.
-
January 9th, 2009, 09:44 AM
#3
Re: Change Size of Standard Icon
I don't know what your intent is once you load the icon, but, you can use DrawIconEx () to render it compressed.
Gort...Klaatu, Barada Nikto!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|