Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PNG files in MFC

362 views
Skip to first unread message

ScottBright762

unread,
Oct 3, 2008, 9:32:06 AM10/3/08
to
Hi all!

I'm facing a problem regarding PNG files. I'm able to add them in the
resource, but I can't associate these PNG files to Picture Controls.

Why is this?

[]'s

AliR (VC++ MVP)

unread,
Oct 3, 2008, 10:46:21 AM10/3/08
to
You can assign the PNG to the picture control progamatically. Since the PNG
is a custom format that you are adding VS doesn't see it as a bitmap and
therefore it won't show up in the list of bitmaps that you can assign to the
picture control.
But you can alway load the PNG and then assign it to the picture control
using CStatic::SetBitmap

You can either use the ATL class CImage or the GDI+ class Bitmap to load
your PNG file, and ask for a HBITMAP

AliR.


"ScottBright762" <emerson...@gmail.com> wrote in message
news:6911c080-6dc7-406a...@l42g2000hsc.googlegroups.com...

Tom Serface

unread,
Oct 3, 2008, 11:30:14 AM10/3/08
to
I've been successful using CImage to do this sort of thing using a static
control.I typically put in a static "box" the size I want to picture to be,
then use that as a template to overlay the window I create at runtime using
the CImage class.

http://msdn.microsoft.com/en-us/library/bwea7by5(VS.80).aspx

Tom

"ScottBright762" <emerson...@gmail.com> wrote in message
news:6911c080-6dc7-406a...@l42g2000hsc.googlegroups.com...

Leo Violette

unread,
Oct 13, 2008, 2:01:45 PM10/13/08
to
Just another fyi on this. VS 2008 natively supports the display of PNG
files. So, working with them in the resource editor is a much improved
experience over earlier versions of Visual Studio.

"Tom Serface" <tom.n...@camaswood.com> wrote in message
news:D5345F3D-2937-415C...@microsoft.com...

0 new messages