Ani_Silvia <
ani_silvia@...> wrote: Hi guys,
I'm trying to do control with real transparency – when you put a
picture under it you must see the picture trough transparent pixels.
Can you give me some guidance how to do it keeping in mind:
1. I prefer to be derived from TGraphicControl.
2. It must be flicker-free (even the most eye candy control makes
me angry when it flicker).
3. I will do per pixel semi-transparency (using 32bit icons,
32bit png, 32bit GDI+).
Or
4. How to obtain part of the picture of a parent control that is under
the control (what will have under the control if it was invisible).
You can get background using Themes unit and do various stuff, XP + only.
Avoid flicker is difficult with GraphicControl because Delphi does a lot of
forced redrawing but you can use DoubleBuffered property of Form and Panel, you
can also get image from Panel or Form since graphic controls are drawn on the
windowed parent as they do not have a window. You can make your own transparent
windowed control with transparency using regions but no alpha, maybe you can use
Alpha with the themes unit, Graphic controls are slower but they might be better
for some stuff while windowed controls are faster and you can achieve
transparency but i'm not sure if blending can be done, maybe using themes. Maybe
the best approach is to make your drawing on a large invisible bitmap and draw
that while calculating clicks on custom buttons, that way you have full control
and no flicker.
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
[Non-text portions of this message have been removed]