Having some Geometry data and a Transform how can the transform be applied to the Geometry to get a new Geometry with it's data transformed ?
Ex: I Have a Path object that has it's Path.Data set to a PathGeometry object, I want to tranform the points of the PathGeometry object in place using a transform, and not apply a transform to the PathGeometry that will be used at render time.
P.S. I know that the Transform class has a method Point Transform.Transform(Point p)
that can be used to transform a Point but...is there a way to transform a arbitrary geometry at once?
Edit: See my repply for a currently found solution
I've found a solution with which arbitrary tranform can be applied to a path geometry, thanks to Todd White's answer:
Basically Geometry.Combine is used to combine the desired geometry with Geometry.Empty using Union, and the desired transform is given. The resulting geometry is transformed with the given transform.
PathGeometry geometryTransformed = Geometry.Combine(Geometry.Empty, geometry, GeometryCombineMode.Union, transform);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With