调整几何图形/几何图形的大小
我正在以几何形式绘制一些基元(“F1 M 77,92L 704,92L 704,517L 77,517L 77,92 Z”,即),将它们存储在 GeometryDrawings 中,并使用 DrawingVisuals 和从 FrameworkElement 继承的对象进行显示。到目前为止一切都很顺利,但现在需要手动调整一些几何图形的大小。我的意思是输入新的高度/宽度值并获取新坐标,而不使用变换。几何图形的 BoundingBox 是只读的,并且不能选择更改内容设置为拉伸的相应可视化对象的大小,因为状态(新数据)不会在生成的(几何图形)序列化 xaml 中维护。有什么想法如何实现这一目标吗?
I'm drawing some primitives in Geometry form ("F1 M 77,92L 704,92L 704,517L 77,517L 77,92 Z" i.e.), storing them in GeometryDrawings and displaying by use of DrawingVisuals and object inherited from FrameworkElement. Everything was smooth so far, but now there is a need to resize some geometries manually. By that i mean entering new height/width value and get new coordinates not using Transforms. BoundingBox of geometry is readonly, and changing size of respective visualization object with content set to stretch is not an option because state (new data) won't be maintained in resulting (geometry) serialization xaml. Any ideas how to achieve that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您正在寻找的可能是内置 ViewBox 容器,根据定义:
wpftutorial.net 概述
What you are looking for is likely the built-in ViewBox Container which by definition:
Overview on wpftutorial.net
使用变换和少量标准化,一切正常。
Used transform along with few normalizations and everything worked.