Subject Re: [IBO] CustomGlyphs in TIB_Bars
Author Helen Borrie
At 07:42 PM 5/06/2004 +0000, you wrote:


>Hi,
>
>I'm using the CustomGlyphs property of the several navigator bars
>suplied with IBO, but I could not find a way of using two imagens for
>the same button, one for each state (enabled/disabled).
>
>It just uses the same "enabled" version of the picture, only
>grayscaled, which causes a very bad effect on most of them.
>
>Is there a way of telling the bars to use another set of images for
>their disabled icons?

Not that I know of. If you don't like the automatic grayscaling, you need
to supply a twin bitmap 28 pixels X 13, with the enabled image on the left
and the disabled image on the right.

What works best for me is to open the .res file for the bar I want to work
with in the Image Editor, select an image and copy it into Paint. Replace
the two images I don't want with the two I do want and then copy it back to
the image editor, fix up the background and save it as a bmp. (You don't
have to go via Paint, you can do all of this stuff in the Image Editor: I
just like to fiddle with them and the Image Editor isn't very convenient
for that).

Then, in Delphi, stack the replacement images into a TImageList in the same
0-based index order as the standard button enumeration.

If you only want to replace some buttons, use the CustomGlyphsSupplied
property to enumerate the replaced buttons in the same 0-based order as
your custom ImageList.

How to get a decent-looking disabled image? I use a proprietary tool
called Hypersnap but you can use Irfanview or some other tool that can mess
around with bitmaps. I convert the image to grayscale and then reverse
black and white. This gives me an image with the dominant lights and darks
picked out. I then edit that down until I'm happy with the result.

Hope this helps.

Helen