public GraphicsPath2 Scale(float s) { GraphicsPath2 result = new GraphicsPath2(); for (int i = 0; i < pathPoints.Count; i++){ result.pathPoints.Add(new Point2(s*pathPoints[i].X, s*pathPoints[i].Y)); result.pathTypes.Add(pathTypes[i]); } return result; }
public GraphicsPath2 Scale(float s) { GraphicsPath2 result = new GraphicsPath2(); for (int i = 0; i < pathPoints.Count; i++) { result.pathPoints.Add(new Point2(s * pathPoints[i].X, s * pathPoints[i].Y)); result.pathTypes.Add(pathTypes[i]); } return(result); }
public void DrawPath(Pen2 pen, GraphicsPath2 path) { SetPen(pen); for (int index = 0; index < path.PathPoints.Length; index++){ Point2 point = path.PathPoints[index]; if (index == 0){ template.MoveTo(point.X, currentHeight - point.Y); } else{ template.LineTo(point.X, currentHeight - point.Y); template.Stroke(); template.MoveTo(point.X, currentHeight - point.Y); } } template.Stroke(); }
/// <summary> /// Draws a GraphicsPath. /// </summary> /// <param name="pen">Pen that determines the color, width, and style of the path.</param> /// <param name="path">GraphicsPath to draw.</param> public void DrawPath(Pen2 pen, GraphicsPath2 path) { DrawLines(pen, path.PathPoints); }