Forum > LCL

EraseBackground and WMEraseBkgnd do not work fine

(1/1)

jixian.yang:
In the component inherited TCustomControl, Override the two functions and did nothing, the background changed.

In other words, when we do not paint the canvas and disable erase backgroud function, the component should be hollow completely.

felipemdc:
TCustomControl currently does no support transparency, you just have to draw the entire area in which it is located. You can, however:

* immitate the color of the parent control.
and
* Set an irregulare shape for the control, using TWinControl.SetShape(TRegion)

jixian.yang:
Thanks,

It is easy to use the color of parent control.
But by using SetShape function, the changed background of the inherited TCustomControl does not be a good show since the TImage under it.

Maybe the transparent effect is needed for all platforms if we want to create some cool component.

felipemdc:

--- Quote from: jixian.yang on November 06, 2010, 10:54:39 am ---But by using SetShape function, the changed background of the inherited TCustomControl does not be a good show since the TImage under it.
--- End quote ---

Strange, for me it works perfectly. If you have a minimal test case it would be good to open a bug report and attach it if even to track the issue.

I don't use TImage, but my setShape'd buttons show fine my drawings in the TCustomControl descendent under them.


--- Quote ---Maybe the transparent effect is needed for all platforms if we want to create some cool component.
--- End quote ---

Yes, it would be a nice addition, but currently not indispensable for me personally.

Navigation

[0] Message Index

Go to full version