开发者

MFC - How to display icon in Static Picture Control bigger than 32x32

I have a MFC dialog application with a picture control. I add an icon file with different size of images (32x32, 48x48, etc...) into the icon resource. Then I set the following picture control properties:

Type - Icon Real Size Image - True

I have the following code under OnInitDialog():

HICON hIcon = (HICON) LoadImage( AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_PONCAD),IMAGE_ICON, 48, 48, LR_DEFAULTCOLOR ); 
m_Icon1.SetIcon( hIcon );

The icon did get displayed but the probl开发者_StackOverflowem is that the icon is cropped off. I think the total display windows is still 32x32. So part of the icon is missing.

How to get the icon displays in size 48x48 properly?

Thank you.


Use DrawIconEx win32 API and it should be called when ever window redrawn/moved or resized.

For more help go through the below link

ms-help://MS.MSDNQTR.v90.en/winui/winui/windowsuserinterface/resources/icons/iconreference/iconfunctions/drawiconex.htm

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜