PDA

View Full Version : BMP header



gustavo woltman
March 11, 2016, 21:10:48
Good morning

I have a problem with the bmp format when i try to load an image wiht my software.
when I load an image saved with IcCapture everything work fine, but if I load an image saved with the instructions below:

IcImgCntrl_A.MemorySnapImage()
IcImgCntrl_A.MemorySaveImage("C:\img.bmp")

My program crash with an error about the number's lines of the image.

I think the problem is the image's header.

I have compare the header of the two images, and i have found a difference. (See attachment)

On left is the wrong image (IcImgCntrl_A.MemorySaveImage("C:\img.bmp"), on right the correct(IcCapture)

The image is 1024x768 pixel, in hex 400x300 and into the header 00 04 00 and 00 03 00. Instead i have FD FF FF
I have changed the wrong byte of the header with an hexadecimal editor and the image is loading correctly.

Best regards

Stefan Geissler
March 14, 2016, 09:58:37
Hello Gustavo

the code is not changed since many years and worked fine.

However, what happens, if you use:

IcImgCntrl_A.ImageActiveBuffer.Bitmap.Save("test.bp");