This topic is 4855 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

hey all, im wanting to change my image file format to png so as to save *much* space (compared to bmp) when making my games, so today i was looking for libraries to help me do so. i stumbled across corona and the devpak for dev c++ and can load the image but i have no idea how to use it: that is, i have no idea on how to read the pixel information and use it as i want it (which would be to make a directdraw surface with it on it). if anyone can explain and maybe show by example how i should go about doing this, i would greatly appreciate it. [EDIT]if you cant help with this but can suggest/show another way of loading and using png files, please feel free to let me know also ;)[/EDIT] *Special Note* i just went back in time over half a day and edited my post before i wrote it (according to gamedev) - woohoo! im the first to successfully time travel! (Posted - 4/2/2005 12:18:09 AM and [[Edited by - the_moo on April 1, 2005 8:50:36 AM]] :D :D :D!!!** thanks [Edited by - the_moo on April 3, 2005 12:27:22 AM]

Share on other sites
Here are some good image manipulation libraries (with png support of course)
Devil
ImageMagick
LibPNG

Share on other sites
I knew this would be of some use in a future time [smile] (Don't try to build yourself from scratch [wink])

_BIN_ - Has the a/dll/h.
_DEMO - Has the demo project.
Corona - Is the entire library project all ready to be rebuilt and modified.

- Drew

Share on other sites
sorry, i think i shouldve been a bit more specific:
im using directx and i dont know how to put the pixel information onto a directx surface once the png has been loaded - i know and have the loading working so its just using the information that i cant do. im also using directdraw (old i know) with surfaces and whatnot.

if anyone can still help id greatly appreciate it.

thanks

Share on other sites
I think the function that you will need to use is D3DXCreateTextureFromFileInMemory. I've never done anything like this before, so I can't give you pointers on that, but I think you should be able to follow from the MSDN site. Basically it will be something like this:
DIRECT3DTEXTURE9 Object;DIRECT3DDEVICE9 Device;D3DXCreateTextureFromFileInMemory ( &Device, CoronaPointerToPixels, CoronaFileSize, &Object);

Share on other sites
unfortunately since im using directdraw, i don't know anything about d3d and was hoping someone would be able to help out with directdraw...

if anyone knows of any other way of doing this im willing to here it too.

thanks again

1. 1
Rutin
26
2. 2
JoeJ
20
3. 3
4. 4
5. 5

• 10
• 10
• 9
• 9
• 10
• Forum Statistics

• Total Topics
631751
• Total Posts
3002086
×