调整几何图形/几何图形的大小

发布于 2024-12-01 17:22:34 字数 332 浏览 5 评论 0原文

我正在以几何形式绘制一些基元(“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 技术交流群。

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

发布评论

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

评论(2

奢华的一滴泪 2024-12-08 17:22:34

您正在寻找的可能是内置 ViewBox 容器,根据定义:

定义一个内容装饰器,可以拉伸和缩放单个子项以填充可用空间。

wpftutorial.net 概述

What you are looking for is likely the built-in ViewBox Container which by definition:

Defines a content decorator that can stretch and scale a single child to fill the available space.

Overview on wpftutorial.net

浅忆流年 2024-12-08 17:22:34

使用变换和少量标准化,一切正常。

Used transform along with few normalizations and everything worked.

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