开发者

WPF C# Finding the corners of a transformed RectangleGeometry

开发者 https://www.devze.com 2023-02-04 16:31 出处:网络
I\'m trying to do some hit testing on a Rect I\'ve drawn with several RenderTransforms pushed to the Canvas\' DrawingContext. I\'ve applied the same rotate/scale/translate transforms to a RectangleGeo

I'm trying to do some hit testing on a Rect I've drawn with several RenderTransforms pushed to the Canvas' DrawingContext. I've applied the same rotate/scale/translate transforms to a RectangleGeometry so I can get the bounds of the final drawing. However, the .Bounds property on RectangleGeometry returns the axis-aligned bounding box, while I need the oriented bounding box.

In short, I need some 开发者_运维技巧way to find the corners of the actual transformed rectangle so I can perform hit/collision testing on it.


Apply the transforms to the points of the rectangle.

0

精彩评论

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