2D图形优化技巧

发布于 2024-09-09 20:41:35 字数 351 浏览 0 评论 0原文

你知道有什么技术可以加速 2d 图元(例如直线和圆)吗?

我开发的应用程序允许编辑包含此类基元的图像。它们可以像 Windows 桌面图标一样移动和选择(包括通过矩形进行分组选择)。光标所在的对象也会突出显示。

看来使用鼠标时涉及到很多显示更新。所以我需要巧妙地做到这一点。

我知道:

  1. 将 GDI+ 更改为 D3D 可以加快显示速度,
  2. 脏矩形允许将更新限制为仅更改的矩形。 (主要缺点是包含线的矩形可能与显示区域一样大)
  3. 异或技术允许通过第二次绘制来清除图元。 (缺点是它对于多色图像和具有共同点的图元似乎毫无用处)

感谢有用的提示和信息。链接。

do u know any techniques allowing to speed up 2d primitives such as lines and circles?

i develop application that allow to edit images containing such primitives. they can be moved and selected in the same way as windows desktop icons are (including group selection by rectangle). also objects that cursor is on are highlighted.

it seems that there are many display updated involved when mouse is used. so i need to do it smartly.

i know that:

  1. changing GDI+ to D3D can speed up display greately
  2. dirty rects allow to restrict updates to only those rectangles that changed. (major drawback is that rectangles containing lines can be as big as display area)
  3. xor technique allow to clear primitive by drawing it second time. (drawback is that it seems to be useless with multicolor images and primitives with common points)

thanks for useful tips & links.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文