Results 1 to 2 of 2

Thread: Bitmap format in icons?

  1. #1
    Guest
    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!


  2. #2
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715
    I don't have code for it, but reading this document will tell you exactly what the file looks like.
    Oetje
    [email protected]
    93606776
    Visual Basic 6, Windows 2000

    Never pet a burning dog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width