Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: TGraphicControl and transparent background colour


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 0
Vaclav Smidl

Posts: 27
Registered: 1/23/11
TGraphicControl and transparent background colour  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 22, 2018 10:50 PM
Hello,
Iam using component which is derived from TGraphicControl (TLEDLabel-https://torry.net/authorsmore.php?id=715). It is simple component with one picture and one line of text which is painting in override method Paint to canvas. There is no problem when I using this component in standard Windows VCL style. But now Iam playing with different style and component has a problem with background colour (transparent colour).

When component is placed on TPanel, VCL “non Windows”style is activated (TPanel is dark for example) then component takes colour (property Color) from TPanel and doesn’t respect the dark visual color of TPanel. Problem is when visual color defined by style doesn’t correspond to Color property. Text`s background has different color then TPanel (parent) and it is not looks good.
So how can I detect the real colour during paint method? Or how can I solve this colour mismatch? I know the solution must exist because TLabel normally takes correct background and TLabel is inherited from TGraphicControl.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02