WPF不变(不缩放)冲程厚度 [英] WPF Invariant (does not scale) stroke thickness
问题描述
大家好,
这是我的第一篇文章,所以如果这是一个常见问题,请放心,因为我只能以为是这样!
我已经开发了一个CAD引擎用户控制使用WPF将线条,椭圆,多边形等渲染到效果很好的画布上.
要应用比例,我希望在画布上使用与应用翻译相同的方式进行单个变换.但是作为CAD引擎,我不希望在缩放图像时改变笔触厚度.到目前为止,我能够做到这一点的唯一方法是在更改比例因子时分别缩放每个元素.在较小的图纸上,这足够快,但是现在我要处理从DXF/DWG截取的更大的图纸,速度损失相当大,以至于需要考虑清除并重新绘制,而不是尝试调整每个元素.
<我确实在MSDN服务台上谈论了有用的话题,他们认为为每个UIElement设置ScaleStrokeThickness标志的建议很有可能.但是到目前为止,我还没有看到这样的功能,或者想出一种更快的方法来对抗这种明显的疏忽.
任何人都可以将我引向更快的解决方案的方向,和/或提供任何有关解决方案可能性的见解.
提前感谢!
Mat
Hi all,
It's my first post so go easy on me if this is a common question, as I can only assume it will be!
I have developed a CAD engine user control using WPF to render my lines, ellipses, polygons etc to a canvas with great effect.
To apply a scale I had wished to use a single transform on my canvas in the same way as I apply a translation. However being a CAD engine I do not wish for the stroke thickness to change when I scale the image. So far the only way I have been able to do this is to scale each element individually when ever my scale factor is changed. On smaller drawings this is fast enough but now I am moving on to dealing with much larger drawings taken from DXF/DWG the speed loss is considerable to the point of considering a clear and redraw rather than attempting to adjust each element.
I did speak to the helpful chaps on the MSDN help desk, who thought the suggestion of a ScaleStrokeThickness flag for each UIElement had potential. However thus far I am yet to see such a feature or devise a faster approach to combat this apparent oversight.
Can anyone direct me in the direction of a faster solution, and/or provide any insight into the possibility of this feature being added in the future (with time scale if possible)?
Thanks in advance!
Mat
推荐答案
任何人有什么想法吗?
这篇关于WPF不变(不缩放)冲程厚度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!