internal static object Box(FillRule value) { if (value == FillRule.Nonzero) { return NonzeroBox; } else { return EvenOddBox; } }
public static Telerik.Windows.Documents.Fixed.Model.Graphics.FillRule ConvertFillRule(FillRule fillRule) { switch (fillRule) { case FillRule.EvenOdd: return Telerik.Windows.Documents.Fixed.Model.Graphics.FillRule.EvenOdd; case FillRule.Nonzero: return Telerik.Windows.Documents.Fixed.Model.Graphics.FillRule.Nonzero; default: throw new NotSupportedException(String.Format("Not supported fill rule: {0}", fillRule)); } }
internal PathStreamGeometryContext(FillRule fillRule, Transform transform) { _pathGeometry = new PathGeometry(); if (fillRule != s_defaultFillRule) { _pathGeometry.FillRule = fillRule; } if ((transform != null) && !transform.IsIdentity) { _pathGeometry.Transform = transform.Clone(); } }
public void ClipRule(FillRule value) { _NativeInstance.ClipRule(value); }
internal unsafe static extern int MilGlyphRun_GetGlyphOutline( IntPtr pFontFace, ushort glyphIndex, bool sideways, double renderingEmSize, out byte* pPathGeometryData, out UInt32 pSize, out FillRule pFillRule );
internal unsafe static extern int MilUtility_PathGeometryWiden( MIL_PEN_DATA *pPenData, double *pDashArray, MilMatrix3x2D* pMatrix, FillRule fillRule, byte* pPathData, UInt32 nSize, double rTolerance, bool fRelative, Delegate addFigureCallback, out FillRule widenedFillRule);
internal unsafe static extern int MilUtility_PathGeometryBounds( MIL_PEN_DATA *pPenData, double *pDashArray, MilMatrix3x2D* pWorldMatrix, FillRule fillRule, byte* pPathData, UInt32 nSize, MilMatrix3x2D* pGeometryMatrix, double rTolerance, bool fRelative, bool fSkipHollows, MilRectD* pBounds);
/// <summary> /// Returns a path geometry /// </summary> /// <param name="fillRule">FillRule</param> /// <param name="startPoint">Start point</param> /// <param name="pathGeometryParams">List of path geometry parameters</param> /// <returns>PathGeometry</returns> private static PathGeometry GetPathGeometryFromList(FillRule fillRule, Point startPoint, List<PathGeometryParams> pathGeometryParams, Boolean isClosed) { PathGeometry pathGeometry = new PathGeometry(); pathGeometry.FillRule = fillRule; pathGeometry.Figures = new PathFigureCollection(); PathFigure pathFigure = new PathFigure(); pathFigure.StartPoint = startPoint; pathFigure.Segments = new PathSegmentCollection(); pathFigure.IsClosed = isClosed; foreach (PathGeometryParams param in pathGeometryParams) { switch (param.GetType().Name) { case "LineSegmentParams": LineSegment lineSegment = new LineSegment(); lineSegment.Point = param.EndPoint; pathFigure.Segments.Add(lineSegment); break; case "ArcSegmentParams": ArcSegment arcSegment = new ArcSegment(); arcSegment.Point = param.EndPoint; arcSegment.IsLargeArc = (param as ArcSegmentParams).IsLargeArc; arcSegment.RotationAngle = (param as ArcSegmentParams).RotationAngle; arcSegment.SweepDirection = (param as ArcSegmentParams).SweepDirection; arcSegment.Size = (param as ArcSegmentParams).Size; pathFigure.Segments.Add(arcSegment); break; } } pathGeometry.Figures.Add(pathFigure); return pathGeometry; }
///<summary> /// Creates a new DrawableFillRule instance. ///</summary> ///<param name="fillRule">The rule to use when filling drawn objects.</param> public DrawableFillRule(FillRule fillRule) { FillRule = fillRule; }
internal unsafe static extern int MilUtility_GetPointAtLengthFraction( MilMatrix3x2D *pMatrix, FillRule fillRule, byte *pPathData, UInt32 nSize, double rFraction, out Point pt, out Point vecTangent);
public void SetFillRule(FillRule fillRule) { _target.FillRule = fillRule; }
/// <summary> /// Constructor /// </summary> /// <param name="figures">A collection of figures</param> /// <param name="fillRule">The fill rule (OddEven or NonZero)</param> /// <param name="transform">A transformation to apply to the input</param> public PathGeometry(IEnumerable<PathFigure> figures, FillRule fillRule, Transform transform) { Transform = transform; if (ValidateEnums.IsFillRuleValid(fillRule)) { FillRule = fillRule; if (figures != null) { foreach (PathFigure item in figures) { Figures.Add(item); } } else { throw new ArgumentNullException("figures"); } SetDirty(); } }
public void SetFillRule(FillRule fillRule) { _path.FillType = fillRule == FillRule.EvenOdd ? SKPathFillType.EvenOdd : SKPathFillType.Winding; }
public void FillRule(FillRule value) { IntPtr exception = IntPtr.Zero; #if ANYCPU if (NativeLibrary.Is64Bit) #endif #if WIN64 || ANYCPU NativeMethods.X64.DrawingWand_FillRule(Instance, (UIntPtr)value, out exception); #endif #if ANYCPU else #endif #if !WIN64 || ANYCPU NativeMethods.X86.DrawingWand_FillRule(Instance, (UIntPtr)value, out exception); #endif CheckException(exception); }
/// <summary> /// <para>Construct a new <see cref="T:Xsharp.Region"/> /// instance that is initially set to a polygon.</para> /// </summary> /// /// <param name="points"> /// <para>An array of points that defines the polygon.</para> /// </param> /// /// <param name="fillRule"> /// <para>The area fill rule to use for the polygon.</para> /// </param> /// /// <exception cref="T:System.ArgumentNullException"> /// <para>Raised if <paramref name="points"/> is <see langword="null"/>. /// </para> /// </exception> /// /// <exception cref="T:System.ArgumentOutOfRangeException"> /// <para>Raised if <paramref name="points"/> has less than 3 /// elements.</para> /// </exception> /// /// <exception cref="T:Xsharp.XException"> /// <para>Raised if any of the elements in <paramref name="points"/> /// has co-ordinates that are out of range, or if /// <paramref name="fillRule"/> is invalid.</para> /// </exception> public Region(Point[] points, FillRule fillRule) { // Validate the parameters. if(points == null) { throw new ArgumentNullException("points"); } else if(points.Length < 3) { throw new ArgumentOutOfRangeException ("points", S._("X_PolygonNeeds3Pts")); } // Convert "points" into an "XPoint[]" array. XPoint[] pts = new XPoint [points.Length]; try { checked { for(int index = 0; index < points.Length; ++index) { pts[index].x = (short)(points[index].x); pts[index].y = (short)(points[index].y); } } } catch(OverflowException) { throw new XException(S._("X_PointCoordRange")); } // Validate the fill rule. if(fillRule != FillRule.EvenOddRule && fillRule != FillRule.WindingRule) { throw new XException (String.Format(S._("X_FillRule"), (int)fillRule)); } // Create the polygon region. lock(typeof(Region)) { region = Xlib.XPolygonRegion(pts, pts.Length, (int)fillRule); if(region == IntPtr.Zero) { Display.OutOfMemory(); } } }
public void SetFillRule(FillRule fillRule) { }
internal unsafe static extern int MilUtility_PathGeometryHitTest( MilMatrix3x2D *pMatrix, MIL_PEN_DATA* pPenData, double* pDashArray, FillRule fillRule, byte *pPathData, UInt32 nSize, double rTolerance, bool fRelative, Point* pHitPoint, out bool pDoesContain);
internal unsafe static extern int MilUtility_PathGeometryHitTestPathGeometry( MilMatrix3x2D *pMatrix1, FillRule fillRule1, byte *pPathData1, UInt32 nSize1, MilMatrix3x2D *pMatrix2, FillRule fillRule2, byte *pPathData2, UInt32 nSize2, double rTolerance, bool fRelative, IntersectionDetail* pDetail);
// // Given a mini-language representation of a Geometry - write it to the // supplied streamgeometrycontext // private static void ParseStringToStreamGeometryContext ( StreamGeometryContext context, string pathString, IFormatProvider formatProvider, #if PRESENTATION_CORE ref FillRule fillRule #else ref bool fillRule
internal unsafe static extern int MilUtility_GeometryGetArea( FillRule fillRule, byte *pPathData, UInt32 nSize, MilMatrix3x2D *pMatrix, double rTolerance, bool fRelative, double* pArea);
/// <summary> /// Sets path's winding rule (default is EvenOdd). You should call this method before any calls to BeginFigure. If you wonder why, ask Direct2D guys about their design decisions. /// </summary> /// <param name="fillRule"></param> public void SetFillRule(FillRule fillRule) { _impl.SetFillRule(fillRule); }
public PathGeometry (IEnumerable<PathFigure> figures, FillRule fillRule, Transform transform) { Figures = new PathFigureCollection (figures); FillRule = fillRule; Transform = transform; }
public DrawableFillRule(FillRule fillRule) : base(AssemblyHelper.CreateInstance(Types.DrawableFillRule, new Type[] {Types.FillRule}, fillRule)) { }
public void SetFillRule(FillRule fillRule) { _geometryImpl.FillRule = fillRule; }
internal unsafe static extern int MilUtility_PathGeometryCombine( MilMatrix3x2D* pMatrix, MilMatrix3x2D* pMatrix1, FillRule fillRule1, byte* pPathData1, UInt32 nSize1, MilMatrix3x2D* pMatrix2, FillRule fillRule2, byte* pPathData2, UInt32 nSize2, double rTolerance, bool fRelative, Delegate addFigureCallback, GeometryCombineMode combineMode, out FillRule resultFillRule);
private static bool FillRuleToBool(FillRule fill) { if (fill == FillRule.EvenOdd) return false; else return true; }
internal unsafe static extern int MilUtility_PathGeometryFlatten( MilMatrix3x2D* pMatrix, FillRule fillRule, byte* pPathData, UInt32 nSize, double rTolerance, bool fRelative, Delegate addFigureCallback, out FillRule resultFillRule);
internal void SetFillRule(FillRule fillRule)
public void SetFillRule(FillRule fillRule) { _sink.SetFillMode(fillRule == FillRule.EvenOdd ? FillMode.Alternate : FillMode.Winding); }
public void FillRule(FillRule value) { _NativeInstance.FillRule(value); }