Nov 29th, 2000, 10:15 AM
I need routines to read and write icon files with multiple size and color formats.
Because I could not find a good routine on the net I have been reading the icon files myself using information from the MSDN.
I can read and store all the header information
What I need at this stage is any information on the bitmap format. The documentation states it is the same as a standard bitmap. The following is from MSDN:
'=========================================================
typdef struct
{
BITMAPINFOHEADER icHeader; // DIB header
RGBQUAD icColors[1]; // Color table
BYTE icXOR[1]; // DIB bits for XOR mask
BYTE icAND[1]; // DIB bits for AND mask
} ICONIMAGE, *LPICONIMAGE;
The icHeader member has the form of a DIB BITMAPINFOHEADER. Only the following members are used: biSize, biWidth, biHeight, biPlanes, biBitCount, biSizeImage. All other members must be 0. The biHeight member specifies the combined height of the XOR and AND masks. The members of icHeader define the contents and sizes of the other elements of the ICONIMAGE structure in the same way that the BITMAPINFOHEADER structure defines a CF_DIB format DIB.
'=========================================================
Does anyone have any ideas how I can extract the color table and pixel data and then draw them within VB?
I need a routine that will work from the binary data that I am reading in rather than using something like the ExtractIcon API
Thanks.
PS Hope this not too hard!
Because I could not find a good routine on the net I have been reading the icon files myself using information from the MSDN.
I can read and store all the header information
What I need at this stage is any information on the bitmap format. The documentation states it is the same as a standard bitmap. The following is from MSDN:
'=========================================================
typdef struct
{
BITMAPINFOHEADER icHeader; // DIB header
RGBQUAD icColors[1]; // Color table
BYTE icXOR[1]; // DIB bits for XOR mask
BYTE icAND[1]; // DIB bits for AND mask
} ICONIMAGE, *LPICONIMAGE;
The icHeader member has the form of a DIB BITMAPINFOHEADER. Only the following members are used: biSize, biWidth, biHeight, biPlanes, biBitCount, biSizeImage. All other members must be 0. The biHeight member specifies the combined height of the XOR and AND masks. The members of icHeader define the contents and sizes of the other elements of the ICONIMAGE structure in the same way that the BITMAPINFOHEADER structure defines a CF_DIB format DIB.
'=========================================================
Does anyone have any ideas how I can extract the color table and pixel data and then draw them within VB?
I need a routine that will work from the binary data that I am reading in rather than using something like the ExtractIcon API
Thanks.
PS Hope this not too hard!