开发者

How to make a Symbol-Button with 16x16 pixel icon-size?

开发者 https://www.devze.com 2023-02-08 14:14 出处:网络
I tried to make a Symbol Button with MFC. The Icon-Resource (*.ico) has a size of 16x16 pixels. When开发者_运维技巧 I load the icon into the button, the icon appears twice as large. Do you know how I

I tried to make a Symbol Button with MFC. The Icon-Resource (*.ico) has a size of 16x16 pixels. When开发者_运维技巧 I load the icon into the button, the icon appears twice as large. Do you know how I can specify the size of the icon drawn onto the button-surface?

The Code Fragment I'm using:

CButton* btn = reinterpret_cast<CButton*>(GetDlgItem(IDC_BUTTON_RUNTER));
btn->SetIcon(AfxGetApp()->LoadIconA(MAKEINTRESOURCE(IDI_RUNTER)));

How to make a Symbol-Button with 16x16 pixel icon-size?

Thanks for your help!


You can use LoadImage instead of LoadIcon which will allow you to specify the size.

0

精彩评论

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

关注公众号