2 // System.Drawing.Drawing2D.GraphicsPath.cs
6 // Miguel de Icaza (miguel@ximian.com)
7 // Duncan Mak (duncan@ximian.com)
8 // Jordi Mas i Hernandez (jordi@ximian.com)
9 // Ravindra (rkumar@novell.com)
10 // Sebastien Pouliot <sebastien@ximian.com>
12 // Copyright (C) 2004,2006 Novell, Inc (http://www.novell.com)
14 // Permission is hereby granted, free of charge, to any person obtaining
15 // a copy of this software and associated documentation files (the
16 // "Software"), to deal in the Software without restriction, including
17 // without limitation the rights to use, copy, modify, merge, publish,
18 // distribute, sublicense, and/or sell copies of the Software, and to
19 // permit persons to whom the Software is furnished to do so, subject to
20 // the following conditions:
22 // The above copyright notice and this permission notice shall be
23 // included in all copies or substantial portions of the Software.
25 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
29 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
30 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
31 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34 using System.ComponentModel;
35 using System.Runtime.InteropServices;
37 namespace System.Drawing.Drawing2D
39 public sealed class GraphicsPath : MarshalByRefObject, ICloneable, IDisposable
41 // 1/4 is the FlatnessDefault as defined in GdiPlusEnums.h
42 private const float FlatnessDefault = 1.0f / 4.0f;
44 internal IntPtr nativePath = IntPtr.Zero;
46 GraphicsPath (IntPtr ptr)
51 public GraphicsPath ()
53 Status status = GDIPlus.GdipCreatePath (FillMode.Alternate, out nativePath);
54 GDIPlus.CheckStatus (status);
57 public GraphicsPath (FillMode fillMode)
59 Status status = GDIPlus.GdipCreatePath (fillMode, out nativePath);
60 GDIPlus.CheckStatus (status);
63 public GraphicsPath (Point[] pts, byte[] types)
64 : this (pts, types, FillMode.Alternate)
68 public GraphicsPath (PointF[] pts, byte[] types)
69 : this (pts, types, FillMode.Alternate)
73 public GraphicsPath (Point[] pts, byte[] types, FillMode fillMode)
76 throw new ArgumentNullException ("pts");
77 if (pts.Length != types.Length)
78 throw new ArgumentException ("Invalid parameter passed. Number of points and types must be same.");
80 Status status = GDIPlus.GdipCreatePath2I (pts, types, pts.Length, fillMode, out nativePath);
81 GDIPlus.CheckStatus (status);
84 public GraphicsPath (PointF[] pts, byte[] types, FillMode fillMode)
87 throw new ArgumentNullException ("pts");
88 if (pts.Length != types.Length)
89 throw new ArgumentException ("Invalid parameter passed. Number of points and types must be same.");
91 Status status = GDIPlus.GdipCreatePath2 (pts, types, pts.Length, fillMode, out nativePath);
92 GDIPlus.CheckStatus (status);
95 public object Clone ()
99 Status status = GDIPlus.GdipClonePath (nativePath, out clone);
100 GDIPlus.CheckStatus (status);
102 return new GraphicsPath (clone);
105 public void Dispose ()
108 System.GC.SuppressFinalize (this);
116 void Dispose (bool disposing)
119 if (nativePath != IntPtr.Zero) {
120 status = GDIPlus.GdipDeletePath (nativePath);
121 GDIPlus.CheckStatus (status);
123 nativePath = IntPtr.Zero;
127 public FillMode FillMode {
130 Status status = GDIPlus.GdipGetPathFillMode (nativePath, out mode);
131 GDIPlus.CheckStatus (status);
136 if ((value < FillMode.Alternate) || (value > FillMode.Winding))
137 throw new InvalidEnumArgumentException ("FillMode", (int)value, typeof (FillMode));
139 Status status = GDIPlus.GdipSetPathFillMode (nativePath, value);
140 GDIPlus.CheckStatus (status);
144 public PathData PathData {
147 Status status = GDIPlus.GdipGetPointCount (nativePath, out count);
148 GDIPlus.CheckStatus (status);
150 PointF [] points = new PointF [count];
151 status = GDIPlus.GdipGetPathPoints (nativePath, points, count);
152 GDIPlus.CheckStatus (status);
154 byte [] types = new byte [count];
155 status = GDIPlus.GdipGetPathTypes (nativePath, types, count);
156 GDIPlus.CheckStatus (status);
158 PathData pdata = new PathData ();
159 pdata.Points = points;
165 public PointF [] PathPoints {
168 Status status = GDIPlus.GdipGetPointCount (nativePath, out count);
169 GDIPlus.CheckStatus (status);
171 throw new ArgumentException ("PathPoints");
173 PointF [] points = new PointF [count];
174 status = GDIPlus.GdipGetPathPoints (nativePath, points, count);
175 GDIPlus.CheckStatus (status);
181 public byte [] PathTypes {
184 Status status = GDIPlus.GdipGetPointCount (nativePath, out count);
185 GDIPlus.CheckStatus (status);
187 throw new ArgumentException ("PathTypes");
189 byte [] types = new byte [count];
190 status = GDIPlus.GdipGetPathTypes (nativePath, types, count);
191 GDIPlus.CheckStatus (status);
197 public int PointCount {
200 Status status = GDIPlus.GdipGetPointCount (nativePath, out count);
201 GDIPlus.CheckStatus (status);
207 internal IntPtr NativeObject {
219 public void AddArc (Rectangle rect, float start_angle, float sweep_angle)
221 Status status = GDIPlus.GdipAddPathArcI (nativePath, rect.X, rect.Y, rect.Width, rect.Height, start_angle, sweep_angle);
222 GDIPlus.CheckStatus (status);
225 public void AddArc (RectangleF rect, float start_angle, float sweep_angle)
227 Status status = GDIPlus.GdipAddPathArc (nativePath, rect.X, rect.Y, rect.Width, rect.Height, start_angle, sweep_angle);
228 GDIPlus.CheckStatus (status);
231 public void AddArc (int x, int y, int width, int height, float start_angle, float sweep_angle)
233 Status status = GDIPlus.GdipAddPathArcI (nativePath, x, y, width, height, start_angle, sweep_angle);
234 GDIPlus.CheckStatus (status);
237 public void AddArc (float x, float y, float width, float height, float start_angle, float sweep_angle)
239 Status status = GDIPlus.GdipAddPathArc (nativePath, x, y, width, height, start_angle, sweep_angle);
240 GDIPlus.CheckStatus (status);
246 public void AddBezier (Point pt1, Point pt2, Point pt3, Point pt4)
248 Status status = GDIPlus.GdipAddPathBezierI (nativePath, pt1.X, pt1.Y,
249 pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y);
251 GDIPlus.CheckStatus (status);
254 public void AddBezier (PointF pt1, PointF pt2, PointF pt3, PointF pt4)
256 Status status = GDIPlus.GdipAddPathBezier (nativePath, pt1.X, pt1.Y,
257 pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y);
259 GDIPlus.CheckStatus (status);
262 public void AddBezier (int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
264 Status status = GDIPlus.GdipAddPathBezierI (nativePath, x1, y1, x2, y2, x3, y3, x4, y4);
265 GDIPlus.CheckStatus (status);
268 public void AddBezier (float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
270 Status status = GDIPlus.GdipAddPathBezier (nativePath, x1, y1, x2, y2, x3, y3, x4, y4);
271 GDIPlus.CheckStatus (status);
277 public void AddBeziers (Point [] pts)
280 throw new ArgumentNullException ("pts");
281 Status status = GDIPlus.GdipAddPathBeziersI (nativePath, pts, pts.Length);
282 GDIPlus.CheckStatus (status);
285 public void AddBeziers (PointF [] pts)
288 throw new ArgumentNullException ("pts");
289 Status status = GDIPlus.GdipAddPathBeziers (nativePath, pts, pts.Length);
290 GDIPlus.CheckStatus (status);
296 public void AddEllipse (RectangleF r)
298 Status status = GDIPlus.GdipAddPathEllipse (nativePath, r.X, r.Y, r.Width, r.Height);
299 GDIPlus.CheckStatus (status);
302 public void AddEllipse (float x, float y, float width, float height)
304 Status status = GDIPlus.GdipAddPathEllipse (nativePath, x, y, width, height);
305 GDIPlus.CheckStatus (status);
308 public void AddEllipse (Rectangle r)
310 Status status = GDIPlus.GdipAddPathEllipseI (nativePath, r.X, r.Y, r.Width, r.Height);
311 GDIPlus.CheckStatus (status);
314 public void AddEllipse (int x, int y, int width, int height)
316 Status status = GDIPlus.GdipAddPathEllipseI (nativePath, x, y, width, height);
317 GDIPlus.CheckStatus (status);
324 public void AddLine (Point a, Point b)
326 Status status = GDIPlus.GdipAddPathLineI (nativePath, a.X, a.Y, b.X, b.Y);
327 GDIPlus.CheckStatus (status);
330 public void AddLine (PointF a, PointF b)
332 Status status = GDIPlus.GdipAddPathLine (nativePath, a.X, a.Y, b.X,
335 GDIPlus.CheckStatus (status);
338 public void AddLine (int x1, int y1, int x2, int y2)
340 Status status = GDIPlus.GdipAddPathLineI (nativePath, x1, y1, x2, y2);
341 GDIPlus.CheckStatus (status);
344 public void AddLine (float x1, float y1, float x2, float y2)
346 Status status = GDIPlus.GdipAddPathLine (nativePath, x1, y1, x2,
349 GDIPlus.CheckStatus (status);
355 public void AddLines (Point [] points)
358 throw new ArgumentNullException ("points");
359 if (points.Length == 0)
360 throw new ArgumentException ("points");
362 int length = points.Length;
363 for (int i = 0; i < length - 1; i++) {
365 Status status = GDIPlus.GdipAddPathLineI (
366 nativePath, points [i].X, points [i].Y, points [j].X, points [j].Y);
367 GDIPlus.CheckStatus (status);
371 public void AddLines (PointF [] points)
374 throw new ArgumentNullException ("points");
375 if (points.Length == 0)
376 throw new ArgumentException ("points");
378 int length = points.Length;
380 for (int i = 0; i < length - 1; i++) {
382 Status status = GDIPlus.GdipAddPathLine (
383 nativePath, points [i].X, points [i].Y, points [j].X, points [j].Y);
384 GDIPlus.CheckStatus (status);
391 public void AddPie (Rectangle rect, float startAngle, float sweepAngle)
393 Status status = GDIPlus.GdipAddPathPie (
394 nativePath, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
395 GDIPlus.CheckStatus (status);
398 public void AddPie (int x, int y, int width, int height, float startAngle, float sweepAngle)
400 Status status = GDIPlus.GdipAddPathPieI (nativePath, x, y, width, height, startAngle, sweepAngle);
401 GDIPlus.CheckStatus (status);
404 public void AddPie (float x, float y, float width, float height, float startAngle, float sweepAngle)
406 Status status = GDIPlus.GdipAddPathPie (nativePath, x, y, width, height, startAngle, sweepAngle);
407 GDIPlus.CheckStatus (status);
413 public void AddPolygon (Point [] points)
416 throw new ArgumentNullException ("points");
418 Status status = GDIPlus.GdipAddPathPolygonI (nativePath, points, points.Length);
419 GDIPlus.CheckStatus (status);
422 public void AddPolygon (PointF [] points)
425 throw new ArgumentNullException ("points");
427 Status status = GDIPlus.GdipAddPathPolygon (nativePath, points, points.Length);
428 GDIPlus.CheckStatus (status);
434 public void AddRectangle (Rectangle rect)
436 Status status = GDIPlus.GdipAddPathRectangleI (nativePath, rect.X, rect.Y, rect.Width, rect.Height);
437 GDIPlus.CheckStatus (status);
440 public void AddRectangle (RectangleF rect)
442 Status status = GDIPlus.GdipAddPathRectangle (nativePath, rect.X, rect.Y, rect.Width, rect.Height);
443 GDIPlus.CheckStatus (status);
449 public void AddRectangles (Rectangle [] rects)
452 throw new ArgumentNullException ("rects");
453 if (rects.Length == 0)
454 throw new ArgumentException ("rects");
456 Status status = GDIPlus.GdipAddPathRectanglesI (nativePath, rects, rects.Length);
457 GDIPlus.CheckStatus (status);
460 public void AddRectangles (RectangleF [] rects)
463 throw new ArgumentNullException ("rects");
464 if (rects.Length == 0)
465 throw new ArgumentException ("rects");
467 Status status = GDIPlus.GdipAddPathRectangles (nativePath, rects, rects.Length);
468 GDIPlus.CheckStatus (status);
474 public void AddPath (GraphicsPath addingPath, bool connect)
476 if (addingPath == null)
477 throw new ArgumentNullException ("addingPath");
479 Status status = GDIPlus.GdipAddPathPath (nativePath, addingPath.nativePath, connect);
480 GDIPlus.CheckStatus (status);
483 public PointF GetLastPoint ()
486 Status status = GDIPlus.GdipGetPathLastPoint (nativePath, out pt);
487 GDIPlus.CheckStatus (status);
495 public void AddClosedCurve (Point [] points)
498 throw new ArgumentNullException ("points");
500 Status status = GDIPlus.GdipAddPathClosedCurveI (nativePath, points, points.Length);
501 GDIPlus.CheckStatus (status);
504 public void AddClosedCurve (PointF [] points)
507 throw new ArgumentNullException ("points");
509 Status status = GDIPlus.GdipAddPathClosedCurve (nativePath, points, points.Length);
510 GDIPlus.CheckStatus (status);
513 public void AddClosedCurve (Point [] points, float tension)
516 throw new ArgumentNullException ("points");
518 Status status = GDIPlus.GdipAddPathClosedCurve2I (nativePath, points, points.Length, tension);
519 GDIPlus.CheckStatus (status);
522 public void AddClosedCurve (PointF [] points, float tension)
525 throw new ArgumentNullException ("points");
527 Status status = GDIPlus.GdipAddPathClosedCurve2 (nativePath, points, points.Length, tension);
528 GDIPlus.CheckStatus (status);
534 public void AddCurve (Point [] points)
537 throw new ArgumentNullException ("points");
539 Status status = GDIPlus.GdipAddPathCurveI (nativePath, points, points.Length);
540 GDIPlus.CheckStatus (status);
543 public void AddCurve (PointF [] points)
546 throw new ArgumentNullException ("points");
548 Status status = GDIPlus.GdipAddPathCurve (nativePath, points, points.Length);
549 GDIPlus.CheckStatus (status);
552 public void AddCurve (Point [] points, float tension)
555 throw new ArgumentNullException ("points");
557 Status status = GDIPlus.GdipAddPathCurve2I (nativePath, points, points.Length, tension);
558 GDIPlus.CheckStatus (status);
561 public void AddCurve (PointF [] points, float tension)
564 throw new ArgumentNullException ("points");
566 Status status = GDIPlus.GdipAddPathCurve2 (nativePath, points, points.Length, tension);
567 GDIPlus.CheckStatus (status);
570 public void AddCurve (Point [] points, int offset, int numberOfSegments, float tension)
573 throw new ArgumentNullException ("points");
575 Status status = GDIPlus.GdipAddPathCurve3I (nativePath, points, points.Length,
576 offset, numberOfSegments, tension);
578 GDIPlus.CheckStatus (status);
581 public void AddCurve (PointF [] points, int offset, int numberOfSegments, float tension)
584 throw new ArgumentNullException ("points");
586 Status status = GDIPlus.GdipAddPathCurve3 (nativePath, points, points.Length,
587 offset, numberOfSegments, tension);
589 GDIPlus.CheckStatus (status);
594 Status status = GDIPlus.GdipResetPath (nativePath);
595 GDIPlus.CheckStatus (status);
598 public void Reverse ()
600 Status status = GDIPlus.GdipReversePath (nativePath);
601 GDIPlus.CheckStatus (status);
604 public void Transform (Matrix matrix)
607 throw new ArgumentNullException ("matrix");
609 Status status = GDIPlus.GdipTransformPath (nativePath, matrix.nativeMatrix);
610 GDIPlus.CheckStatus (status);
613 [MonoTODO ("GdipAddStringI isn't implemented in libgdiplus")]
614 public void AddString (string s, FontFamily family, int style, float emSize, Point origin, StringFormat format)
619 AddString (s, family, style, emSize, layout, format);
622 [MonoTODO ("GdipAddString isn't implemented in libgdiplus")]
623 public void AddString (string s, FontFamily family, int style, float emSize, PointF origin, StringFormat format)
628 AddString (s, family, style, emSize, layout, format);
631 [MonoTODO ("GdipAddStringI isn't implemented in libgdiplus")]
632 public void AddString (string s, FontFamily family, int style, float emSize, Rectangle layoutRect, StringFormat format)
635 throw new ArgumentNullException ("s");
637 IntPtr ffamily = (family == null) ? IntPtr.Zero : family.NativeObject;
638 IntPtr sformat = (format == null) ? IntPtr.Zero : format.NativeObject;
640 Status status = GDIPlus.GdipAddStringI (nativePath, s, s.Length, ffamily, style, emSize, ref layoutRect, sformat);
641 GDIPlus.CheckStatus (status);
644 [MonoTODO ("GdipAddString isn't implemented in libgdiplus")]
645 public void AddString (string s, FontFamily family, int style, float emSize, RectangleF layoutRect, StringFormat format)
648 throw new ArgumentNullException ("s");
650 IntPtr ffamily = (family == null) ? IntPtr.Zero : family.NativeObject;
651 IntPtr sformat = (format == null) ? IntPtr.Zero : format.NativeObject;
653 Status status = GDIPlus.GdipAddString (nativePath, s, s.Length, ffamily, style, emSize, ref layoutRect, sformat);
654 GDIPlus.CheckStatus (status);
657 public void ClearMarkers()
659 Status s = GDIPlus.GdipClearPathMarkers (nativePath);
661 GDIPlus.CheckStatus (s);
664 public void CloseAllFigures()
666 Status s = GDIPlus.GdipClosePathFigures (nativePath);
668 GDIPlus.CheckStatus (s);
671 public void CloseFigure()
673 Status s = GDIPlus.GdipClosePathFigure (nativePath);
675 GDIPlus.CheckStatus (s);
678 public void Flatten ()
680 Flatten (null, FlatnessDefault);
683 public void Flatten (Matrix matrix)
685 Flatten (matrix, FlatnessDefault);
688 public void Flatten (Matrix matrix, float flatness)
690 IntPtr m = (matrix == null) ? IntPtr.Zero : matrix.nativeMatrix;
691 Status status = GDIPlus.GdipFlattenPath (nativePath, m, flatness);
693 GDIPlus.CheckStatus (status);
696 public RectangleF GetBounds ()
698 return GetBounds (null, null);
701 public RectangleF GetBounds (Matrix matrix)
703 return GetBounds (matrix, null);
706 [MonoTODO ("GdipGetPathWorldBounds doesn't support pens in libgdiplus (missing GdipWidenPath)")]
707 public RectangleF GetBounds (Matrix matrix, Pen pen)
710 IntPtr m = (matrix == null) ? IntPtr.Zero : matrix.nativeMatrix;
711 IntPtr p = (pen == null) ? IntPtr.Zero : pen.nativeObject;
713 Status s = GDIPlus.GdipGetPathWorldBounds (nativePath, out retval, m, p);
715 GDIPlus.CheckStatus (s);
720 [MonoTODO ("GdipIsOutlineVisiblePathPoint[I] isn't implemented in libgdiplus")]
721 public bool IsOutlineVisible (Point point, Pen pen)
723 return IsOutlineVisible (point.X, point.Y, pen, null);
726 [MonoTODO ("GdipIsOutlineVisiblePathPoint[I] isn't implemented in libgdiplus")]
727 public bool IsOutlineVisible (PointF point, Pen pen)
729 return IsOutlineVisible (point.X, point.Y, pen, null);
732 [MonoTODO ("GdipIsOutlineVisiblePathPoint[I] isn't implemented in libgdiplus")]
733 public bool IsOutlineVisible (int x, int y, Pen pen)
735 return IsOutlineVisible (x, y, pen, null);
738 [MonoTODO ("GdipIsOutlineVisiblePathPoint[I] isn't implemented in libgdiplus")]
739 public bool IsOutlineVisible (float x, float y, Pen pen)
741 return IsOutlineVisible (x, y, pen, null);
744 [MonoTODO ("GdipIsOutlineVisiblePathPoint[I] isn't implemented in libgdiplus")]
745 public bool IsOutlineVisible (Point pt, Pen pen, Graphics graphics)
747 return IsOutlineVisible (pt.X, pt.Y, pen, graphics);
750 [MonoTODO ("GdipIsOutlineVisiblePathPoint[I] isn't implemented in libgdiplus")]
751 public bool IsOutlineVisible (PointF pt, Pen pen, Graphics graphics)
753 return IsOutlineVisible (pt.X, pt.Y, pen, graphics);
756 [MonoTODO ("GdipIsOutlineVisiblePathPoint[I] isn't implemented in libgdiplus")]
757 public bool IsOutlineVisible (int x, int y, Pen pen, Graphics graphics)
760 IntPtr g = (graphics == null) ? IntPtr.Zero : graphics.nativeObject;
762 Status s = GDIPlus.GdipIsOutlineVisiblePathPointI (nativePath, x, y, g, out result);
763 GDIPlus.CheckStatus (s);
768 [MonoTODO ("GdipIsOutlineVisiblePathPoint[I] isn't implemented in libgdiplus")]
769 public bool IsOutlineVisible (float x, float y, Pen pen, Graphics graphics)
772 IntPtr g = (graphics == null) ? IntPtr.Zero : graphics.nativeObject;
774 Status s = GDIPlus.GdipIsOutlineVisiblePathPoint (nativePath, x, y, g, out result);
775 GDIPlus.CheckStatus (s);
780 [MonoTODO ("GdipIsVisiblePathPoint[I] isn't implemented in libgdiplus")]
781 public bool IsVisible (Point point)
783 return IsVisible (point.X, point.Y, null);
786 [MonoTODO ("GdipIsVisiblePathPoint[I] isn't implemented in libgdiplus")]
787 public bool IsVisible (PointF point)
789 return IsVisible (point.X, point.Y, null);
792 [MonoTODO ("GdipIsVisiblePathPoint[I] isn't implemented in libgdiplus")]
793 public bool IsVisible (int x, int y)
795 return IsVisible (x, y, null);
798 [MonoTODO ("GdipIsVisiblePathPoint[I] isn't implemented in libgdiplus")]
799 public bool IsVisible (float x, float y)
801 return IsVisible (x, y, null);
804 [MonoTODO ("GdipIsVisiblePathPoint[I] isn't implemented in libgdiplus")]
805 public bool IsVisible (Point pt, Graphics graphics)
807 return IsVisible (pt.X, pt.Y, graphics);
810 [MonoTODO ("GdipIsVisiblePathPoint[I] isn't implemented in libgdiplus")]
811 public bool IsVisible (PointF pt, Graphics graphics)
813 return IsVisible (pt.X, pt.Y, graphics);
816 [MonoTODO ("GdipIsVisiblePathPoint[I] isn't implemented in libgdiplus")]
817 public bool IsVisible (int x, int y, Graphics graphics)
821 IntPtr g = (graphics == null) ? IntPtr.Zero : graphics.nativeObject;
823 Status s = GDIPlus.GdipIsVisiblePathPointI (nativePath, x, y, g, out retval);
825 GDIPlus.CheckStatus (s);
830 [MonoTODO ("GdipIsVisiblePathPoint[I] isn't implemented in libgdiplus")]
831 public bool IsVisible (float x, float y, Graphics graphics)
835 IntPtr g = (graphics == null) ? IntPtr.Zero : graphics.nativeObject;
837 Status s = GDIPlus.GdipIsVisiblePathPoint (nativePath, x, y, g, out retval);
839 GDIPlus.CheckStatus (s);
844 public void SetMarkers ()
846 Status s = GDIPlus.GdipSetPathMarker (nativePath);
848 GDIPlus.CheckStatus (s);
851 public void StartFigure()
853 Status s = GDIPlus.GdipStartPathFigure (nativePath);
855 GDIPlus.CheckStatus (s);
858 [MonoTODO ("GdipWarpPath isn't implemented in libgdiplus")]
859 public void Warp (PointF[] destPoints, RectangleF srcRect)
861 Warp (destPoints, srcRect, null, WarpMode.Perspective, FlatnessDefault);
864 [MonoTODO ("GdipWarpPath isn't implemented in libgdiplus")]
865 public void Warp (PointF[] destPoints, RectangleF srcRect, Matrix matrix)
867 Warp (destPoints, srcRect, matrix, WarpMode.Perspective, FlatnessDefault);
870 [MonoTODO ("GdipWarpPath isn't implemented in libgdiplus")]
871 public void Warp (PointF[] destPoints, RectangleF srcRect, Matrix matrix, WarpMode warpMode)
873 Warp (destPoints, srcRect, matrix, warpMode, FlatnessDefault);
876 [MonoTODO ("GdipWarpPath isn't implemented in libgdiplus")]
877 public void Warp (PointF[] destPoints, RectangleF srcRect, Matrix matrix, WarpMode warpMode, float flatness)
879 if (destPoints == null)
880 throw new ArgumentNullException ("destPoints");
882 IntPtr m = (matrix == null) ? IntPtr.Zero : matrix.nativeMatrix;
884 Status s = GDIPlus.GdipWarpPath (nativePath, m, destPoints, destPoints.Length,
885 srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, warpMode, flatness);
887 GDIPlus.CheckStatus (s);
890 [MonoTODO ("GdipWidenPath isn't implemented in libgdiplus")]
891 public void Widen (Pen pen)
893 Widen (pen, null, FlatnessDefault);
896 [MonoTODO ("GdipWidenPath isn't implemented in libgdiplus")]
897 public void Widen (Pen pen, Matrix matrix)
899 Widen (pen, matrix, FlatnessDefault);
902 [MonoTODO ("GdipWidenPath isn't implemented in libgdiplus")]
903 public void Widen (Pen pen, Matrix matrix, float flatness)
905 IntPtr p = (pen == null) ? IntPtr.Zero : pen.nativeObject;
906 IntPtr m = (matrix == null) ? IntPtr.Zero : matrix.nativeMatrix;
908 Status s = GDIPlus.GdipWidenPath (nativePath, p, m, flatness);
910 GDIPlus.CheckStatus (s);