Back in the day, when I was working on handhelds, icons were always defined in some nasty bit-fiddly binary format. Masking was similar hard.
I ended up building (?) an Excel spreadsheet to do it for me. In some ways, it was almost the inverse of the technique in the link:
- one set of cells was used to "draw" the icon by filling them with "X"s
- another set of cells would glue together the values specified by each X into appropriate 32-bit integer values
- a final set (the coup de grace!) would grab those ints and bit twiddle them directly into a short line of legitimate c code, ready to be copied into a header file
I ended up building (?) an Excel spreadsheet to do it for me. In some ways, it was almost the inverse of the technique in the link:
- one set of cells was used to "draw" the icon by filling them with "X"s
- another set of cells would glue together the values specified by each X into appropriate 32-bit integer values
- a final set (the coup de grace!) would grab those ints and bit twiddle them directly into a short line of legitimate c code, ready to be copied into a header file