GDI:如何画一条半透明的线?
假设有:
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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.