[英]How change color of image?
I have HICON with white background and some picture on it. 我有HICON白色背景和一些图片。 I need to change color of this picture to black.
我需要将此图片的颜色更改为黑色。 How can I do it in MFC?
如何在MFC中执行此操作? I have watched some articles but it were not clear answers.
我看了一些文章,但答案不清楚。
PS. PS。 I can't provide code because I don't even know where I should dig it.
我无法提供代码,因为我什至不知道应该在哪里进行挖掘。
Thank you 谢谢
I don't have code to post but, in general, the steps should be as follows: Render the HICON to a bitmap, iterate over the bitmap and set any non-white pixels to black, create a new HICON from the bitmap. 我没有要发布的代码,但是,一般而言,步骤应如下:将HICON渲染为位图,在位图上迭代,并将所有非白色像素设置为黑色,然后从位图创建新的HICON。 This should be pretty straight-forward.
这应该很简单。
Look at the icon reference in the MSDN. 查看MSDN中的图标参考。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.