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 byte [] types = new byte [count];
153 // status would fail if we ask points or types with a 0 count
154 // anyway that would only mean two unrequired unmanaged calls
156 status = GDIPlus.GdipGetPathPoints (nativePath, points, count);
157 GDIPlus.CheckStatus (status);
159 status = GDIPlus.GdipGetPathTypes (nativePath, types, count);
160 GDIPlus.CheckStatus (status);
163 PathData pdata = new PathData ();
164 pdata.Points = points;
170 public PointF [] PathPoints {
173 Status status = GDIPlus.GdipGetPointCount (nativePath, out count);
174 GDIPlus.CheckStatus (status);
176 throw new ArgumentException ("PathPoints");
178 PointF [] points = new PointF [count];
179 status = GDIPlus.GdipGetPathPoints (nativePath, points, count);
180 GDIPlus.CheckStatus (status);
186 public byte [] PathTypes {
189 Status status = GDIPlus.GdipGetPointCount (nativePath, out count);
190 GDIPlus.CheckStatus (status);
192 throw new ArgumentException ("PathTypes");
194 byte [] types = new byte [count];
195 status = GDIPlus.GdipGetPathTypes (nativePath, types, count);
196 GDIPlus.CheckStatus (status);
202 public int PointCount {
205 Status status = GDIPlus.GdipGetPointCount (nativePath, out count);
206 GDIPlus.CheckStatus (status);
212 internal IntPtr NativeObject {
224 public void AddArc (Rectangle rect, float start_angle, float sweep_angle)
226 Status status = GDIPlus.GdipAddPathArcI (nativePath, rect.X, rect.Y, rect.Width, rect.Height, start_angle, sweep_angle);
227 GDIPlus.CheckStatus (status);
230 public void AddArc (RectangleF rect, float start_angle, float sweep_angle)
232 Status status = GDIPlus.GdipAddPathArc (nativePath, rect.X, rect.Y, rect.Width, rect.Height, start_angle, sweep_angle);
233 GDIPlus.CheckStatus (status);
236 public void AddArc (int x, int y, int width, int height, float start_angle, float sweep_angle)
238 Status status = GDIPlus.GdipAddPathArcI (nativePath, x, y, width, height, start_angle, sweep_angle);
239 GDIPlus.CheckStatus (status);
242 public void AddArc (float x, float y, float width, float height, float start_angle, float sweep_angle)
244 Status status = GDIPlus.GdipAddPathArc (nativePath, x, y, width, height, start_angle, sweep_angle);
245 GDIPlus.CheckStatus (status);
251 public void AddBezier (Point pt1, Point pt2, Point pt3, Point pt4)
253 Status status = GDIPlus.GdipAddPathBezierI (nativePath, pt1.X, pt1.Y,
254 pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y);
256 GDIPlus.CheckStatus (status);
259 public void AddBezier (PointF pt1, PointF pt2, PointF pt3, PointF pt4)
261 Status status = GDIPlus.GdipAddPathBezier (nativePath, pt1.X, pt1.Y,
262 pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y);
264 GDIPlus.CheckStatus (status);
267 public void AddBezier (int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
269 Status status = GDIPlus.GdipAddPathBezierI (nativePath, x1, y1, x2, y2, x3, y3, x4, y4);
270 GDIPlus.CheckStatus (status);
273 public void AddBezier (float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
275 Status status = GDIPlus.GdipAddPathBezier (nativePath, x1, y1, x2, y2, x3, y3, x4, y4);
276 GDIPlus.CheckStatus (status);
282 public void AddBeziers (Point [] pts)
285 throw new ArgumentNullException ("pts");
286 Status status = GDIPlus.GdipAddPathBeziersI (nativePath, pts, pts.Length);
287 GDIPlus.CheckStatus (status);
290 public void AddBeziers (PointF [] pts)
293 throw new ArgumentNullException ("pts");
294 Status status = GDIPlus.GdipAddPathBeziers (nativePath, pts, pts.Length);
295 GDIPlus.CheckStatus (status);
301 public void AddEllipse (RectangleF r)
303 Status status = GDIPlus.GdipAddPathEllipse (nativePath, r.X, r.Y, r.Width, r.Height);
304 GDIPlus.CheckStatus (status);
307 public void AddEllipse (float x, float y, float width, float height)
309 Status status = GDIPlus.GdipAddPathEllipse (nativePath, x, y, width, height);
310 GDIPlus.CheckStatus (status);
313 public void AddEllipse (Rectangle r)
315 Status status = GDIPlus.GdipAddPathEllipseI (nativePath, r.X, r.Y, r.Width, r.Height);
316 GDIPlus.CheckStatus (status);
319 public void AddEllipse (int x, int y, int width, int height)
321 Status status = GDIPlus.GdipAddPathEllipseI (nativePath, x, y, width, height);
322 GDIPlus.CheckStatus (status);
329 public void AddLine (Point a, Point b)
331 Status status = GDIPlus.GdipAddPathLineI (nativePath, a.X, a.Y, b.X, b.Y);
332 GDIPlus.CheckStatus (status);
335 public void AddLine (PointF a, PointF b)
337 Status status = GDIPlus.GdipAddPathLine (nativePath, a.X, a.Y, b.X,
340 GDIPlus.CheckStatus (status);
343 public void AddLine (int x1, int y1, int x2, int y2)
345 Status status = GDIPlus.GdipAddPathLineI (nativePath, x1, y1, x2, y2);
346 GDIPlus.CheckStatus (status);
349 public void AddLine (float x1, float y1, float x2, float y2)
351 Status status = GDIPlus.GdipAddPathLine (nativePath, x1, y1, x2,
354 GDIPlus.CheckStatus (status);
360 public void AddLines (Point[] points)
363 throw new ArgumentNullException ("points");
364 if (points.Length == 0)
365 throw new ArgumentException ("points");
367 Status status = GDIPlus.GdipAddPathLine2I (nativePath, points, points.Length);
368 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 Status status = GDIPlus.GdipAddPathLine2 (nativePath, points, points.Length);
379 GDIPlus.CheckStatus (status);
385 public void AddPie (Rectangle rect, float startAngle, float sweepAngle)
387 Status status = GDIPlus.GdipAddPathPie (
388 nativePath, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
389 GDIPlus.CheckStatus (status);
392 public void AddPie (int x, int y, int width, int height, float startAngle, float sweepAngle)
394 Status status = GDIPlus.GdipAddPathPieI (nativePath, x, y, width, height, startAngle, sweepAngle);
395 GDIPlus.CheckStatus (status);
398 public void AddPie (float x, float y, float width, float height, float startAngle, float sweepAngle)
400 Status status = GDIPlus.GdipAddPathPie (nativePath, x, y, width, height, startAngle, sweepAngle);
401 GDIPlus.CheckStatus (status);
407 public void AddPolygon (Point [] points)
410 throw new ArgumentNullException ("points");
412 Status status = GDIPlus.GdipAddPathPolygonI (nativePath, points, points.Length);
413 GDIPlus.CheckStatus (status);
416 public void AddPolygon (PointF [] points)
419 throw new ArgumentNullException ("points");
421 Status status = GDIPlus.GdipAddPathPolygon (nativePath, points, points.Length);
422 GDIPlus.CheckStatus (status);
428 public void AddRectangle (Rectangle rect)
430 Status status = GDIPlus.GdipAddPathRectangleI (nativePath, rect.X, rect.Y, rect.Width, rect.Height);
431 GDIPlus.CheckStatus (status);
434 public void AddRectangle (RectangleF rect)
436 Status status = GDIPlus.GdipAddPathRectangle (nativePath, rect.X, rect.Y, rect.Width, rect.Height);
437 GDIPlus.CheckStatus (status);
443 public void AddRectangles (Rectangle [] rects)
446 throw new ArgumentNullException ("rects");
447 if (rects.Length == 0)
448 throw new ArgumentException ("rects");
450 Status status = GDIPlus.GdipAddPathRectanglesI (nativePath, rects, rects.Length);
451 GDIPlus.CheckStatus (status);
454 public void AddRectangles (RectangleF [] rects)
457 throw new ArgumentNullException ("rects");
458 if (rects.Length == 0)
459 throw new ArgumentException ("rects");
461 Status status = GDIPlus.GdipAddPathRectangles (nativePath, rects, rects.Length);
462 GDIPlus.CheckStatus (status);
468 public void AddPath (GraphicsPath addingPath, bool connect)
470 if (addingPath == null)
471 throw new ArgumentNullException ("addingPath");
473 Status status = GDIPlus.GdipAddPathPath (nativePath, addingPath.nativePath, connect);
474 GDIPlus.CheckStatus (status);
477 public PointF GetLastPoint ()
480 Status status = GDIPlus.GdipGetPathLastPoint (nativePath, out pt);
481 GDIPlus.CheckStatus (status);
489 public void AddClosedCurve (Point [] points)
492 throw new ArgumentNullException ("points");
494 Status status = GDIPlus.GdipAddPathClosedCurveI (nativePath, points, points.Length);
495 GDIPlus.CheckStatus (status);
498 public void AddClosedCurve (PointF [] points)
501 throw new ArgumentNullException ("points");
503 Status status = GDIPlus.GdipAddPathClosedCurve (nativePath, points, points.Length);
504 GDIPlus.CheckStatus (status);
507 public void AddClosedCurve (Point [] points, float tension)
510 throw new ArgumentNullException ("points");
512 Status status = GDIPlus.GdipAddPathClosedCurve2I (nativePath, points, points.Length, tension);
513 GDIPlus.CheckStatus (status);
516 public void AddClosedCurve (PointF [] points, float tension)
519 throw new ArgumentNullException ("points");
521 Status status = GDIPlus.GdipAddPathClosedCurve2 (nativePath, points, points.Length, tension);
522 GDIPlus.CheckStatus (status);
528 public void AddCurve (Point [] points)
531 throw new ArgumentNullException ("points");
533 Status status = GDIPlus.GdipAddPathCurveI (nativePath, points, points.Length);
534 GDIPlus.CheckStatus (status);
537 public void AddCurve (PointF [] points)
540 throw new ArgumentNullException ("points");
542 Status status = GDIPlus.GdipAddPathCurve (nativePath, points, points.Length);
543 GDIPlus.CheckStatus (status);
546 public void AddCurve (Point [] points, float tension)
549 throw new ArgumentNullException ("points");
551 Status status = GDIPlus.GdipAddPathCurve2I (nativePath, points, points.Length, tension);
552 GDIPlus.CheckStatus (status);
555 public void AddCurve (PointF [] points, float tension)
558 throw new ArgumentNullException ("points");
560 Status status = GDIPlus.GdipAddPathCurve2 (nativePath, points, points.Length, tension);
561 GDIPlus.CheckStatus (status);
564 public void AddCurve (Point [] points, int offset, int numberOfSegments, float tension)
567 throw new ArgumentNullException ("points");
569 Status status = GDIPlus.GdipAddPathCurve3I (nativePath, points, points.Length,
570 offset, numberOfSegments, tension);
572 GDIPlus.CheckStatus (status);
575 public void AddCurve (PointF [] points, int offset, int numberOfSegments, float tension)
578 throw new ArgumentNullException ("points");
580 Status status = GDIPlus.GdipAddPathCurve3 (nativePath, points, points.Length,
581 offset, numberOfSegments, tension);
583 GDIPlus.CheckStatus (status);
588 Status status = GDIPlus.GdipResetPath (nativePath);
589 GDIPlus.CheckStatus (status);
592 public void Reverse ()
594 Status status = GDIPlus.GdipReversePath (nativePath);
595 GDIPlus.CheckStatus (status);
598 public void Transform (Matrix matrix)
601 throw new ArgumentNullException ("matrix");
603 Status status = GDIPlus.GdipTransformPath (nativePath, matrix.nativeMatrix);
604 GDIPlus.CheckStatus (status);
607 [MonoTODO ("StringFormat isn't supported inside libgdiplus")]
608 public void AddString (string s, FontFamily family, int style, float emSize, Point origin, StringFormat format)
610 Rectangle layout = new Rectangle ();
613 AddString (s, family, style, emSize, layout, format);
616 [MonoTODO ("StringFormat isn't supported inside libgdiplus")]
617 public void AddString (string s, FontFamily family, int style, float emSize, PointF origin, StringFormat format)
619 RectangleF layout = new RectangleF ();
622 AddString (s, family, style, emSize, layout, format);
625 [MonoTODO ("layoutRect and StringFormat aren't supported inside libgdiplus")]
626 public void AddString (string s, FontFamily family, int style, float emSize, Rectangle layoutRect, StringFormat format)
629 throw new ArgumentException ("family");
631 IntPtr sformat = (format == null) ? IntPtr.Zero : format.NativeObject;
632 // note: the NullReferenceException on s.Length is the expected (MS) exception
633 Status status = GDIPlus.GdipAddPathStringI (nativePath, s, s.Length, family.NativeObject, style, emSize, ref layoutRect, sformat);
634 GDIPlus.CheckStatus (status);
637 [MonoTODO ("layoutRect and StringFormat aren't supported inside libgdiplus")]
638 public void AddString (string s, FontFamily family, int style, float emSize, RectangleF layoutRect, StringFormat format)
641 throw new ArgumentException ("family");
643 IntPtr sformat = (format == null) ? IntPtr.Zero : format.NativeObject;
644 // note: the NullReferenceException on s.Length is the expected (MS) exception
645 Status status = GDIPlus.GdipAddPathString (nativePath, s, s.Length, family.NativeObject, style, emSize, ref layoutRect, sformat);
646 GDIPlus.CheckStatus (status);
649 public void ClearMarkers()
651 Status s = GDIPlus.GdipClearPathMarkers (nativePath);
653 GDIPlus.CheckStatus (s);
656 public void CloseAllFigures()
658 Status s = GDIPlus.GdipClosePathFigures (nativePath);
660 GDIPlus.CheckStatus (s);
663 public void CloseFigure()
665 Status s = GDIPlus.GdipClosePathFigure (nativePath);
667 GDIPlus.CheckStatus (s);
670 public void Flatten ()
672 Flatten (null, FlatnessDefault);
675 public void Flatten (Matrix matrix)
677 Flatten (matrix, FlatnessDefault);
680 public void Flatten (Matrix matrix, float flatness)
682 IntPtr m = (matrix == null) ? IntPtr.Zero : matrix.nativeMatrix;
683 Status status = GDIPlus.GdipFlattenPath (nativePath, m, flatness);
685 GDIPlus.CheckStatus (status);
688 public RectangleF GetBounds ()
690 return GetBounds (null, null);
693 public RectangleF GetBounds (Matrix matrix)
695 return GetBounds (matrix, null);
698 public RectangleF GetBounds (Matrix matrix, Pen pen)
701 IntPtr m = (matrix == null) ? IntPtr.Zero : matrix.nativeMatrix;
702 IntPtr p = (pen == null) ? IntPtr.Zero : pen.nativeObject;
704 Status s = GDIPlus.GdipGetPathWorldBounds (nativePath, out retval, m, p);
706 GDIPlus.CheckStatus (s);
711 public bool IsOutlineVisible (Point point, Pen pen)
713 return IsOutlineVisible (point.X, point.Y, pen, null);
716 public bool IsOutlineVisible (PointF point, Pen pen)
718 return IsOutlineVisible (point.X, point.Y, pen, null);
721 public bool IsOutlineVisible (int x, int y, Pen pen)
723 return IsOutlineVisible (x, y, pen, null);
726 public bool IsOutlineVisible (float x, float y, Pen pen)
728 return IsOutlineVisible (x, y, pen, null);
731 [MonoTODO ("Graphics parameter is currently ignored in libgdiplus")]
732 public bool IsOutlineVisible (Point pt, Pen pen, Graphics graphics)
734 return IsOutlineVisible (pt.X, pt.Y, pen, graphics);
737 [MonoTODO ("Graphics parameter is currently ignored in libgdiplus")]
738 public bool IsOutlineVisible (PointF pt, Pen pen, Graphics graphics)
740 return IsOutlineVisible (pt.X, pt.Y, pen, graphics);
743 [MonoTODO ("Graphics parameter is currently ignored in libgdiplus")]
744 public bool IsOutlineVisible (int x, int y, Pen pen, Graphics graphics)
747 throw new ArgumentNullException ("pen");
750 IntPtr g = (graphics == null) ? IntPtr.Zero : graphics.nativeObject;
752 Status s = GDIPlus.GdipIsOutlineVisiblePathPointI (nativePath, x, y, pen.nativeObject, g, out result);
753 GDIPlus.CheckStatus (s);
758 [MonoTODO ("Graphics parameter is currently ignored in libgdiplus")]
759 public bool IsOutlineVisible (float x, float y, Pen pen, Graphics graphics)
762 throw new ArgumentNullException ("pen");
765 IntPtr g = (graphics == null) ? IntPtr.Zero : graphics.nativeObject;
767 Status s = GDIPlus.GdipIsOutlineVisiblePathPoint (nativePath, x, y, pen.nativeObject, g, out result);
768 GDIPlus.CheckStatus (s);
773 public bool IsVisible (Point point)
775 return IsVisible (point.X, point.Y, null);
778 public bool IsVisible (PointF point)
780 return IsVisible (point.X, point.Y, null);
783 public bool IsVisible (int x, int y)
785 return IsVisible (x, y, null);
788 public bool IsVisible (float x, float y)
790 return IsVisible (x, y, null);
793 [MonoTODO ("Graphics parameter is currently ignored in libgdiplus")]
794 public bool IsVisible (Point pt, Graphics graphics)
796 return IsVisible (pt.X, pt.Y, graphics);
799 [MonoTODO ("Graphics parameter is currently ignored in libgdiplus")]
800 public bool IsVisible (PointF pt, Graphics graphics)
802 return IsVisible (pt.X, pt.Y, graphics);
805 [MonoTODO ("Graphics parameter is currently ignored in libgdiplus")]
806 public bool IsVisible (int x, int y, Graphics graphics)
810 IntPtr g = (graphics == null) ? IntPtr.Zero : graphics.nativeObject;
812 Status s = GDIPlus.GdipIsVisiblePathPointI (nativePath, x, y, g, out retval);
814 GDIPlus.CheckStatus (s);
819 [MonoTODO ("Graphics parameter is currently ignored in libgdiplus")]
820 public bool IsVisible (float x, float y, Graphics graphics)
824 IntPtr g = (graphics == null) ? IntPtr.Zero : graphics.nativeObject;
826 Status s = GDIPlus.GdipIsVisiblePathPoint (nativePath, x, y, g, out retval);
828 GDIPlus.CheckStatus (s);
833 public void SetMarkers ()
835 Status s = GDIPlus.GdipSetPathMarker (nativePath);
837 GDIPlus.CheckStatus (s);
840 public void StartFigure()
842 Status s = GDIPlus.GdipStartPathFigure (nativePath);
844 GDIPlus.CheckStatus (s);
847 [MonoTODO ("GdipWarpPath isn't implemented in libgdiplus")]
848 public void Warp (PointF[] destPoints, RectangleF srcRect)
850 Warp (destPoints, srcRect, null, WarpMode.Perspective, FlatnessDefault);
853 [MonoTODO ("GdipWarpPath isn't implemented in libgdiplus")]
854 public void Warp (PointF[] destPoints, RectangleF srcRect, Matrix matrix)
856 Warp (destPoints, srcRect, matrix, WarpMode.Perspective, FlatnessDefault);
859 [MonoTODO ("GdipWarpPath isn't implemented in libgdiplus")]
860 public void Warp (PointF[] destPoints, RectangleF srcRect, Matrix matrix, WarpMode warpMode)
862 Warp (destPoints, srcRect, matrix, warpMode, FlatnessDefault);
865 [MonoTODO ("GdipWarpPath isn't implemented in libgdiplus")]
866 public void Warp (PointF[] destPoints, RectangleF srcRect, Matrix matrix, WarpMode warpMode, float flatness)
868 if (destPoints == null)
869 throw new ArgumentNullException ("destPoints");
871 IntPtr m = (matrix == null) ? IntPtr.Zero : matrix.nativeMatrix;
873 Status s = GDIPlus.GdipWarpPath (nativePath, m, destPoints, destPoints.Length,
874 srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, warpMode, flatness);
876 GDIPlus.CheckStatus (s);
879 [MonoTODO ("GdipWidenPath isn't implemented in libgdiplus")]
880 public void Widen (Pen pen)
882 Widen (pen, null, FlatnessDefault);
885 [MonoTODO ("GdipWidenPath isn't implemented in libgdiplus")]
886 public void Widen (Pen pen, Matrix matrix)
888 Widen (pen, matrix, FlatnessDefault);
891 [MonoTODO ("GdipWidenPath isn't implemented in libgdiplus")]
892 public void Widen (Pen pen, Matrix matrix, float flatness)
895 throw new ArgumentNullException ("pen");
900 IntPtr m = (matrix == null) ? IntPtr.Zero : matrix.nativeMatrix;
902 Status s = GDIPlus.GdipWidenPath (nativePath, pen.nativeObject, m, flatness);
903 GDIPlus.CheckStatus (s);