如何从资源的图像数组中获取一个图像的HBITMAP?

时间:2021-07-29 00:20:49

I have a resource that has an id ID_IMAGES which is a PNG file. This resource is an array of images, all the same size (16x16). I'm trying to figure out if it is possible to pull out any one of these images and generate an HBITMAP from it.

我有一个ID为ID_IMAGES的资源,这是一个PNG文件。此资源是一个图像数组,大小相同(16x16)。我试图弄清楚是否有可能从这些图像中提取任何一个图像并从中生成HBITMAP。

I've looked around on the net, but I cannot find any info. Perhaps I'm using the wrong keywords?

我在网上四处看看,但我找不到任何信息。也许我使用错误的关键字?

1 个解决方案

#1


1  

Have a look at CImage class. Its Load() method can load a stream of data. CImage supports PNG format. Basically, you load the image from your resource and then use its Detach() method to get your HBITMAP

看看CImage类。它的Load()方法可以加载数据流。 CImage支持PNG格式。基本上,您从资源加载图像,然后使用其Detach()方法获取HBITMAP

#1


1  

Have a look at CImage class. Its Load() method can load a stream of data. CImage supports PNG format. Basically, you load the image from your resource and then use its Detach() method to get your HBITMAP

看看CImage类。它的Load()方法可以加载数据流。 CImage支持PNG格式。基本上,您从资源加载图像,然后使用其Detach()方法获取HBITMAP