我有一个表单,并在 Paint 事件上用渐变来绘制它。我也有那个表格上的框架。我希望框架是透明的,以查看表单的渐变,或者如果透明度不可用,则用渐变绘制框架。
表格和框架不能闪烁:)
怎么做到的?谢谢。
编辑:
正如我所见,框架的透明度存在闪烁。所以现在对我来说最好的解决方案是重写 TFrame1.PaintWindow(DC: HDC) 并用渐变绘制框架的背景。
I have a form and paint it with a gradient on a Paint event. Also I have frames on that form. I want that frames will be transparent to see the gradient of the form or to paint the frames with the gradient instead if transparency isn't available.
The form and the frame mustn't flicker :)
Ho to do it? Thanks.
Edited:
As I see, there are flickers for frame's transparency. So the best solution for me now is to override TFrame1.PaintWindow(DC: HDC) and paint a background of the frame with a gradient.
发布评论
评论(1)
这是在框架中获得透明度的技巧,如下所述: 如何使-delphi-tframe-background-透明。
更新:
David 建议将
WS_EX_COMPOSITED
添加到样式中,以避免调整大小时出现闪烁。这应该添加到所有控件中。
Here is a trick to get transparency in frames, as described here : how-to-make-delphi-tframe-background-transparent.
Updated :
David suggested adding
WS_EX_COMPOSITED
to the style to avoid flicker when resizing.This should be added to all controls.