Мой код рисует комбинацию горизонтальных и вертикальных линий в wpf.Я хочу масштабировать только горизонтальные линии .. этот код масштабирует как горизонтальные, так и вертикальные.
Path path = new Path();
SolidColorBrush brush = new SolidColorBrush();
brush.Color = Colors.Red;
path.Stroke = brush;
path.StrokeThickness = 4;
LineGeometry lineGeometry = new LineGeometry();
lineGeometry.StartPoint = new Point(10, 100);
lineGeometry.EndPoint = new Point(100, 100);
LineGeometry lineGeometry2 = new LineGeometry();
lineGeometry2.StartPoint = new Point(100, 100);
lineGeometry2.EndPoint = new Point(100, 200);
LineGeometry lineGeometry3 = new LineGeometry();
lineGeometry3.StartPoint = new Point(100, 200);
lineGeometry3.EndPoint = new Point(200, 200);
LineGeometry lineGeometry4 = new LineGeometry();
lineGeometry4.StartPoint = new Point(200, 200);
lineGeometry4.EndPoint = new Point(200, 100);
LineGeometry lineGeometry5 = new LineGeometry();
lineGeometry5.StartPoint = new Point(200, 100);
lineGeometry5.EndPoint = new Point(300, 100);
GeometryGroup geometryGroup = new GeometryGroup();
geometryGroup.Children.Add(lineGeometry);
geometryGroup.Children.Add(lineGeometry2);
geometryGroup.Children.Add(lineGeometry3);
geometryGroup.Children.Add(lineGeometry4);
geometryGroup.Children.Add(lineGeometry5);
path.Data = geometryGroup;
var scaling = new ScaleTransform(2, 1);
path.RenderTransform = scaling;
canvas1.Children.Add(path);