Esempio n. 1
0
        public override void DrawPolygon(RBrush brush, RPoint[] points)
        {
            if (points != null && points.Length > 0)
            {
                var g = new StreamGeometry();
                using (var context = g.Open())
                {
                    context.BeginFigure(Util.Convert(points[0]), true);
                    for (int i = 1; i < points.Length; i++)
                        context.LineTo(Util.Convert(points[i]));
                    context.EndFigure(false);
                }

                _g.DrawGeometry(((BrushAdapter)brush).Brush, null, g);
            }
        }
Esempio n. 2
0
 public override void DrawRectangle(RBrush brush, double x, double y, double width, double height)
 {
     _g.FillRectangle(((BrushAdapter) brush).Brush, new Rect(x, y, width, height));
 }
Esempio n. 3
0
 public override void DrawPath(RBrush brush, RGraphicsPath path)
 {
     _g.DrawGeometry(((BrushAdapter)brush).Brush, null, ((GraphicsPathAdapter)path).GetClosedGeometry());
 }
Esempio n. 4
0
 /// <summary>
 /// Fills the interior of a GraphicsPath.
 /// </summary>
 /// <param name="brush">Brush that determines the characteristics of the fill. </param>
 /// <param name="path">GraphicsPath that represents the path to fill. </param>
 public abstract void DrawPath(RBrush brush, RGraphicsPath path);
Esempio n. 5
0
 /// <summary>
 /// Fills the interior of a polygon defined by an array of points specified by Point structures.
 /// </summary>
 /// <param name="brush">Brush that determines the characteristics of the fill. </param>
 /// <param name="points">Array of Point structures that represent the vertices of the polygon to fill. </param>
 public abstract void DrawPolygon(RBrush brush, RPoint[] points);
Esempio n. 6
0
 /// <summary>
 /// Fills the interior of a polygon defined by an array of points specified by Point structures.
 /// </summary>
 /// <param name="brush">Brush that determines the characteristics of the fill. </param>
 /// <param name="points">Array of Point structures that represent the vertices of the polygon to fill. </param>
 public abstract void DrawPolygon(RBrush brush, RPoint[] points);
Esempio n. 7
0
 /// <summary>
 /// Fills the interior of a rectangle specified by a pair of coordinates, a width, and a height.
 /// </summary>
 /// <param name="brush">Brush that determines the characteristics of the fill. </param>
 /// <param name="x">The x-coordinate of the upper-left corner of the rectangle to fill. </param>
 /// <param name="y">The y-coordinate of the upper-left corner of the rectangle to fill. </param>
 /// <param name="width">Width of the rectangle to fill. </param>
 /// <param name="height">Height of the rectangle to fill. </param>
 public abstract void DrawRectangle(RBrush brush, double x, double y, double width, double height);
Esempio n. 8
0
 /// <summary>
 /// Fills the interior of a rectangle specified by a pair of coordinates, a width, and a height.
 /// </summary>
 /// <param name="brush">Brush that determines the characteristics of the fill. </param>
 /// <param name="x">The x-coordinate of the upper-left corner of the rectangle to fill. </param>
 /// <param name="y">The y-coordinate of the upper-left corner of the rectangle to fill. </param>
 /// <param name="width">Width of the rectangle to fill. </param>
 /// <param name="height">Height of the rectangle to fill. </param>
 public abstract void DrawRectangle(RBrush brush, double x, double y, double width, double height);
Esempio n. 9
0
 /// <summary>
 /// Fills the interior of a GraphicsPath.
 /// </summary>
 /// <param name="brush">Brush that determines the characteristics of the fill. </param>
 /// <param name="path">GraphicsPath that represents the path to fill. </param>
 public abstract void DrawPath(RBrush brush, RGraphicsPath path);
 public override void DrawPolygon(RBrush brush, RPoint[] points)
 {
     if (points != null && points.Length > 0)
     {
         _g.DrawPolygon((XBrush)((BrushAdapter)brush).Brush, Utils.Convert(points), XFillMode.Winding);
     }
 }
        public override void DrawRectangle(RBrush brush, double x, double y, double width, double height)
        {
            var xBrush = ((BrushAdapter)brush).Brush;
            var xTextureBrush = xBrush as XTextureBrush;
            if (xTextureBrush != null)
            {
                xTextureBrush.DrawRectangle(_g, x, y, width, height);
            }
            else
            {
                _g.DrawRectangle((XBrush)xBrush, x, y, width, height);

                // handle bug in PdfSharp that keeps the brush color for next string draw
                if (xBrush is XLinearGradientBrush)
                    _g.DrawRectangle(XBrushes.White, 0, 0, 0.1, 0.1);
            }
        }
 public override void DrawPath(RBrush brush, RGraphicsPath path)
 {
     _g.DrawPath((XBrush)((BrushAdapter)brush).Brush, ((GraphicsPathAdapter)path).GraphicsPath);
 }
Esempio n. 13
0
 /// <summary>
 /// Draw simple border.
 /// </summary>
 /// <param name="border">Desired border</param>
 /// <param name="g">the device to draw to</param>
 /// <param name="box">Box which the border corresponds</param>
 /// <param name="brush">the brush to use</param>
 /// <param name="rectangle">the bounding rectangle to draw in</param>
 /// <returns>Beveled border path, null if there is no rounded corners</returns>
 public static void DrawBorder(Border border, RGraphics g, CssBox box, RBrush brush, RRect rectangle)
 {
     SetInOutsetRectanglePoints(border, box, rectangle, true, true);
     g.DrawPolygon(brush, _borderPts);
 }
 public override void DrawPolygon(RBrush brush, RPoint[] points)
 {
     if (points != null && points.Length > 0)
     {
         ReleaseHdc();
         _g.FillPolygon(((BrushAdapter)brush).Brush, Utils.Convert(points));
     }
 }
 public override void DrawPath(RBrush brush, RGraphicsPath path)
 {
     ReleaseHdc();
     _g.FillPath(((BrushAdapter)brush).Brush, ((GraphicsPathAdapter)path).GraphicsPath);
 }
 public override void DrawRectangle(RBrush brush, double x, double y, double width, double height)
 {
     ReleaseHdc();
     _g.FillRectangle(((BrushAdapter)brush).Brush, (float)x, (float)y, (float)width, (float)height);
 }