Reputation: 3590
I draw shapes programmatically, via the DrawingContext. And I want shapes have a fixed thickness independent on the RenderTransform's scale.
Can I do it?
Upvotes: 0
Views: 486
Reputation: 128061
Use the DrawGeometry
method to draw your shapes as geometries. You could then apply the transform to their Transform
property.
var transform = new ScaleTransform(...);
var ellipse = new EllipseGeometry();
...
ellipse.Transform = transform;
drawingContext.DrawGeometry(null, pen, ellipse);
You can even modify the transform after drawing the shapes.
Upvotes: 1