Transparencies (use of opacity) in nested controls (FMX).


Transparencies (use of opacity) in nested controls (FMX).

I have a form with a background photo and a partially transparent "panel" (a TRectangle inside a TLayout, with Opacity set to 0,7). I would be able to position another TRectangle over it , covering only a part of that "panel", but, for this control only, without transparencies (I'd need a top, slightly smaller, panel in the center of my form, 100% opaque, to put labels, bitmaps, etc., over it). Is this possible with FMX?
This is the best that I can get (reduced opacity is applied also to center panel):

Comments

  1. When applying opacity, all children of that control will also have same opacity. You cannot have partially translucent parent and fully opaque children.

    However, you can position opaque controls on top of the translucent ones - put them in some container with transparent background.

    ReplyDelete
  2. You can set the Fill color of the TRectangle to have an Alpha value (be semi-transparent). It won't affect child controls because you aren't using the Opacity property.

    ReplyDelete
  3. Eli M Nice... I never thought of that...

    ReplyDelete

Post a Comment