0

Path (Shape) stroke thickness is stretched while zooming canvas. I need to maintain stroke thickness in all scale.

I Created rectangle shape with rectangle-geometry and Path(shape). Added as children of canvas. given stroke-thickness = 2.

Path p = new Path();
GeometryGroup geomGroup = new GeometryGroup();
RectangleGeometry rectGeom = CreateRectangleGeometry(0, 0, 150, 150);
geomGroup.Children.Add(rectGeom);
p.Data = geomGroup;
p.Fill = Brushes.Green;
p.Stroke = Brushes.Black;
p.StrokeThickness = 1;
canvas.Children.Add(p);

I am using render transform for zoom. OnMousewheel event.

Clemens
  • 123,504
  • 12
  • 155
  • 268
  • You would set the Transform property of the GeometryGroup instead of the RenderTransform of the Path. – Clemens Mar 21 '23 at 14:52

0 Answers0