PDA

Click to See Complete Forum and Search --> : Converting BMP file into an array


umbongo
Sep 15th, 2002, 10:22 AM
Hello

I am looking for some advise/help with regards to decoding bitmap files and placing their contained data into an array, so that I may work with the values. I am not a complete programming newbee but have found wading through a lot of the code on the net a little confusing. So if anyone could offer me some advise of a good site to look at where I am not going to get completely swamped, or some code I would be very grateful.

Thanks for your time ; )

ChuckB
Sep 15th, 2002, 10:27 PM
Hi,
I did some BMP stuff this weekend. Most of the examples I have studied creates a buffer or a reserved area in RAM. Then they load this buffer with data.

I suppose you could create an array to fit your bitmap size (width * height) and then load into the array instead of buffer.

I can provide the code that loads the bitmap data into the buffer.

Regards,
ChuckB

umbongo
Sep 16th, 2002, 03:51 AM
Thanks I think that seeing your code would help me crack this problem.

ChuckB
Sep 16th, 2002, 06:29 PM
Hi,
Here is a Dev-C++ project that loads BMP files as textures. It is hardcoded to load 'texture1.bmp'. You can create your own textures BMP files...use

32x32, 64x64,128x128 or 256x256. 24bit color. Change the hardcoded filename to test.

Should work just fine.

The bitmap surface can be moved with the cursor keys.
Needs GLUT and OpenGL.

Regards,
ChuckB