is there any good tutorials on programming C to read/write .Bmp format
is there any good tutorials on programming C to read/write .Bmp format
I bet if you had put that into a search engine you'd have already gotten your answer.
Quzah.
Hope is the first step on the road to disappointment.
I mostly code in basic. I made a prog to pack BMPs into an exe all i really needed was this info: wikipedia windows BMP file format. Unfortunately I cant help you with file commands in C, havent used em yet myself.
Very easy to read and write to bmp, open the file in binary read mode, read in what you want, open another file in binary write mode and write it back out.
Displaying the image is where it gets a little more tricky, for that you need to look into a library that can make a window and allow you to draw to it. Win32 (windows only), or wxWidgets are recommended such libraries.
Have a look at wotsit.org's BMP format download: http://www.wotsit.org/download.asp?f=bmp
Also see brackeen.com's VGA BMP page: http://www.brackeen.com/home/vga/bitmaps.html
Finally, if you're not just reading and writing BMPs but also want to display them, you'll also need a graphics library. Besides what Wraithan mentioned, I believe the SDL and Allegro can load BMPs natively. I use the SDL myself.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.