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?
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);
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.