PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Bitmaps, VB, and channels oh my!

I am making a program and I have spent the past few days beating my head against the wall, trying to get my 24-bit .bmp file to load in a eVB PictureBox! I found out through the Microsoft website, that eVB PictureBox and Image controlls don't support 24-bit bitmap files! But, there was a work a round. I can use 16-bit .bmp files! But, I found Photoshop 6.0 and MS Paint will not let me save a bitmap in 16-bit! Damn it, I thought. So I looked around the web for a Image editor that will convert my 24-bit .bmp to a 16-bit .bmp, alas after hours of searching and wadeing though misleading websites, I found nothing! My question is, do any of you know of a freeware/shareware Image editor that will let me save in 16-bit? HELP ME, I'm going insane! :lol:
It doesn't look like Paint Shop Pro supports 16 bit bmp either. It's rather odd for a control to require a graphic format that nothing supports. Are you sure you're not missing something?

Dan East
there are not 16bit windows bitmaps. This is from the fileformats FAQ:


BMP is the native bitmap file format of the Microsoft Windows environment.
It efficiently stores mapped or unmapped RGB graphics data with pixels 1-,
4-, 8-, or 24-bits in size. Data may be stored raw or compressed using a
4-bit or 8-bit RLE data compression algorithm. BMP is an excellent choice for
a simple bitmap format which supports a wide range of RGB image data.


cryo
Well you are wrong... I play with 16 bpp DIBs all the time and they work very well.

What you have to do is use the first 3 entries of the "palette" section to hold your color masks.
There are 16bit bmp's!
A lot of applications (Windows Paint for example) can view them, but are unable to create some.
hmm, is there some sort of official BMP format description? I just looked it up on the file format FAQ, and they do not say a word about 16bit...

cryo
Go to the MSDN-Library of Visual Studio and search for description of BITMAPINFOHEADER structure. The member biBitCount contains the following:

"...
16 The bitmap has a maximum of 2^16 colors. If the biCompression member of the BITMAPINFOHEADER is BI_RGB, the bmiColors member is NULL. Each WORD in the bitmap array represents a single pixel. The relative intensities of red, green, and blue are represented with 5 bits for each color component. The value for blue is in the least significant 5 bits, followed by 5 bits each for green and red. The most significant bit is not used. The bmiColors color table is used for optimizing colors used on palette-based devices, and must contain the number of entries specified by the biClrUsed member of the BITMAPINFOHEADER.
If the biCompression member of the BITMAPINFOHEADER is BI_BITFIELDS, the bmiColors member contains three DWORD color masks that specify the red, green, and blue components, respectively, of each pixel. Each WORD in the bitmap array represents a single pixel.

Windows NT: When the biCompression member is BI_BITFIELDS, bits set in each DWORD mask must be contiguous and should not overlap the bits of another mask. All the bits in the pixel do not have to be used.

Windows 95 and Windows 98: When the biCompression member is BI_BITFIELDS, the system supports only the following 16bpp color masks: A 5-5-5 16-bit image, where the blue mask is 0x001F, the green mask is 0x03E0, and the red mask is 0x7C00; and a 5-6-5 16-bit image, where the blue mask is 0x001F, the green mask is 0x07E0, and the red mask is 0xF800.
..."
:D Woohoo!!! :D I finally found a program that lets you save in 16-bit BMP! It's called 20/20, for all of you eVB developers here is a link http://www.hotfreeware.com/2020/2020.htm