Reading a bitmap image

This is a discussion on Reading a bitmap image within the C Programming forums, part of the General Programming Boards category; Another version of this could be to eradicate the chunk headers and simply store the dimensions of each bitmap in ...

  1. #16
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,598
    Another version of this could be to eradicate the chunk headers and simply store the dimensions of each bitmap in the CMPHeader. These dimensions would apply to every image in the file. Then you could just write out the raw data for all bitmaps in RLE form. To read it, you would only need to know the dimensions and you could correctly extract the data. This would cut the size of the file tremendously. Of course the palette would still be in the last 768 bytes.

  2. #17
    Registered User
    Join Date
    Feb 2004
    Posts
    4
    hmmm, just reboot your machine. Or create a swap partition.
    Again same problem. Any other solutoin ??

  3. #18
    Registered User scrapedbr's Avatar
    Join Date
    May 2003
    Posts
    19
    ok, boot your linux-distro and don't open X. Try to use program only in a terminal.. if this does not work.. i don't know one more option...
    cscience.org
    gobolinux.org
    Gobolinux user: 00101100

  4. #19
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Find out how much memory you are trying to allocate. In this case output the values of height and width.

  5. #20
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,598
    You are probably trying to allocate too much memory due to an incorrect calculation. Unless the bitmap is extremely large I cannot fathom running out of memory.

    The total size of the bitmap can be retrieved from the bitmap header.

    The only time you will run out of memory is if your IDE is hogging it all thus causing your malloc or new to fail. I've only experienced this in DOS and since I know nothing about Linux, you need to do some research via google.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 05-27-2009, 01:46 PM
  2. HotSpot image controls (web)
    By novacain in forum C# Programming
    Replies: 0
    Last Post: 06-25-2008, 05:27 AM
  3. reading gif image pixel Information-help
    By kapil1089thekin in forum C Programming
    Replies: 2
    Last Post: 05-17-2008, 02:13 AM
  4. how to convert a bitmap image to a jpg image file using C++?
    By nomer in forum Windows Programming
    Replies: 4
    Last Post: 06-04-2006, 08:40 PM
  5. Replies: 6
    Last Post: 03-03-2005, 03:52 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21