Stringray 网格透明背景
在Stringray网格中,可以使用透明背景,允许背景通过网格显示的对话框。
在文档中它指出:
但要小心;您应该禁用滚动,否则每次滚动时都必须重新绘制网格(通过覆盖
DoScroll
)。
我有一个可滚动网格并覆盖 DoScroll
并确保我调用 Redraw
并尝试了 Invalidate
,但是网格仍然没有完全擦除并且重画。
我还尝试通过将 m_bForceOldDrawing
设置为 TRUE
来使用旧的绘图方法。
如何创建一个具有透明背景的网格,可以在滚动后正确绘制而不留下伪影?
In Stringray grid, there is the ability to use a transparent background which allows the background of the dialog to be shown through the grid.
In the documentation it states:
But be careful; you should disable scrolling or you have to redraw the grid each time it is scrolled (by overriding
DoScroll
).
I have a scrollable gird and override the DoScroll
and make sure I call Redraw
and also tried Invalidate
, however the grid is still not completely erasing and redrawing.
I also tried using the old drawing method by setting m_bForceOldDrawing
to TRUE
.
How can I create a grid that has a transparent background that paint correctly after a scroll without leaving artifacts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,您必须通过重写 DoScroll 来重绘网格,因为它不再使用 ScrollWindow 来滚动内容,因为背景是透明的。
然而,现在您的背景上出现了网格伪影。
这是因为网格后面的背景没有被重绘。
您是否为父母设置了clipchildren?
另一个潜在的问题是背景没有被绘制,因为它没有意识到它已经暴露了。
尝试通过以下方式致电家长。
Parent.Invalidate();
父级.UpdateWindow();
在调用之前...
Invalidate();
Yes you have to redraw the grid by overriding DoScroll because it is no longer using ScrollWindow to scroll contents because the background is transparent.
However you now have artifacts of the grid over your background.
This is because the background behind the grid is not getting redrawn.
Do you have clipchildren set for the parent?
Another potential problem is that the background is not being drawn because it doesn't realize it has been exposed.
Try calling the parent with the following.
Parent.Invalidate();
Parent.UpdateWindow();
before calling...
Invalidate();