如何在GDI +中保持笔宽度恒定 [英] How to keep pen width constant in GDI+

查看:74
本文介绍了如何在GDI +中保持笔宽度恒定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!

我有以下一段代码:

Hello!

I have the following piece of code:

Pen pen(Color(255,0,0,255);
pen.SetWidth(3);
    
m_graphics->ScaleTransform(0.1, 0.1);
m_graphics->DrawLine(&pen, 0, 0, 100, 100);



问题是,那条线也要进行转换,所以我没有线3而是线宽0.3,由系统转换为1.

有什么办法可以忽略线的转换吗?

谢谢!



The problem is, that line with also going transformation, so instead of having line with 3 I am having line width 0.3, converted by system to 1.

Is there any way to ignore transformation of line with?

Thanks!

推荐答案

尝试使用小于或等于零的笔宽.它会按您的意愿工作,在缩放时代表无限细"线的隐喻.

—SA
Try to use pen width less or equal to zero. It will work as you wanted, representing the metaphor of "infinitely thin" lines while scaling.

—SA


这篇关于如何在GDI +中保持笔宽度恒定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆