spade89![]() Member Posts: 561 From: houston,tx Registered: 11-28-2006 |
Hi i i am working on a c++ project that converts picture files to NFO'S (ascii art) but i don't know how to read and write from picture files such as bmp's jpg's and gif's so if you know any picture i/o i'd appreciate it if u show me sokmkkek source code. ----------------------------------------------- "The power to question is the basis of all human progress"-gandhi. ------------------ |
|
fearless![]() Member Posts: 91 From: Romania, Tg Mures Registered: 11-26-2005 |
The method I'll point might be an overkill but that's the only one I'm familiar with.
This is a method used in building Terrain from a height map (grayscale bmp) If you're interested in this method here is some sites for you: http://www.32bits.co.uk/ (directx 8 tutorilas) http://www.lighthouse3d.com/opengl/terrain/ ------------------ |
|
dartsman![]() Member Posts: 484 From: Queensland, Australia Registered: 03-16-2006 |
check out the 'Wotsit' website: http://www.wotsit.org/ more specifically... It's pretty much the same as reading and writing to a binary file really. You just need to know how the data is stored. BMP file is a lot 'nicer' to read from, however if you can, .raw files are even easier (raw colour byte information). JPG might be a bit harder as it is compressed, same with GIF. I would recommend converting the BMP, JPG and GIF to raw colour byte format (your own data structure), and then just process that structure to calculate the ASCII graphics. That way, you can easily add in new file formats without any change to the core system. Your structure can be as detailed as you'd like. The core stuff you'll need are: width // of image Hope that helps. ------------------ |
|
spade89![]() Member Posts: 561 From: houston,tx Registered: 11-28-2006 |
thanks a lot that link is really helpful,i know i have been trying to find out i/o routines for lots of files and i couldn't find any. i am currently trying out the whole bmp i/o thing. and it is much easier than i thought it would be. ^__^ ------------------ |