Search the web
Sign In
New User? Sign Up
delphigames · Discussion of game programming in the Delphi development environment.
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
How to make real transparency (with control)?   Message List  
Reply | Forward Message #7582 of 7611 |
Re: [DelphiGames] How to make real transparency (with control)?



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]




Thu Dec 13, 2007 1:21 pm

rbaprog
Offline Offline
Send Email Send Email

Forward
Message #7582 of 7611 |
Expand Messages Author Sort by Date

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...
ani_silvia
Offline Send Email
Dec 12, 2007
8:13 am

Ani_Silvia <ani_silvia@...> wrote: Hi guys, I'm trying to do control with real transparency – when you put a picture...
rbaprog
Offline Send Email
Dec 13, 2007
9:38 pm

Hi rbaprog, I've read very carefully your post (2 times). Here are some observations: "You can get background using Themes unit" Do you know how? (I know that...
ani_silvia
Offline Send Email
Dec 17, 2007
10:01 am

Ani_Silvia <ani_silvia@...> wrote: "You can get background using Themes unit" Do you know how? (I know that can be done...
rbaprog
Offline Send Email
Dec 17, 2007
9:04 pm

Thank you, thank you very much rbaprog!!! Here I will share what I have found and hope this will be helpful. DrawThemeParentBackground works fine on Delphi7...
ani_silvia
Offline Send Email
Dec 19, 2007
8:49 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help