Recent

Author Topic: EraseBackground and WMEraseBkgnd do not work fine  (Read 6876 times)

jixian.yang

  • Full Member
  • ***
  • Posts: 173
EraseBackground and WMEraseBkgnd do not work fine
« on: November 06, 2010, 06:22:41 am »
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

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: EraseBackground and WMEraseBkgnd do not work fine
« Reply #1 on: November 06, 2010, 10:03:51 am »
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

  • Full Member
  • ***
  • Posts: 173
Re: EraseBackground and WMEraseBkgnd do not work fine
« Reply #2 on: November 06, 2010, 10:54:39 am »
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

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: EraseBackground and WMEraseBkgnd do not work fine
« Reply #3 on: November 06, 2010, 01:56:27 pm »
But by using SetShape function, the changed background of the inherited TCustomControl does not be a good show since the TImage under it.

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.

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

 

TinyPortal © 2005-2018