开发者

Resizing Geometries/GeometryDrawings

开发者 https://www.devze.com 2023-03-31 04:52 出处:网络
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 fro

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?


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


Used transform along with few normalizations and everything worked.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号