R – How to put a transparent color on a form

delphitransparency

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?

Best Answer

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.