CMFCMenubutton setIcon but icon has the sawtooth edge

ZH Chan 66 Reputation points
2022-03-07T07:05:20.13+00:00

This is the snippet.

            HICON hIcon = (HICON)::LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_ICON1), IMAGE_ICON, 16, 16, 0);  
	if (hIcon)  
	{  
		m_button.SetIcon(hIcon);  
		m_button.Invalidate(TRUE);  
	}  

180537-%E5%9B%BE%E7%89%87.png

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,780 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. YujianYao-MSFT 4,291 Reputation points Microsoft Vendor
    2022-03-08T06:44:30.677+00:00

    Hi @ZH Chan ,

    I suggest you change an image or check the pixels of the image, because I downloaded a random image and tested the code you shared and there was no obvious anti-aliasing. The result is as follows:

    180895-icooo.png

    Best regards,

    Elya


    If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.