Create 8 Bit Grayscale Bitmap

01-18-2005, 04:43 PM
I am working on a project that converts text and files to an 8 bit bitmap. I have looked at some code and can make a 24bit bitmap, but that is not what I was after. Anyone got any ideas on how I can do this in VB6, without having to buy additional APIs or buying VB.NET?

01-18-2005, 06:31 PM
It's pretty simple really. Fill out the BITMAPFILEHEADER, BITMAPINFOHEADER with 256 item array of RGBQUAD and pixel data which are single byte values pointing to items in the array.

The RGBQUAD array will contain grayscale RGB entries as follows: 0,0,0 1,1,1 2,2,2 ... 255, 255, 255

Pixel data will be aligned on dword boundries. This means that scan lines will be padded with zeros up to the next number evenly divisible by four.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum