Results 1 to 4 of 4

Thread: Converting BMP file into an array

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2002
    Posts
    3

    Converting BMP file into an array

    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 ; )

  2. #2
    Addicted Member ChuckB's Avatar
    Join Date
    Jul 2002
    Location
    South Carolina, USA
    Posts
    157
    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

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2002
    Posts
    3
    Thanks I think that seeing your code would help me crack this problem.

  4. #4
    Addicted Member ChuckB's Avatar
    Join Date
    Jul 2002
    Location
    South Carolina, USA
    Posts
    157
    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
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width