gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > How to save BMP to CF?

#59187 - alangerow - Sun Oct 30, 2005 4:09 am

I'm wondering is there a way to take an array of pixel color information and save it as a BMP or PNG to a CF card in the GBA MP? I have the CF FAT stuff, but what is available to create a BMP on the DS to save?

The Mario Kart icon template inspired me to try an icon creation app for the DS, for those times I'm out and about and feeling creative, but I'm unsure how to go about saving this information in a useful format. I have the drawing stuff done, but am now stuck on this part.

I'm still new to writing for the DS and in C, so anything with any sort of decent documentation would be extremely helpful.

#59194 - tepples - Sun Oct 30, 2005 5:59 am

You can read and write .bmp files using the information at wotsit.org. I wouldn't suggest implementing .png or .jpg until you have .bmp down pat.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#59195 - alangerow - Sun Oct 30, 2005 6:09 am

tepples wrote:
You can read and write .bmp files using the information at wotsit.org. I wouldn't suggest implementing .png or .jpg until you have .bmp down pat.


I would rather do BMP anyway. :) Just looking for whatever is possible. Looks like I have some reading to do. Thank you very much.

#78337 - josath - Thu Apr 06, 2006 11:08 pm

Anyone have any luck with png saving on the DS?
I can save raw image data fine, then I have a tool that runs on my PC to compress that into PNG.

However, there's a problem with png compression on the DS. When I attempt to compress it, using libpng (which depends on zlib), I get an error, Z_STREAM_ERROR. I've traced that it's being generated when libpng calls zlib's deflate() and passes some data into it.

It would be nice if anyone has implemented PNG saving on the DS could speak up. (I'm not interested in PNG reading, I know there's several examples out there that do it already).

You can find my drawing app (saves to raw image only, no PNG) here: http://blog.davr.org/