Png透明度问题资源 [英] Png transparency problem resources

查看:77
本文介绍了Png透明度问题资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好

我创建了一些在应用程序中使用的PNG图像。如果我使用透明像素然后将图片资源添加到我的项目中,它们会以某种方式转换为完全不同的颜色。我无法添加图片,但我会在可能的情况下提供它们。

i have created some PNG images which are used in application. If i use transparent pixels and then add picture resource to my project, they are somehow converted into totally diferent colors. I am not able to add pictures, but i will supply them when possible.

我使用Paint.net创建png文件并保存为32位图像深度 - 图像在图片查看器中是透明的paint.net。

I use Paint.net for creating png files and save as 32bit image depth - images are transparent in picture viewer and paint.net.

我该如何解决这个问题?

How can i solve this?

推荐答案

在我使用透明PNG图像的项目中我将它们保存为自定义资源(键入"PNG")。 要检索它们,我使用FindResource,LoadResource,LockResource,SizeOfResource等低级资源函数来加载图像。 
加载后我在加载的图像上创建一个IStream,并使用CImage类将PNG从IStream加载到一个CImage对象中,从中可以检索到HBITMAP。
In my projects that use transparent PNG images I save them as custom resources (type "PNG").  To retrieve them I use the low-level resource functions like FindResource, LoadResource, LockResource, SizeOfResource to load the images.  After they are loaded I create an IStream on the loaded image and, using the CImage class I can load the PNG from the IStream into a CImage object from which an HBITMAP can be retrieved.


这篇关于Png透明度问题资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆