public static Rectangle3D Draw3DRectangle(Types.RectEx bounds, Brush topLeft, Brush bottomRight, PaintObjectsManager <Rectangle3D> rects) { Rectangle3D rectangle3D = rects.GetPaintObject(); rectangle3D.SetPos(bounds, topLeft, bottomRight); return(rectangle3D); }
public static PaintObjects.Label DrawText(double x, double y, string text, Brush foreground, double fontSize, FontFamily fontFamily, PaintObjectsManager <PaintObjects.Label> labels) { PaintObjects.Label label = labels.GetPaintObject(); label._textBlock.Text = text; label._textBlock.Foreground = foreground; label._textBlock.FontSize = fontSize; label._textBlock.FontFamily = fontFamily; label.Left = x; label.Top = y; return(label); }
internal static void DrawLine(double x1, double y1, double x2, double y2, Brush strokeBrush, LinePattern strokePattern, double strokeThickness, PaintObjectsManager <Line> lines) { Line linePo = lines.GetPaintObject(); System.Windows.Shapes.Line line = linePo._line; line.X1 = x1; line.X2 = x2; line.Y1 = y1; line.Y2 = y2; if (!BrushesEqual(line.Stroke, strokeBrush)) { line.Stroke = strokeBrush; } line.StrokeThickness = strokeThickness; Types.SetShapePattern(line, strokePattern); }
public static Rectangle DrawRectangle(double x1, double y1, double x2, double y2, Brush fillBrush, PaintObjectsManager <Rectangle> rects) { Rectangle rectangle = rects.GetPaintObject(); System.Windows.Shapes.Rectangle r = rectangle._rectangle; Canvas.SetLeft(r, x1); Canvas.SetTop(r, y1); r.Width = Math.Abs(x2 - x1); r.Height = Math.Abs(y2 - y1); if (r.Fill == null || !r.Fill.Equals(fillBrush)) { r.Fill = fillBrush; } if (r.Stroke == null || !r.Stroke.Equals(Brushes.Transparent)) { r.Stroke = Brushes.Transparent; } return(rectangle); }
public static Rectangle3D Draw3DRectangle(double X1, double Y1, double X2, double Y2, Brush topLeft, Brush bottomRight, PaintObjectsManager <Rectangle3D> rects) { return(Draw3DRectangle(new Types.RectEx(X1, Y1, X2, Y2), topLeft, bottomRight, rects)); }
public static Rectangle DrawRectangle(Types.RectEx rectEx, Brush fillBrush, PaintObjectsManager <Rectangle> rects) { return(DrawRectangle(rectEx.Left, rectEx.Top, rectEx.Right, rectEx.Bottom, fillBrush, rects)); }