Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Greying a Picture on a Graphical Button


Message #1 by "Dries de Beer" <uglyart@y...> on Fri, 16 Aug 2002 21:42:40 +0200
I would not worry about DIB, it is just a format used internally
by Windows to store bitmaps. In fact, you are already using it if
you are calling GetDIBBIts.

You have to worry about two major problems: the first one you already
know about (24bits bitmap), the second is: what if the picture is not a
bitmap? In the second case, your GetObject API will fail.
I suggest you to tell your customers that the 'grayed out' image
will work only with 24bits bitmap files, and put error checking
in you code.
Another suggestion: usually the disabled images are not just a grey
scale version of the original image, they have less gray shades
than the original colors and a kind-of 3d effect. Although it is
very complex to accomplish that (did you try to look for it in
the web?) you can mimic it restricting the range of the gray scale
values.

Regards,
Marco 
 
> Hi,
Thanks, I will do it.  I will get a feel of how the code worked on XP soon,
but I have a nagging feeling about Device Independent Bitmaps which I don't
know anything of, or at least in the sense that DIB should be here 
somewhere
and that I am ignoring it at my peril.  Any suggestions regarding DIB? Or I
am being paranoid?
Rgards
Dries

  Return to Index