相当于 Linux 中的 Windows GDI 区域
我有时使用 Windows GDI 区域进行图形绘制和失效/验证。例如程序 http://www.maxerist.net/main/soft-for -win/tubicus (oss) 仅使用区域(无位图或离屏缓冲区)制作。绘图是使用 FillRgn 和 FrameRgn 制作的,使用 InvalidateRgn 和 BeenRgn 进行失效和绘画,每个单元格(参见屏幕截图)都是使用 CreateEllipticRgn、CreatePolygonRgn 和 JointRgn 创建的简单区域。
我计划将其移植到 Linux 上。据我了解,Linux中有很多图形库。有支持类似windows区域的吗?
谢谢
I sometimes use windows gdi regions for graphics drawing and invalidation/validation. For example the program http://www.maxerist.net/main/soft-for-win/tubicus (oss) was made using only regions (no bitmaps or off-screen buffer). The drawing was made with FillRgn and FrameRgn, invalidation and painting with InvalidateRgn and CombineRgn, every cell (see screenshot) is a simple region created with CreateEllipticRgn, CreatePolygonRgn and CombineRgn.
I have plans to port it to Linux. As I understood, there are many graphics libraries in Linux. Are there ones that support windows-like regions?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您想要使用 X Window System(又名 X11)作为图形平台。它的客户端库称为 Xlib。该平台支持多边形区域。
有许多在 Xlib 之上编写的库(Gtk、Qt、wxWindows 等),但您始终可以直接将低级 Xlib API 与其中任何一个一起使用。 Qt 甚至支持椭圆区域。我不知道细节,但我猜它是在 X11 多边形区域之上实现的。
You want to use The X Window System, a.k.a. X11, as your graphic platform. Its client library is called Xlib. The platform supports polygonal regions.
There are many libraries written on top of Xlib (Gtk, Qt, wxWindows and more) but you always can use the low-level Xlib API directly with any of them. Qt even supports elliptic regions. I don't know the details but I guess it's implemented on top of X11 polygonal regions.
Qt 有很多绘画选项,可以使用
QPainter
和 < code>QPainterPath 对象可能很适合您。 (Qt 发行版中有示例)。您可以组合(相加/相交/相减)路径。QGraphicsView 框架
也是一个不错的选择。Qt has a lot of options for painting, and using
QPainter
withQPainterPath
objects might suit you well. (There are samples in the Qt distribution). You can combine (add/intersect/substact) paths.The
QGraphicsView framework
is a good alternative too.