Пример #1
0
 public void FillEllipses(DUIBrush brush, RectangleF[] rects)
 {
     foreach (RectangleF rect in rects)
     {
         FillEllipse(brush, rect);
     }
 }
Пример #2
0
 public void FillRectangles(DUIBrush brush, Rectangle[] rects)
 {
     foreach (Rectangle rect in rects)
     {
         FillRectangle(brush, rect);
     }
 }
Пример #3
0
        public void FillPolygon(DUIBrush brush, PointF[] points)
        {
            bool closed = true;

            if (points == null)
            {
                return;
            }
            if (points.Length < 3)
            {
                return;
            }
            brush.RenderTarget = this.target;
            using (SharpDX.Direct2D1.PathGeometry pathGeometry = new SharpDX.Direct2D1.PathGeometry(this.target.RenderTarget.Factory))
                using (SharpDX.Direct2D1.GeometrySink geometrySink = pathGeometry.Open())
                {
                    geometrySink.SetFillMode(SharpDX.Direct2D1.FillMode.Alternate);
                    geometrySink.BeginFigure(DxConvert.ToVector2(points[0]), SharpDX.Direct2D1.FigureBegin.Filled);
                    for (int i = 1; i < points.Length; i++)
                    {
                        geometrySink.AddLine(DxConvert.ToVector2(points[i]));
                    }
                    geometrySink.EndFigure(closed ? SharpDX.Direct2D1.FigureEnd.Closed : SharpDX.Direct2D1.FigureEnd.Open);
                    geometrySink.Close();
                    this.target.RenderTarget.FillGeometry(pathGeometry, brush);
                }
        }
Пример #4
0
 public void FillRoundedRectangle(DUIBrush brush, float x, float y, float width, float height, float radius)
 {
     if (width == 0 || height == 0)
     {
         return;
     }
     this.iDUIGraphics.FillRoundedRectangle(brush, x, y, width, height, radius);
 }
Пример #5
0
 public void FillEllipse(DUIBrush brush, float x, float y, float width, float height)
 {
     if (width == 0 || height == 0)
     {
         return;
     }
     this.iDUIGraphics.FillEllipse(brush, x, y, width, height);
 }
Пример #6
0
 public void DrawString(string s, DUIFont font, DUIBrush brush, RectangleF layoutRectangle, StringFormat format)
 {
     if (string.IsNullOrWhiteSpace(s))
     {
         return;
     }
     this.iDUIGraphics.DrawString(s, font, brush, layoutRectangle, format);
 }
Пример #7
0
 public void FillRoundedRectangle(DUIBrush brush, float x, float y, float width, float height, float radius)
 {
     if (width <= 0 || height <= 0)
     {
         return;
     }
     this.graphics.FillPath(brush, Tools.GetRoundRectangleF(new RectangleF(x, y, width, height), radius));
 }
Пример #8
0
 public void FillPolygon(DUIBrush brush, PointF[] points)
 {
     if (points == null)
     {
         return;
     }
     if (points.Length < 3)
     {
         return;
     }
     this.iDUIGraphics.FillPolygon(brush, points);
 }
Пример #9
0
 public void DrawString(string s, DUIFont font, DUIBrush brush, RectangleF layoutRectangle, StringFormat format)
 {
     brush.RenderTarget = this.target;
     try
     {
         this.target.RenderTarget.DrawText(s, font, DxConvert.ToRectF(new RectangleF(layoutRectangle.X, layoutRectangle.Y, float.MaxValue, 0)), brush);
     }
     catch (Exception ex)
     {
         Log.DUILog.GettingLog(ex);
         //这里报错率很高,但不知道为什么
     }
 }
Пример #10
0
 public void DrawString(string s, DUIFont font, DUIBrush brush, PointF p)
 {
     DrawString(s, font, brush, p.X, p.Y);
 }
Пример #11
0
 public void FillRoundedRectangle(DUIBrush brush, float x, float y, float width, float height, float radius)
 {
     brush.RenderTarget = this.target;
     this.target.RenderTarget.FillRoundedRectangle(DxConvert.ToRoundRectF(x, y, width, height, radius), brush);
 }
Пример #12
0
 public void FillEllipse(DUIBrush brush, float x, float y, float width, float height)
 {
     brush.RenderTarget = this.target;
     this.target.RenderTarget.FillEllipse(DxConvert.ToEllipse(new RectangleF(x, y, width, height)), brush);
 }
Пример #13
0
 public void FillRegion(DUIBrush brush, DUIRegion region)
 {
     this.graphics.FillRegion(brush, region);
 }
Пример #14
0
 public void DrawString(string s, DUIFont font, DUIBrush brush, RectangleF layoutRectangle, StringFormat format)
 {
     this.graphics.DrawString(s, font, brush, layoutRectangle, format);
 }
Пример #15
0
 public void FillEllipse(DUIBrush brush, float x, float y, float width, float height)
 {
     this.graphics.FillEllipse(brush, x, y, width, height);
 }
Пример #16
0
 public void FillPolygon(DUIBrush brush, PointF[] points)
 {
     this.graphics.FillPolygon(brush, points);
 }
Пример #17
0
 public void FillRoundedRectangle(DUIBrush brush, RectangleF rect, float radius)
 {
     this.FillRoundedRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height, radius);
 }
Пример #18
0
 public void FillEllipse(DUIBrush brush, int x, int y, int width, int height)
 {
     this.FillEllipse(brush, (float)x, (float)y, (float)width, (float)height);
 }
Пример #19
0
 public void FillEllipse(DUIBrush brush, RectangleF rect)
 {
     this.FillEllipse(brush, rect.X, rect.Y, rect.Width, rect.Height);
 }
Пример #20
0
 public void FillRegion(DUIBrush brush, DUIRegion region)
 {
     brush.RenderTarget  = this.target;
     region.RenderTarget = this.target;
     this.target.RenderTarget.FillGeometry(region, brush);
 }
Пример #21
0
 public void FillPolygon(DUIBrush brush, Point[] points)
 {
     this.FillPolygon(brush, points.Select(p => (PointF)p).ToArray());
 }
Пример #22
0
 public void DrawString(string s, DUIFont font, DUIBrush brush, float x, float y)
 {
     DrawString(s, font, brush, new RectangleF(new PointF(x, y), MeasureString(s, font)), StringFormat.GenericDefault);
 }
Пример #23
0
 public void FillRoundedRectangle(DUIBrush brush, int x, int y, int width, int height, float radius)
 {
     this.FillRoundedRectangle(brush, (float)x, (float)y, (float)width, (float)height, radius);
 }