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);
614 public void AddString (string s, FontFamily family, int style, float emSize, Point origin, StringFormat format)
616 throw new NotImplementedException ();
620 public void AddString (string s, FontFamily family, int style, float emSize, PointF origin, StringFormat format)
622 throw new NotImplementedException ();
626 public void AddString (string s, FontFamily family, int style, float emSize, Rectangle layoutRect, StringFormat format)
628 throw new NotImplementedException ();
632 public void AddString (string s, FontFamily family, int style, float emSize, RectangleF layoutRect, StringFormat format)
634 throw new NotImplementedException ();
637 public void ClearMarkers()
639 Status s = GDIPlus.GdipClearPathMarkers (nativePath);
641 GDIPlus.CheckStatus (s);
644 public void CloseAllFigures()
646 Status s = GDIPlus.GdipClosePathFigures (nativePath);
648 GDIPlus.CheckStatus (s);
651 public void CloseFigure()
653 Status s = GDIPlus.GdipClosePathFigure (nativePath);
655 GDIPlus.CheckStatus (s);
658 public void Flatten ()
660 Flatten (null, FlatnessDefault);
663 public void Flatten (Matrix matrix)
665 Flatten (matrix, FlatnessDefault);
668 public void Flatten (Matrix matrix, float flatness)
670 IntPtr m = (matrix == null) ? IntPtr.Zero : matrix.nativeMatrix;
671 Status status = GDIPlus.GdipFlattenPath (nativePath, m, flatness);
673 GDIPlus.CheckStatus (status);
676 public RectangleF GetBounds ()
678 return GetBounds (null, null);
681 public RectangleF GetBounds (Matrix matrix)
683 return GetBounds (matrix, null);
686 [MonoTODO ("GdipGetPathWorldBounds doesn't support pens in libgdiplus (missing GdipWidenPath)")]
687 public RectangleF GetBounds (Matrix matrix, Pen pen)
690 IntPtr m = (matrix == null) ? IntPtr.Zero : matrix.nativeMatrix;
691 IntPtr p = (pen == null) ? IntPtr.Zero : pen.nativeObject;
693 Status s = GDIPlus.GdipGetPathWorldBounds (nativePath, out retval, m, p);
695 GDIPlus.CheckStatus (s);
700 [MonoTODO ("GdipIsOutlineVisiblePathPoint[I] isn't implemented in libgdiplus")]
701 public bool IsOutlineVisible (Point point, Pen pen)
703 return IsOutlineVisible (point.X, point.Y, pen, null);
706 [MonoTODO ("GdipIsOutlineVisiblePathPoint[I] isn't implemented in libgdiplus")]
707 public bool IsOutlineVisible (PointF point, Pen pen)
709 return IsOutlineVisible (point.X, point.Y, pen, null);
712 [MonoTODO ("GdipIsOutlineVisiblePathPoint[I] isn't implemented in libgdiplus")]
713 public bool IsOutlineVisible (int x, int y, Pen pen)
715 return IsOutlineVisible (x, y, pen, null);
718 [MonoTODO ("GdipIsOutlineVisiblePathPoint[I] isn't implemented in libgdiplus")]
719 public bool IsOutlineVisible (float x, float y, Pen pen)
721 return IsOutlineVisible (x, y, pen, null);
724 [MonoTODO ("GdipIsOutlineVisiblePathPoint[I] isn't implemented in libgdiplus")]
725 public bool IsOutlineVisible (Point pt, Pen pen, Graphics graphics)
727 return IsOutlineVisible (pt.X, pt.Y, pen, graphics);
730 [MonoTODO ("GdipIsOutlineVisiblePathPoint[I] isn't implemented in libgdiplus")]
731 public bool IsOutlineVisible (PointF pt, Pen pen, Graphics graphics)
733 return IsOutlineVisible (pt.X, pt.Y, pen, graphics);
736 [MonoTODO ("GdipIsOutlineVisiblePathPoint[I] isn't implemented in libgdiplus")]
737 public bool IsOutlineVisible (int x, int y, Pen pen, Graphics graphics)
740 IntPtr g = (graphics == null) ? IntPtr.Zero : graphics.nativeObject;
742 Status s = GDIPlus.GdipIsOutlineVisiblePathPointI (nativePath, x, y, g, out result);
743 GDIPlus.CheckStatus (s);
748 [MonoTODO ("GdipIsOutlineVisiblePathPoint[I] isn't implemented in libgdiplus")]
749 public bool IsOutlineVisible (float x, float y, Pen pen, Graphics graphics)
752 IntPtr g = (graphics == null) ? IntPtr.Zero : graphics.nativeObject;
754 Status s = GDIPlus.GdipIsOutlineVisiblePathPoint (nativePath, x, y, g, out result);
755 GDIPlus.CheckStatus (s);
760 [MonoTODO ("GdipIsVisiblePathPoint[I] isn't implemented in libgdiplus")]
761 public bool IsVisible (Point point)
763 return IsVisible (point.X, point.Y, null);
766 [MonoTODO ("GdipIsVisiblePathPoint[I] isn't implemented in libgdiplus")]
767 public bool IsVisible (PointF point)
769 return IsVisible (point.X, point.Y, null);
772 [MonoTODO ("GdipIsVisiblePathPoint[I] isn't implemented in libgdiplus")]
773 public bool IsVisible (int x, int y)
775 return IsVisible (x, y, null);
778 [MonoTODO ("GdipIsVisiblePathPoint[I] isn't implemented in libgdiplus")]
779 public bool IsVisible (float x, float y)
781 return IsVisible (x, y, null);
784 [MonoTODO ("GdipIsVisiblePathPoint[I] isn't implemented in libgdiplus")]
785 public bool IsVisible (Point pt, Graphics graphics)
787 return IsVisible (pt.X, pt.Y, graphics);
790 [MonoTODO ("GdipIsVisiblePathPoint[I] isn't implemented in libgdiplus")]
791 public bool IsVisible (PointF pt, Graphics graphics)
793 return IsVisible (pt.X, pt.Y, graphics);
796 [MonoTODO ("GdipIsVisiblePathPoint[I] isn't implemented in libgdiplus")]
797 public bool IsVisible (int x, int y, Graphics graphics)
801 IntPtr g = (graphics == null) ? IntPtr.Zero : graphics.nativeObject;
803 Status s = GDIPlus.GdipIsVisiblePathPointI (nativePath, x, y, g, out retval);
805 GDIPlus.CheckStatus (s);
810 [MonoTODO ("GdipIsVisiblePathPoint[I] isn't implemented in libgdiplus")]
811 public bool IsVisible (float x, float y, Graphics graphics)
815 IntPtr g = (graphics == null) ? IntPtr.Zero : graphics.nativeObject;
817 Status s = GDIPlus.GdipIsVisiblePathPoint (nativePath, x, y, g, out retval);
819 GDIPlus.CheckStatus (s);
824 public void SetMarkers ()
826 Status s = GDIPlus.GdipSetPathMarker (nativePath);
828 GDIPlus.CheckStatus (s);
831 public void StartFigure()
833 Status s = GDIPlus.GdipStartPathFigure (nativePath);
835 GDIPlus.CheckStatus (s);
838 [MonoTODO ("GdipWarpPath isn't implemented in libgdiplus")]
839 public void Warp (PointF[] destPoints, RectangleF srcRect)
841 Warp (destPoints, srcRect, null, WarpMode.Perspective, FlatnessDefault);
844 [MonoTODO ("GdipWarpPath isn't implemented in libgdiplus")]
845 public void Warp (PointF[] destPoints, RectangleF srcRect, Matrix matrix)
847 Warp (destPoints, srcRect, matrix, WarpMode.Perspective, FlatnessDefault);
850 [MonoTODO ("GdipWarpPath isn't implemented in libgdiplus")]
851 public void Warp (PointF[] destPoints, RectangleF srcRect, Matrix matrix, WarpMode warpMode)
853 Warp (destPoints, srcRect, matrix, warpMode, FlatnessDefault);
856 [MonoTODO ("GdipWarpPath isn't implemented in libgdiplus")]
857 public void Warp (PointF[] destPoints, RectangleF srcRect, Matrix matrix, WarpMode warpMode, float flatness)
859 if (destPoints == null)
860 throw new ArgumentNullException ("destPoints");
862 IntPtr m = (matrix == null) ? IntPtr.Zero : matrix.nativeMatrix;
864 Status s = GDIPlus.GdipWarpPath (nativePath, m, destPoints, destPoints.Length,
865 srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, warpMode, flatness);
867 GDIPlus.CheckStatus (s);
870 [MonoTODO ("GdipWidenPath isn't implemented in libgdiplus")]
871 public void Widen (Pen pen)
873 Widen (pen, null, FlatnessDefault);
876 [MonoTODO ("GdipWidenPath isn't implemented in libgdiplus")]
877 public void Widen (Pen pen, Matrix matrix)
879 Widen (pen, matrix, FlatnessDefault);
882 [MonoTODO ("GdipWidenPath isn't implemented in libgdiplus")]
883 public void Widen (Pen pen, Matrix matrix, float flatness)
885 IntPtr p = (pen == null) ? IntPtr.Zero : pen.nativeObject;
886 IntPtr m = (matrix == null) ? IntPtr.Zero : matrix.nativeMatrix;
888 Status s = GDIPlus.GdipWidenPath (nativePath, p, m, flatness);
890 GDIPlus.CheckStatus (s);