Sign in to follow this  
silverphyre673

png loading

Recommended Posts

I need to make a function that loads .PNG images. I'm not sure where to look to find out how they are stored, however; I tried wotsit.org but I didn't find anyting I could use. Could someone point me to a site that has a clear description of exactly how they are stored... or alternatively a single function (not a whole library, I ONLY need to know how to load PNGs) in c++, preferably, that accomplishes this? Thanks.

Share this post


Link to post
Share on other sites
Quote:
Original post by silverphyre673
or alternatively a single function (not a whole library, I ONLY need to know how to load PNGs)


Importing a library won't really hurt you; you can always strip the executable.

As mentioned, libpng (this link is 'more direct' ;) ) is a full library but only deals with PNGs. This gives you a lot more options in your code than a single magic "vector<char> loadPNG(string filename)", or whatever interface you were thinking of having; who knows what exactly you'd get back in that case, or how easily adaptable it would be to the rest of your code?

Share this post


Link to post
Share on other sites
Will I be able to use it w/ dev-cpp without a big hassle? Where do I put the files to include it into my project? Sorry - every time I try and use a library like this, it seems not to work. Hmmmm... I'm just 16, no classes or anything yet, and everyone has to learn sometime right? So, how would I use it?

Thanks.

Share this post


Link to post
Share on other sites
Quote:
Original post by silverphyre673
Will I be able to use it w/ dev-cpp without a big hassle?


Yes, you can download the libpng "package" for dev-cpp using the update tool (you should see an option in the tools menu). Download the package and dev-cpp should install it for you [cool]

Share this post


Link to post
Share on other sites
Quote:
Original post by setaglib
Quote:
Original post by silverphyre673
Will I be able to use it w/ dev-cpp without a big hassle?


Yes, you can download the libpng "package" for dev-cpp using the update tool (you should see an option in the tools menu). Download the package and dev-cpp should install it for you [cool]


As long as you don't try to build it from source by hand [lol] That went horrible for me...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this