From: dic5340@hertz.njit.edu (David Charlap)
Newsgroups: comp.os.os2.misc
Subject: Re: Icon formats, etc.
Keywords: Icon
Date: 19 Nov 92 21:16:56 GMT
Organization: New Jersey Institute of Technology, Newark, N.J.

In article <1992Nov17.193152.24341@nas.nasa.gov> ryan@wk229.nas.nasa.gov (James S. Ryan) writes:
>When editing icons, I find that it is possible to save them in any of
>a number of different formats, and that many combinations of
>resolution and number of colors are possible.

Right.  You can vary the device resolution, the pixel size, the number
of pixels, and thenumber of colors.

>I tried to learn about these formats in all of the online help, under
>every name I could think of.  No dice.  Can't find anything in the
>FAQ or by lurking in these newsgroups.  If you can help, please answer:
>
>1) If there is more than one format stored, which one will be
>   used in a given situation? (screen resolution/driver, etc.)

You can force a certain sized icon to be displayed, but normally you
go with the default, which is hardcoded into the device driver.  The
screen driver will specify a size in pixels normally, while a printer
will specify a size based on its driver.

>2) I see that the icons appear to be about the same size regardless
>   of the size of bitmap which is stored.  How is the scaling done?
>   (e.g., if I make a 64x64 icon, and display it on a screen where it
>   covers only 20x20 pixels, does it average color values?  throw
>   pixels away?  what?) 

First, it tries to find an exact match from the various sizes in the
file.  Failing that, it picks one and scales it.  I don't know the
algorithm for picking one.  I think it picks one of the "independant"
formats, depending on the color depth of the display device.  It is
scaled up by duplicating columns and rows.  it is scaled down by
throwing away columns and rows.

>3) There is the option of storing the icon in (pardon my faulty
>   memory of the terms) forms such as 1.2, 2.0 and 2.0 packed.
>   a) is 2.0 incompatible with 1.2 systems?
>   b) is 2.0 better than 1.2 for 2.0 systems?
>   c) what is "2.0 packed", and why doesn't that button work?

2.0 format can't be called by 16-bit apps.
2.0 format contains a few extra fields (like printer resolution)
I've no idea what 2.0 packed it.  I have yet to load such an icon.  I
know you can't save one.  I also know that you can't save a 1.1 icon,
although you can load them fine (I've done it)

>4) It seems that icons can be stored in files like "myicon.ico"
>   or in some other way (as part of the extended attributes?).
>   how does this work?  I'd just like to know what's going on.

The icon editor saves icons in .ICO format.  Icons can be attached to
program code through the resource compiler (RC.EXE).  When WPS sees a
program, it gets the program's icon (either from the code or from the
.ICO file of matching name) and stores it in EA's for quick retrieval
later on.

>5) Anything else I should have asked.

Not really, but I'll volunteer some more:

If you create a custom icon size, the icon editor will make it a
variant of some form based upon the "device resolution".  0x0 will
make it an independant variant, 640x480 will make it a VGA variant,
1024x768 will make it an 8514 variant.  I believe that the device
resolution (and number of colors) is used in selecting which icons to
scale when an exact match is not available.

-- 
  |)  David Charlap          | .signature confiscated by FBI due to
 /|_  dic5340@hertz.njit.edu | an ongoing investigation into the
((|,)                        | source of these .signature virusses
 ~|~
Newsgroups: comp.os.os2.misc