Click to See Complete Forum and Search --> : i just don't know whats wrong with bmp app


quietcoder
July 16th, 2002, 02:06 AM
i'm using Dev-C++ 4.

it will compile and i can run the program, however the bmp is not viewable in the preview app. You can open the bmp file in paint.
although its not the intended output for the bitmap, its an error. i've been tying to get this to work for at least a month and i just don't know how to fix this. the jist of the app is that you have an input.txt file with a many ones and zeros and the app will turn it into a bitmap by
asking you what color you want for the zeros (red, green, blue) then it will ask what color do you want for the ones (red, green, blue) now its going to ask if you want to compress the ones and zeros you enter in the number of ones and zeros in a row you want compressed and the colors that will represent the compressed bits then it opens the txt file and calculates the needed width and height of the bitmap. after that it closes and reopens the txt file and reads it and writes the ones and zeros to the bitmap. closes the txt fille and outputs the bitmap.

this project has 'testcompression.cpp' and 'bitmap.cpp' in it using 'bitmap.h', 'iostream.h', 'stdlib.h', and 'fstream.h'. The two files begining with bitmap are found at http://www.csse.monash.edu.au/~tonyj/raytracing/ the only thing i modified was putting " ios::trunc |" infront of " ios::out" on line 56 of 'bitmap.cpp'.

thanks in advance

Anthony Mai
July 16th, 2002, 09:47 AM
If your "BMP" file can not be viewed by another application, your "BMP" file does not have a correct format.

What you need to do, is visit
http://www.wotsit.org/
and download a copy of the BMP file format description, and compare it with the binary of your "BMP" file, and see where you screwed up, and correct it.