Connecting Tech Pros Worldwide Forums | Help | Site Map

Loading PNG Files

Member
 
Join Date: Apr 2007
Posts: 38
#1: Jul 2 '07
All week now I have been searching for a good way to load and display PNG files. Every solution I try never works.

So now I am posting on the forums. I am not looking for a huge library. In fact, I'm not looking for a library at all. All I want to do is do easily be able to load and display PNG files.

I'm using Visual C++ 2005 Win32 API.

Member
 
Join Date: May 2007
Posts: 51
#2: Jul 2 '07

re: Loading PNG Files


Quote:

Originally Posted by Fromethius

All week now I have been searching for a good way to load and display PNG files. Every solution I try never works.

So now I am posting on the forums. I am not looking for a huge library. In fact, I'm not looking for a library at all. All I want to do is do easily be able to load and display PNG files.

I'm using Visual C++ 2005 Win32 API.

I know you're not looking for a library, but what i use is SDL and the SDL_image library which can load PNGs. See http://lazyfoo.net/SDL_tutorials/index.php lesson 3 is what you're looking for.

PS: I'm running Linux, so I'm not sure how it works on windows, but the site i posted has a windows setup tutorial.
archonmagnus's Avatar
Member
 
Join Date: Jun 2007
Location: The Interweb
Posts: 115
#3: Jul 2 '07

re: Loading PNG Files


Sounds like you need some documentation.

PNG is defined in the document, RFC 2083. This document has the text chunk format definitions, and the other "basics". The hard part, in my humble opinion, is implementing the deflate algorithm to decompress the pixel data. The deflate algorithm is defined by RFC 1951. You'll also need to utilize the ZLib decompression documentation from RFC 1950.
Reply