News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Icon info display program

Started by NoCforMe, December 06, 2023, 09:18:24 AM

Previous topic - Next topic

NoCforMe

Just finished a pretty nice icon info display program. (Well, at least the first phase.) It shows you the innards of a Windows .ico file: size, # of colors, palette (if there is one), the XOR (color) and AND (monochrome transparency) bitmaps, whether the icon contains alpha-channel data, etc. Source included in .zip plus a motley assortment of icons to play with.

If you try it let me know how it works for you, especially if it doesn't work (or works incorrectly) on certain icons. If so, maybe you could attach those icons so I can test with them. All my code uses the old BITMAPINFOHEADER format, and I haven't found any icons yet that use any of the "newer" versions of bitmap header structures.

The program is fairly thorough. It correctly handles one of the more tricky problems with icons (and bitmaps) which is the issue of padding: all bitmap data (XOR and AND maps) must be aligned on DWORD boundaries, and must be padded if it doesn't.

The program shows information for all the icons in a multiple-icon file, but it only shows one icon in the display window (I'm not even sure whether it's the first or the last one). It's really made for single-icon files. I suppose the next revision should show all the icons in a file, maybe in a scrollable window or something.

I have a companion utility, a console BMP-to-ICO converter that I created some of these icons with, which I'll post here shortly.

Internally, for certain types of icons (those without alpha-channel data or 24- or 32-bit data) I actually "convert" the ICO to a BMP, because really an icon is just a bitmap in a different disguise.

One thing that doesn't work is displaying 1-bit (monochrome) icons. I'm using BitBlt() or TransparentBlt() to display non-alpha icons, depending on whether they contain transparency (I use DrawIcon() for alpha and 24/32-bit ones). For some reason it doesn't seem to want to render monochrome icons correctly. I'm kind of ignoring that for the moment, as I don't think anyone actually uses those kinds of icons.

Anyhow, let me know what you think.

Had to re-upload the .zip because I left out a file. This one's good.
Assembly language programming should be fun. That's why I do it.

NoCforMe

New version (source + .exe) posted here. Works well.
Assembly language programming should be fun. That's why I do it.