public PathElement(float x, float y) { X = x; Y = y; m_Primitives = new List<PathPrimitive>(); Style = new PdfDrawStyle(); }
public RectangleElement(float x1, float y1, float x2, float y2, PdfDrawStyle borderStyle) { X = x1; Y = y1; X1 = x2; Y1 = y2; Style = borderStyle; }
public PathElement(float x, float y, PdfDrawStyle style) : this(x, y) { Style = style; }
/// <summary> /// Add rectangle primitive to the page /// </summary> public RectangleElement AddRectangle(float x1, float y1, float x2, float y2, PdfDrawStyle style) { var rectangle = new RectangleElement(x1, y1, x2, y2, style); Add(rectangle); return rectangle; }
/// <summary> /// Add path to the page /// </summary> public PathElement AddPath(float x, float y, PdfDrawStyle style) { var path = new PathElement(x, y, style); Add(path); return path; }
/// <summary> /// Add line primitive to the page /// </summary> public PathElement AddLine(float x1, float y1, float x2, float y2, PdfDrawStyle style) { var path = new PathElement(x1, y1, style); path.AddLine(x2, y2); Add(path); return path; }
/// <summary> /// Add circle primitive to the page /// </summary> public PathElement AddCircle(float centerX, float centerY, float r, PdfDrawStyle borderStyle) { var path = new PathElement(centerX - r, centerY, borderStyle); path.IsClosed = true; path.AddBezier(centerX - r, centerY + Constants.SQRT_TWO * r, centerX + r, centerY + Constants.SQRT_TWO * r, centerX + r, centerY); path.AddBezier(centerX + r, centerY - Constants.SQRT_TWO * r, centerX - r, centerY - Constants.SQRT_TWO * r, centerX - r, centerY); Add(path); return path; }