• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# XFillMode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中XFillMode的典型用法代码示例。如果您正苦于以下问题:C# XFillMode类的具体用法?C# XFillMode怎么用?C# XFillMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



XFillMode类属于命名空间,在下文中一共展示了XFillMode类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: XGraphicsPath

    /// <summary>
    /// Initializes a new instance of the <see cref="XGraphicsPath"/> class.
    /// </summary>
    public XGraphicsPath(PointF[] points, byte[] types, XFillMode fillMode)
    {
#if GDI
      this.gdipPath = new GraphicsPath(points, types, (FillMode)fillMode);
#endif
#if WPF
      this.pathGeometry = new PathGeometry();
      this.pathGeometry.FillRule = FillRule.EvenOdd;
#endif
    }
开发者ID:AnthonyNystrom,项目名称:Pikling,代码行数:13,代码来源:XGraphicsPath.cs


示例2: XGraphicsPath

        /// <summary>
        /// Initializes a new instance of the <see cref="XGraphicsPath"/> class.
        /// </summary>
        public XGraphicsPath(PointF[] points, byte[] types, XFillMode fillMode)
        {
#if GDI
            try
            {
                Lock.EnterGdiPlus();
                _gdipPath = new GraphicsPath(points, types, (FillMode)fillMode);
            }
            finally { Lock.ExitGdiPlus(); }
#endif
#if WPF  // Is true only in Hybrid build.
            _pathGeometry = new PathGeometry();
            _pathGeometry.FillRule = FillRule.EvenOdd;
#endif
        }
开发者ID:Core2D,项目名称:PDFsharp,代码行数:18,代码来源:XGraphicsPath.cs


示例3: CreatePolygonGeometry

 /// <summary>
 /// Creates a path geometry form a polygon.
 /// </summary>
 public static PathGeometry CreatePolygonGeometry(System.Windows.Point[] points, XFillMode fillMode, bool closed)
 {
   PolyLineSegment seg = new PolyLineSegment();
   int count = points.Length;
   // For correct drawing the start point of the segment must not be the same as the first point
   for (int idx = 1; idx < count; idx++)
     seg.Points.Add(new System.Windows.Point(points[idx].X, points[idx].Y));
   seg.IsStroked = true;
   PathFigure fig = new PathFigure();
   fig.StartPoint = new System.Windows.Point(points[0].X, points[0].Y);
   fig.Segments.Add(seg);
   fig.IsClosed = closed;
   PathGeometry geo = new PathGeometry();
   geo.FillRule = fillMode == XFillMode.Winding ? FillRule.Nonzero : FillRule.EvenOdd;
   geo.Figures.Add(fig);
   return geo;
 }
开发者ID:AnthonyNystrom,项目名称:Pikling,代码行数:20,代码来源:GeometryHelper.cs


示例4: DrawPolygon

    /// <summary>
    /// Draws a polygon defined by an array of points.
    /// </summary>
    public void DrawPolygon(XBrush brush, XPoint[] points, XFillMode fillmode)
    {
      if (brush == null)
        throw new ArgumentNullException("brush");
      if (points == null)
        throw new ArgumentNullException("points");
      if (points.Length < 2)
        throw new ArgumentException("points", PSSR.PointArrayAtLeast(2));

      if (this.drawGraphics)
      {
#if GDI
        if (this.targetContext == XGraphicTargetContext.GDI)
          this.gfx.FillPolygon(brush.RealizeGdiBrush(), MakePointFArray(points), (FillMode)fillmode);
#endif
#if WPF
        if (this.targetContext == XGraphicTargetContext.WPF)
        {
          this.dc.DrawGeometry(brush.RealizeWpfBrush(), null, GeometryHelper.CreatePolygonGeometry(MakePointArray(points), fillmode, true));
        }
#endif
      }

      if (this.renderer != null)
        this.renderer.DrawPolygon(null, brush, points, fillmode);
    }
开发者ID:Davincier,项目名称:openpetra,代码行数:29,代码来源:XGraphics.cs


示例5: DrawClosedCurve

 /// <summary>
 /// Draws a closed cardinal spline defined by an array of points.
 /// </summary>
 public void DrawClosedCurve(XPen pen, XBrush brush, PointF[] points, XFillMode fillmode, double tension)
 {
   DrawClosedCurve(pen, brush, MakeXPointArray(points), fillmode, tension);
 }
开发者ID:Davincier,项目名称:openpetra,代码行数:7,代码来源:XGraphics.cs


示例6: XGraphicsPath

 /// <summary>
 /// Initializes a new instance of the <see cref="XGraphicsPath"/> class.
 /// </summary>
 public XGraphicsPath(PointF[] points, byte[] types, XFillMode fillMode)
 {
   this.gdipPath = new GraphicsPath(points, types, (FillMode)fillMode);
 }
开发者ID:BackupTheBerlios,项目名称:zp7-svn,代码行数:7,代码来源:XGraphicsPath.cs


示例7: DrawClosedCurve

    /// <summary>
    /// Draws a closed cardinal spline defined by an array of points.
    /// </summary>
    public void DrawClosedCurve(XPen pen, XBrush brush, XPoint[] points, XFillMode fillmode, double tension)
    {
      if (pen == null && brush == null)
        throw new ArgumentNullException("pen and brush", PSSR.NeedPenOrBrush);

      if (this.drawGraphics)
      {
        this.gfx.FillClosedCurve(brush.RealizeGdiBrush(), MakePointFArray(points), (FillMode)fillmode, (float)tension);
        // The fillmode is not used by DrawClosedCurve
        this.gfx.DrawClosedCurve(pen.RealizeGdiPen(), MakePointFArray(points), (float)tension, (FillMode)fillmode);
      }

      if (this.renderer != null)
        this.renderer.DrawClosedCurve(pen, brush, points, tension, fillmode);
    }
开发者ID:BackupTheBerlios,项目名称:zp7-svn,代码行数:18,代码来源:XGraphics.cs


示例8: DrawPolygon

    /// <summary>
    /// Draws a polygon defined by an array of points.
    /// </summary>
    public void DrawPolygon(XPen pen, XBrush brush, XPoint[] points, XFillMode fillmode)
    {
      if (pen == null && brush == null)
        throw new ArgumentNullException("pen and brush", PSSR.NeedPenOrBrush);
      if (points == null)
        throw new ArgumentNullException("points");
      if (points.Length < 2)
        throw new ArgumentException("points", PSSR.PointArrayAtLeast(2));

      if (this.drawGraphics)
      {
        PointF[] pts = MakePointFArray(points);
        this.gfx.FillPolygon(brush.RealizeGdiBrush(), pts, (FillMode)fillmode);
        this.gfx.DrawPolygon(pen.RealizeGdiPen(), pts);
      }
      if (this.renderer != null)
        this.renderer.DrawPolygon(pen, brush, points, fillmode);
    }
开发者ID:BackupTheBerlios,项目名称:zp7-svn,代码行数:21,代码来源:XGraphics.cs


示例9: DrawPolygon

        // ----- DrawPolygon --------------------------------------------------------------------------

        public void DrawPolygon(XPen pen, XBrush brush, XPoint[] points, XFillMode fillmode)
        {
            Realize(pen, brush);

            int count = points.Length;
            if (points.Length < 2)
                throw new ArgumentException("points", PSSR.PointArrayAtLeast(2));

            const string format = Config.SignificantFigures4;
            AppendFormatPoint("{0:" + format + "} {1:" + format + "} m\n", points[0].X, points[0].Y);
            for (int idx = 1; idx < count; idx++)
                AppendFormatPoint("{0:" + format + "} {1:" + format + "} l\n", points[idx].X, points[idx].Y);

            AppendStrokeFill(pen, brush, fillmode, true);
        }
开发者ID:Core2D,项目名称:PDFsharp,代码行数:17,代码来源:XGraphicsPdfRenderer.cs


示例10: AppendStrokeFill

    void AppendStrokeFill(XPen pen, XBrush brush, XFillMode fillMode, bool closePath)
    {
      if (closePath)
        this.content.Append("h ");

      if (fillMode == XFillMode.Winding)
      {
        if (pen != null && brush != null)
          this.content.Append("B\n");
        else if (pen != null)
          this.content.Append("S\n");
        else
          this.content.Append("f\n");
      }
      else
      {
        if (pen != null && brush != null)
          this.content.Append("B*\n");
        else if (pen != null)
          this.content.Append("S\n");
        else
          this.content.Append("f*\n");
      }
    }
开发者ID:zheimer,项目名称:PDFSharp,代码行数:24,代码来源:XGraphicsPdfRenderer.cs


示例11: DrawPolygon

    // ----- DrawPolygon --------------------------------------------------------------------------

    public void DrawPolygon(XPen pen, XBrush brush, XPoint[] points, XFillMode fillmode)
    {
      Realize(pen, brush);

      int count = points.Length;
      if (points.Length < 2)
        throw new ArgumentException("points", PSSR.PointArrayAtLeast(2));

      AppendFormat("{0:0.####} {1:0.####} m\n", points[0].X, points[0].Y);
      for (int idx = 1; idx < count; idx++)
        AppendFormat("{0:0.####} {1:0.####} l\n", points[idx].X, points[idx].Y);

      AppendStrokeFill(pen, brush, fillmode, true);
    }
开发者ID:zheimer,项目名称:PDFSharp,代码行数:16,代码来源:XGraphicsPdfRenderer.cs


示例12: DrawClosedCurve

    // ----- DrawClosedCurve ----------------------------------------------------------------------

    public void DrawClosedCurve(XPen pen, XBrush brush, XPoint[] points, double tension, XFillMode fillmode)
    {
      int count = points.Length;
      if (count == 0)
        return;
      if (count < 2)
        throw new ArgumentException("Not enough points", "points");

      // Simply tried out. Not proofed why it is correct.
      tension /= 3;

      Realize(pen, brush);

      AppendFormat("{0:0.####} {1:0.####} m\n", points[0].X, points[0].Y);
      if (count == 2)
      {
        // Just draws a line...
        AppendCurveSegment(points[0], points[0], points[1], points[1], tension);
      }
      else
      {
        AppendCurveSegment(points[count - 1], points[0], points[1], points[2], tension);
        for (int idx = 1; idx < count - 2; idx++)
          AppendCurveSegment(points[idx - 1], points[idx], points[idx + 1], points[idx + 2], tension);
        AppendCurveSegment(points[count - 3], points[count - 2], points[count - 1], points[0], tension);
        AppendCurveSegment(points[count - 2], points[count - 1], points[0], points[1], tension);
      }
      AppendStrokeFill(pen, brush, fillmode, true);
    }
开发者ID:zheimer,项目名称:PDFSharp,代码行数:31,代码来源:XGraphicsPdfRenderer.cs


示例13: CreatePolyLineSegment

        /// <summary>
        /// Creates a path geometry from a polygon.
        /// </summary>
        public static PolyLineSegment CreatePolyLineSegment(SysPoint[] points, XFillMode fillMode, bool closed)
        {
            PolyLineSegment seg = new PolyLineSegment();
            int count = points.Length;
            // For correct drawing the start point of the segment must not be the same as the first point.
            for (int idx = 1; idx < count; idx++)
                seg.Points.Add(new SysPoint(points[idx].X, points[idx].Y));
#if !SILVERLIGHT && !NETFX_CORE
            seg.IsStroked = true;
#endif
            return seg;
        }
开发者ID:Core2D,项目名称:PDFsharp,代码行数:15,代码来源:GeometryHelper.cs



注:本文中的XFillMode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# XG_Control类代码示例发布时间:2022-05-24
下一篇:
C# XElement类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap