GDI:如何画一条半透明的线?

发布于 2025-02-09 00:27:08 字数 205 浏览 3 评论 0原文

假设有:

RoundRect(hdc, 0, 0, 1000, 1000, 50, 50);

这是笔:

CreatePen(PS_SOLID, 15, RGB(5, 61, 88));

如何使填充不透明和中风透明(0-255,无论如何)? 在gdi中(不在gdi+中)

Let's say there is:

RoundRect(hdc, 0, 0, 1000, 1000, 50, 50);

This is the pen:

CreatePen(PS_SOLID, 15, RGB(5, 61, 88));

How do I make the fill opaque and the stroke transparent (0-255 , whatever)?
In GDI (not in GDI+)

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

醉梦枕江山 2025-02-16 00:27:09

GDI并不真正支持直接绘制半透明的线条。

但是,您可以将行绘制到与要绘制的窗口的客户端区域相同的屏幕位图,然后使用alphablend将该位图融合到目标窗口中。

GDI doesn't really support drawing a translucent line directly.

But you can draw your line to an off-screen bitmap the same size as the client area of the window where you want to draw, then use AlphaBlend to blend that bitmap into the destination window.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文