Struggling with the Icon File format.

Discussion in 'Questions (Windows Mobile)' started by RandomCoder, Aug 4, 2007.

  1. RandomCoder

    RandomCoder Well-Known Member Licensed User

    To better understand the Icon File format I've modified Erel's code to read an icon file and store what was read in a TextBox.
    I've then copied this to Excel and sorted the data into its corresponding sections, i.e. Entries, InfoHeader, Color etc.

    This has helped me to understand how the file is built but I'm struggling to make sense of the XOR-bitmap/AND-Bitmap data.
    Does each Byte represent the index of the color in the color table :confused:
    So a value of 25 would be referring to the 25th color listed in the color table?

    I'm presuming that each Byte represents a single pixel and I understand that the pixels are in reverse order which frankly just complicates things even further :sign0148:

    Any help would be greatly appreciated!

  2. Erel

    Erel Administrator Staff Member Licensed User

    The XOR bitmap is used for the transparency pattern only.
    In the AND bitmap, each byte represents the color in the color table as you've written.
  3. RandomCoder

    RandomCoder Well-Known Member Licensed User

    Thank you Erel, I thought that I had understood correctly.
    Guess this means that I have to give my palette an index now, I was hoping to just store the RGB values for each pixel in the order that they are used to create the icon. Back to the drawing board again :sign0135: