I'm trying to add PNG support to my program....
i'm running into some difficulties using CxImage found on
CodeProject.
If anyone has knowledge of this or png support in general
please let me know
thank you in advance.
Printable View
I'm trying to add PNG support to my program....
i'm running into some difficulties using CxImage found on
CodeProject.
If anyone has knowledge of this or png support in general
please let me know
thank you in advance.
i visited that website prior to coming here but i was unsure
of how to take a png file from the HD and put it in a CStatic
object
do you have any experience with the png libraries?
A bit, but CStatic is out of my domain (it's MFC, and I usually deal a bit lower level).
I don't really have the time to re-work how to use libpng, sorry :(
np, thx anyways though
Probably best to load the png using libpng, then creating a DIBSection and filling with the data. It's a bit tricky, I'm doing the same thing at the moment (but I'll do JPEG first).
MFC 7.0 has the CImage class which supports PNG nativly and converts it to a HBITMAP. You can easily convert that to CBitmap.
Once you have a CBitmap you can insert it into a static control.
is mfc 7.0 in .NET?
MFC 7.0 is in VC++7, that is the one in VS.NET, but MFC is still not a part of .NET (it's the unmanaged class library, as opposed to the managed classes of .NET)
I thought it was still 4.something? Hmm...have to look closer at the DLLs I think.Quote:
Originally posted by CornedBee
MFC 7.0 is in VC++7, that is the one in VS.NET, but MFC is still not a part of .NET (it's the unmanaged class library, as opposed to the managed classes of .NET)
I prefer the managed class library to MFC, I think (although I'm still waiting anxiously for the POSIX version :()
VC6 uses MFC 4 I think. It seems they have bumped up ("equalized" or "standardized") the version number.
"Managed classes" just sounds so TERRIBLY slow to me. And since I only use C++ I don't care whether I can use C++ classes in VB or not.
I probably wouldn't use either VB or C++ in .NET - if I needed to (i.e. suddenly at work they said, "stop using Irix and C++, we want you on .NET!", for whatever bizarre reason), then I'd use C# because it was designed to work with .NET.Quote:
Originally posted by CornedBee
"Managed classes" just sounds so TERRIBLY slow to me. And since I only use C++ I don't care whether I can use C++ classes in VB or not.
From the playing with it I did, it works quite well and I could adapt to it fairly quickly (someone paid attention to how C/C++ people think :)).
If you want garbage collection, then there are already frameworks for doing that. I think there's one on www.codeproject.com (the one by Bill Kempf, who, incidentally, is part of the Boost project that I'm trying to find user opinions of...)
Yeah, C# is probably best in .NET.
I don't think I need garbage collection. I run into leaks very seldom.
Once you've gained the experience (like you have) you tend to code in a way that inherently prevents them, so you won't have as many problems.
I still like to encapsulate raw pointers inside classes though, because I get a bit absent-minded sometimes, hehe :D
do you recommend using C++ 7 or C#?
i really like MFC but if windows forms are the way to go i'll
consider trying it out
btw, i got the PNG support working, jpeg too