Thread: Reading a bitmap image

  1. #16
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    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
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 05-27-2009, 12:46 PM
  2. HotSpot image controls (web)
    By novacain in forum C# Programming
    Replies: 0
    Last Post: 06-25-2008, 04:27 AM
  3. reading gif image pixel Information-help
    By kapil1089thekin in forum C Programming
    Replies: 2
    Last Post: 05-17-2008, 01: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, 07:40 PM
  5. Replies: 6
    Last Post: 03-03-2005, 03:52 AM