views:

348

answers:

3

I have a form with an image as the background.

Now I need to put several transparent dark color areas in several areas off the form.

I need not to hide the background. How can I do this?

+3  A: 

Standard Delphi control do AFAIK not support that kind of transparency. You therefore have two possiblities:

  • use third-party components
  • create your own component (you can derive from an existing one) and override the paint method. In the paint method just draw the correct part of the background image and darken every pixel to get the effect you want.
Smasher
Can you direct me to third-party that does this?
Jlouro
I have no experience with transparent third-party controls. You might have a look at: http://www.delphipages.com/records.cfm?kw=transparent+controls
Smasher
+1  A: 

You can try Delphi 2009/2010 which supports using PNG images. The PNG image format allows for alpha layer transparency, which it sounds it what your looking for. This assumes that your wanting a fixed shape on your form.

EDIT-- For Delphi 2007, you can attempt to use the PNG Components which if I remember correctly do properly handle alpha transparency.

skamradt
Yes, fixed shape. but I use D2007, and no upgrade plans.
Jlouro
+1  A: 

Is the background image and the darker areas the only thing that you want on your form, or do you have other components that should be blended too?

If it's only the background image and the dark areas, I would recommend that you check out Graphics32. It's an image control supporting layers. It should be fairly easy to archive what you want (or what I assume that you want...) from that.

Vegar
Yes I will have other components, but they will be on top off the images, and not blended.
Jlouro
Then I think Graphics32 will do.
Vegar