使用OleLoadPicturePath()加载.png图像 [英] loading .png image using OleLoadPicturePath()

查看:808
本文介绍了使用OleLoadPicturePath()加载.png图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我遇到了一个问题.我必须加载任何格式的图像并将其显示为用户的联系人照片,而在此功能中, OleLoadPicturePath()不接受.png图像.我的基本需求是将PNG图像附加到用于加载该图像的图像列表中.由于我未使用CImage,因此浏览的最佳方法是将PNG转换为位图并将其附加到图像列表中.请告诉我我该如何进行??谢谢.

Hi,
I am facing a problem.I have to load images in any format and display them as contact photo of users,where in this function OleLoadPicturePath() doesn''t accept .png images. My basic need is to attach a PNG image to a imagelist which is used to load that image.Since Im not using CImage,best way which I got from browsing is to Convert that PNG to a Bitmap and attach this to the imagelist.Can anyone please tell me how I can go ahead with this??Thanks in advance.

推荐答案

您可能会怎么做?

如果这种方法不好:

CImage图片;
image.Load(_T("C:\\ myimage.png"));
CBitmap位图;
bitmap.Attach(image.Detach());

因此,请尝试以下方式:
用于在对话框中动态显示图片的MFC图片控件 [ ^ ]


问候,
Alex.
What would you probably do?

If this way is bad :

CImage image;
image.Load(_T("C:\\myimage.png"));
CBitmap bitmap;
bitmap.Attach(image.Detach());

So, try following way:
An MFC picture control to dynamically show pictures in a dialog[^]


Regards,
Alex.


显示一些代码,或者是什么错误?支持压缩的png arent,因此您还需要其他功能.

我建议本文解决图像问题:
http://www.codeproject.com/Articles/1300/CxImage
Show some code or what is the error? Compressed png arent supported, so you need something else.

I recommand this article for image issues:
http://www.codeproject.com/Articles/1300/CxImage


这篇关于使用OleLoadPicturePath()加载.png图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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