Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
 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));
 }
Beispiel #6
0
 public static Rectangle DrawRectangle(Types.RectEx rectEx, Brush fillBrush,
                                       PaintObjectsManager <Rectangle> rects)
 {
     return(DrawRectangle(rectEx.Left, rectEx.Top, rectEx.Right, rectEx.Bottom, fillBrush, rects));
 }