merge -r 53370:58178
[mono.git] / mcs / class / System.Drawing / System.Drawing.Drawing2D / GraphicsPath.cs
1 //
2 // System.Drawing.Drawing2D.GraphicsPath.cs
3 //
4 // Authors:
5 //
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 //
11 //
12 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
13 //
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:
21 // 
22 // The above copyright notice and this permission notice shall be
23 // included in all copies or substantial portions of the Software.
24 // 
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.
32 //
33
34 using System;
35 using System.Drawing;
36 using System.Runtime.InteropServices;
37
38 namespace System.Drawing.Drawing2D
39 {
40         public sealed class GraphicsPath : MarshalByRefObject, ICloneable, IDisposable
41         {
42                 internal IntPtr nativePath = IntPtr.Zero;
43
44                 GraphicsPath (IntPtr ptr)
45                 {
46                         nativePath = ptr;
47                 }
48
49                 public GraphicsPath ()
50                 {
51                         Status status = GDIPlus.GdipCreatePath (FillMode.Alternate, out nativePath);
52                         GDIPlus.CheckStatus (status);
53                 }
54
55                 public GraphicsPath (FillMode fillMode)
56                 {
57                         Status status = GDIPlus.GdipCreatePath (fillMode, out nativePath);
58                         GDIPlus.CheckStatus (status);
59                 }
60
61                 public GraphicsPath (Point[] pts, byte[] types)
62                 {
63                         Status status;
64                         if (pts.Length != types.Length)
65                                 throw new ArgumentException ("Invalid parameter passed. Number of points and types must be same.");
66
67                         status = GDIPlus.GdipCreatePath2I (pts, types, pts.Length, FillMode.Alternate, out nativePath);
68                         GDIPlus.CheckStatus (status);
69                 }
70
71                 public GraphicsPath (PointF[] pts, byte[] types)
72                 {
73                         Status status;
74                         if (pts.Length != types.Length)
75                                 throw new ArgumentException ("Invalid parameter passed. Number of points and types must be same.");
76
77                         status = GDIPlus.GdipCreatePath2 (pts, types, pts.Length, FillMode.Alternate, out nativePath);
78                         GDIPlus.CheckStatus (status);
79                 }
80
81                 public GraphicsPath (Point[] pts, byte[] types, FillMode fillMode)
82                 {
83                         Status status;
84                         if (pts.Length != types.Length)
85                                 throw new ArgumentException ("Invalid parameter passed. Number of points and types must be same.");
86
87                         status = GDIPlus.GdipCreatePath2I (pts, types, pts.Length, fillMode, out nativePath);
88                         GDIPlus.CheckStatus (status);
89                 }
90
91                 public GraphicsPath (PointF[] pts, byte[] types, FillMode fillMode)
92                 {
93                         Status status;
94                         if (pts.Length != types.Length)
95                                 throw new ArgumentException ("Invalid parameter passed. Number of points and types must be same.");
96
97                         status = GDIPlus.GdipCreatePath2 (pts, types, pts.Length, fillMode, out nativePath);
98                         GDIPlus.CheckStatus (status);
99                 }
100         
101                 public object Clone ()
102                 {
103                         IntPtr clone;
104
105                         Status status = GDIPlus.GdipClonePath (nativePath, out clone);
106                         GDIPlus.CheckStatus (status);                           
107
108                         return new GraphicsPath (clone);
109                 }
110
111                 public void Dispose ()
112                 {
113                         Dispose (true);
114                         System.GC.SuppressFinalize (this);
115                 }
116
117                 ~GraphicsPath ()
118                 {
119                         Dispose (false);
120                 }
121                 
122                 void Dispose (bool disposing)
123                 {
124                         Status status;
125                         if (nativePath != IntPtr.Zero) {
126                                 status = GDIPlus.GdipDeletePath (nativePath);
127                                 GDIPlus.CheckStatus (status);
128
129                                 nativePath = IntPtr.Zero;
130                         }
131                 }
132
133                 public FillMode FillMode {
134                         get {
135                                 FillMode mode;
136                                 Status status = GDIPlus.GdipGetPathFillMode (nativePath, out mode);
137                                 GDIPlus.CheckStatus (status);
138
139                                 return mode;
140                         }
141                         set {
142                                 Status status = GDIPlus.GdipSetPathFillMode (nativePath, value);
143                                 GDIPlus.CheckStatus (status);
144                         }
145                 }
146
147                 public PathData PathData {
148                         get {
149                                 PathData pdata = new PathData ();
150                                 pdata.Points = PathPoints;
151                                 pdata.Types = PathTypes;
152                                 return pdata;
153                         }
154                 }
155
156                 public PointF [] PathPoints {
157                         get {
158                                 int count;
159                                 Status status = GDIPlus.GdipGetPointCount (nativePath, out count);
160                                 GDIPlus.CheckStatus (status);
161
162                                 PointF [] points = new PointF [count];
163                                 status = GDIPlus.GdipGetPathPoints (nativePath, points, count); 
164                                 GDIPlus.CheckStatus (status);                   
165
166                                 return points;
167                         }
168                 }
169
170                 public byte [] PathTypes {
171                         get {
172                                 int count;
173                                 Status status = GDIPlus.GdipGetPointCount (nativePath, out count);
174                                 GDIPlus.CheckStatus (status);
175
176                                 byte [] types = new byte [count];
177                                 status = GDIPlus.GdipGetPathTypes (nativePath, types, count);
178                                 GDIPlus.CheckStatus (status);
179
180                                 return types;
181                         }
182                 }
183
184                 public int PointCount {
185                         get {
186                                 int count;
187                                 Status status = GDIPlus.GdipGetPointCount (nativePath, out count);
188                                 GDIPlus.CheckStatus (status);
189
190                                 return count;
191                         }
192                 }
193
194                 internal IntPtr NativeObject {
195                         get {
196                                 return nativePath;
197                         }
198                         set {
199                                 nativePath = value;
200                         }
201                 }
202
203                 //
204                 // AddArc
205                 //
206                 public void AddArc (Rectangle rect, float start_angle, float sweep_angle)
207                 {
208                         Status status = GDIPlus.GdipAddPathArcI (nativePath, rect.X, rect.Y, rect.Width, rect.Height, start_angle, sweep_angle);
209                         GDIPlus.CheckStatus (status);                           
210                 }
211
212                 public void AddArc (RectangleF rect, float start_angle, float sweep_angle)
213                 {
214                         Status status = GDIPlus.GdipAddPathArc (nativePath, rect.X, rect.Y, rect.Width, rect.Height, start_angle, sweep_angle);
215                         GDIPlus.CheckStatus (status);                           
216                 }
217
218                 public void AddArc (int x, int y, int width, int height, float start_angle, float sweep_angle)
219                 {
220                         Status status = GDIPlus.GdipAddPathArcI (nativePath, x, y, width, height, start_angle, sweep_angle);
221                         GDIPlus.CheckStatus (status);                           
222                 }
223
224                 public void AddArc (float x, float y, float width, float height, float start_angle, float sweep_angle)
225                 {
226                         Status status = GDIPlus.GdipAddPathArc (nativePath, x, y, width, height, start_angle, sweep_angle);
227                         GDIPlus.CheckStatus (status);                           
228                 }
229
230                 //
231                 // AddBezier
232                 //
233                 public void AddBezier (Point pt1, Point pt2, Point pt3, Point pt4)
234                 {
235                         Status status = GDIPlus.GdipAddPathBezierI (nativePath, pt1.X, pt1.Y,
236                                         pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y);
237                                         
238                         GDIPlus.CheckStatus (status);                                                                         
239                 }
240
241                 public void AddBezier (PointF pt1, PointF pt2, PointF pt3, PointF pt4)
242                 {
243                         Status status = GDIPlus.GdipAddPathBezier (nativePath, pt1.X, pt1.Y,
244                                         pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y);
245                                         
246                         GDIPlus.CheckStatus (status);                                                                  
247                 }
248
249                 public void AddBezier (int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
250                 {
251                         Status status = GDIPlus.GdipAddPathBezierI (nativePath, x1, y1, x2, y2, x3, y3, x4, y4);
252                         GDIPlus.CheckStatus (status);                           
253                 }
254
255                 public void AddBezier (float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
256                 {
257                         Status status = GDIPlus.GdipAddPathBezier (nativePath, x1, y1, x2, y2, x3, y3, x4, y4);
258                         GDIPlus.CheckStatus (status);                           
259                 }
260
261                 //
262                 // AddBeziers
263                 //
264                 public void AddBeziers (Point [] pts)
265                 {
266                         Status status = GDIPlus.GdipAddPathBeziersI (nativePath, pts, pts.Length);
267                         GDIPlus.CheckStatus (status);                           
268                 }
269
270                 public void AddBeziers (PointF [] pts)
271                 {
272                         Status status = GDIPlus.GdipAddPathBeziers (nativePath, pts, pts.Length);
273                         GDIPlus.CheckStatus (status);                           
274                 }
275
276                 //
277                 // AddEllipse
278                 //
279                 public void AddEllipse (RectangleF r)
280                 {
281                         Status status = GDIPlus.GdipAddPathEllipse (nativePath, r.X, r.Y, r.Width, r.Height);
282                         GDIPlus.CheckStatus (status);                           
283                 }
284                 
285                 public void AddEllipse (float x, float y, float width, float height)
286                 {
287                         Status status = GDIPlus.GdipAddPathEllipse (nativePath, x, y, width, height);
288                         GDIPlus.CheckStatus (status);                           
289                 }
290
291                 public void AddEllipse (Rectangle r)
292                 {
293                         Status status = GDIPlus.GdipAddPathEllipseI (nativePath, r.X, r.Y, r.Width, r.Height);
294                         GDIPlus.CheckStatus (status);                           
295                 }
296                 
297                 public void AddEllipse (int x, int y, int width, int height)
298                 {
299                         Status status = GDIPlus.GdipAddPathEllipseI (nativePath, x, y, width, height);
300                         GDIPlus.CheckStatus (status);                           
301                 }
302                 
303
304                 //
305                 // AddLine
306                 //
307                 public void AddLine (Point a, Point b)
308                 {
309                         Status status = GDIPlus.GdipAddPathLineI (nativePath, a.X, a.Y, b.X, b.Y);
310                         GDIPlus.CheckStatus (status);                           
311                 }
312
313                 public void AddLine (PointF a, PointF b)
314                 {
315                         Status status = GDIPlus.GdipAddPathLine (nativePath, a.X, a.Y, b.X,
316                                         b.Y);
317                                         
318                         GDIPlus.CheckStatus (status);                                                                  
319                 }
320
321                 public void AddLine (int x1, int y1, int x2, int y2)
322                 {
323                         Status status = GDIPlus.GdipAddPathLineI (nativePath, x1, y1, x2, y2);
324                         GDIPlus.CheckStatus (status);                           
325                 }
326
327                 public void AddLine (float x1, float y1, float x2, float y2)
328                 {
329                         Status status = GDIPlus.GdipAddPathLine (nativePath, x1, y1, x2,
330                                         y2);                
331                                         
332                         GDIPlus.CheckStatus (status);                                                                  
333                 }
334
335                 //
336                 // AddLines
337                 //
338                 public void AddLines (Point [] points)
339                 {
340                         int length = points.Length;
341
342                         for (int i = 0; i < length - 1; i++) {
343                                 int j = i + 1;
344                                 Status status = GDIPlus.GdipAddPathLineI (
345                                         nativePath, points [i].X, points [i].Y, points [j].X, points [j].Y);
346                                 GDIPlus.CheckStatus (status);                           
347                         }
348                 }
349
350                 public void AddLines (PointF [] points)
351                 {
352                         int length = points.Length;
353
354                         for (int i = 0; i < length - 1; i++) {
355                                 int j = i + 1;
356                                 Status status = GDIPlus.GdipAddPathLine (
357                                         nativePath, points [i].X, points [i].Y, points [j].X, points [j].Y);
358                                 GDIPlus.CheckStatus (status);                           
359                         }
360                 }
361         
362                 //
363                 // AddPie
364                 //
365                 public void AddPie (Rectangle rect, float startAngle, float sweepAngle)
366                 {
367                         Status status = GDIPlus.GdipAddPathPie (
368                                 nativePath, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
369                         GDIPlus.CheckStatus (status);                           
370                 }
371
372                 public void AddPie (int x, int y, int width, int height, float startAngle, float sweepAngle)
373                 {
374                         Status status = GDIPlus.GdipAddPathPieI (nativePath, x, y, width, height, startAngle, sweepAngle);
375                         GDIPlus.CheckStatus (status);                           
376                 }
377
378                 public void AddPie (float x, float y, float width, float height, float startAngle, float sweepAngle)
379                 {
380                         Status status = GDIPlus.GdipAddPathPie (nativePath, x, y, width, height, startAngle, sweepAngle);                
381                         GDIPlus.CheckStatus (status);                           
382                 }
383
384                 //
385                 // AddPolygon
386                 //
387                 public void AddPolygon (Point [] points)
388                 {
389                         Status status = GDIPlus.GdipAddPathPolygonI (nativePath, points, points.Length);
390                         GDIPlus.CheckStatus (status);                           
391                 }
392
393                 public void AddPolygon (PointF [] points)
394                 {
395                         Status status = GDIPlus.GdipAddPathPolygon (nativePath, points, points.Length);
396                         GDIPlus.CheckStatus (status);                           
397                 }
398
399                 //
400                 // AddRectangle
401                 //
402                 public void AddRectangle (Rectangle rect)
403                 {
404                         Status status = GDIPlus.GdipAddPathRectangleI (nativePath, rect.X, rect.Y, rect.Width, rect.Height);
405                         GDIPlus.CheckStatus (status);                           
406                 }
407
408                 public void AddRectangle (RectangleF rect)
409                 {
410                         Status status = GDIPlus.GdipAddPathRectangle (nativePath, rect.X, rect.Y, rect.Width, rect.Height);
411                         GDIPlus.CheckStatus (status);                           
412                 }
413
414                 //
415                 // AddRectangles
416                 //
417                 public void AddRectangles (Rectangle [] rects)
418                 {
419                         Status status = GDIPlus.GdipAddPathRectanglesI (nativePath, rects, rects.Length);
420                         GDIPlus.CheckStatus (status);                           
421                 }
422
423                 public void AddRectangles (RectangleF [] rects)
424                 {
425                         Status status = GDIPlus.GdipAddPathRectangles (nativePath, rects, rects.Length);
426                         GDIPlus.CheckStatus (status);                           
427                 }
428
429                 //
430                 // AddPath
431                 //
432                 public void AddPath (GraphicsPath addingPath, bool connect)
433                 {
434                         Status status = GDIPlus.GdipAddPathPath (nativePath, addingPath.nativePath, connect);
435                         GDIPlus.CheckStatus (status);                           
436                 }
437
438                 public PointF GetLastPoint ()
439                 {
440                         PointF pt;
441                         Status status = GDIPlus.GdipGetPathLastPoint (nativePath, out pt);
442                         GDIPlus.CheckStatus (status);                           
443
444                         return pt;
445                 }
446
447                 //
448                 // AddClosedCurve
449                 //
450                 public void AddClosedCurve (Point [] points)
451                 {
452                         Status status = GDIPlus.GdipAddPathClosedCurveI (nativePath, points, points.Length);
453                         GDIPlus.CheckStatus (status);                           
454                 }
455
456                 public void AddClosedCurve (PointF [] points)
457                 {
458                         Status status = GDIPlus.GdipAddPathClosedCurve (nativePath, points, points.Length);
459                         GDIPlus.CheckStatus (status);                           
460                 }
461
462                 public void AddClosedCurve (Point [] points, float tension)
463                 {
464                         Status status = GDIPlus.GdipAddPathClosedCurve2I (nativePath, points, points.Length, tension);
465                         GDIPlus.CheckStatus (status);                           
466                 }
467
468                 public void AddClosedCurve (PointF [] points, float tension)
469                 {
470                         Status status = GDIPlus.GdipAddPathClosedCurve2 (nativePath, points, points.Length, tension);
471                         GDIPlus.CheckStatus (status);                           
472                 }
473
474                 //
475                 // AddCurve
476                 //
477                 public void AddCurve (Point [] points)
478                 {
479                         Status status = GDIPlus.GdipAddPathCurveI (nativePath, points, points.Length);
480                         GDIPlus.CheckStatus (status);                           
481                 }
482                 
483                 public void AddCurve (PointF [] points)
484                 {
485                         Status status = GDIPlus.GdipAddPathCurve (nativePath, points, points.Length);
486                         GDIPlus.CheckStatus (status);                           
487                 }
488                 
489                 public void AddCurve (Point [] points, float tension)
490                 {
491                         Status status = GDIPlus.GdipAddPathCurve2I (nativePath, points, points.Length, tension);
492                         GDIPlus.CheckStatus (status);                           
493                 }
494                 
495                 public void AddCurve (PointF [] points, float tension)
496                 {
497                         Status status = GDIPlus.GdipAddPathCurve2 (nativePath, points, points.Length, tension);
498                         GDIPlus.CheckStatus (status);                           
499                 }
500
501                 public void AddCurve (Point [] points, int offset, int numberOfSegments, float tension)
502                 {
503                         Status status = GDIPlus.GdipAddPathCurve3I (nativePath, points, points.Length,
504                                         offset, numberOfSegments, tension);
505                                         
506                         GDIPlus.CheckStatus (status);                                                                  
507                 }
508                 
509                 public void AddCurve (PointF [] points, int offset, int numberOfSegments, float tension)
510                 {
511                         Status status = GDIPlus.GdipAddPathCurve3 (nativePath, points, points.Length,
512                                         offset, numberOfSegments, tension);
513                                         
514                         GDIPlus.CheckStatus (status);                                                                  
515                 }
516                         
517                 public void Reset ()
518                 {
519                         Status status = GDIPlus.GdipResetPath (nativePath);
520                         GDIPlus.CheckStatus (status);                           
521                 }
522
523                 public void Reverse ()
524                 {
525                         Status status = GDIPlus.GdipReversePath (nativePath);
526                         GDIPlus.CheckStatus (status);                           
527                 }
528
529                 public void Transform (Matrix matrix)
530                 {
531                         Status status = GDIPlus.GdipTransformPath (nativePath, matrix.nativeMatrix);
532                         GDIPlus.CheckStatus (status);                           
533                 }
534                 
535                 [MonoTODO]
536                 public void AddString (string s, FontFamily family, int style,  float emSize,  Point origin,   StringFormat format)
537                 {
538                         throw new NotImplementedException ();
539                 }       
540                 
541                 [MonoTODO]
542                 public void AddString (string s,  FontFamily family,  int style,  float emSize,  PointF origin,   StringFormat format)
543                 {
544                         throw new NotImplementedException ();
545                 }       
546                 
547                 [MonoTODO]
548                 public void AddString (string s, FontFamily family, int style, float emSize,  Rectangle layoutRect, StringFormat format)
549                 {
550                         throw new NotImplementedException ();
551                 }       
552                 
553                 [MonoTODO]
554                 public void AddString (string s, FontFamily family, int style, float emSize,  RectangleF layoutRect,   StringFormat format)
555                 {
556                         throw new NotImplementedException ();
557                 }       
558                 
559                 public void ClearMarkers()               
560                 {
561                         Status s = GDIPlus.GdipClearPathMarkers (nativePath);
562
563                         GDIPlus.CheckStatus (s);
564                 }
565                 
566                 public void CloseAllFigures()
567                 {
568                         Status s = GDIPlus.GdipClosePathFigures (nativePath);
569
570                         GDIPlus.CheckStatus (s);
571                 }       
572                 
573                 public void CloseFigure()
574                 {
575                         Status s = GDIPlus.GdipClosePathFigure (nativePath);
576
577                         GDIPlus.CheckStatus (s);
578                 } 
579
580                 public void Flatten ()
581                 {
582                         // 1/4 is the FlatnessDefault as defined in GdiPlusEnums.h
583                         Flatten (null, 1.0f / 4.0f); 
584                 }       
585   
586                 public void Flatten (Matrix matrix)
587                 {
588                         Flatten (matrix, 1.0f / 4.0f);
589                 }
590                 
591                 public void Flatten (Matrix matrix, float flatness)
592                 {
593                         Status status = GDIPlus.GdipFlattenPath (nativePath, matrix.nativeMatrix, flatness);
594
595                         GDIPlus.CheckStatus (status);
596                 }               
597                 
598                 public RectangleF GetBounds ()
599                 {
600                         return GetBounds (null, null);
601                 }               
602
603                 public RectangleF GetBounds (Matrix matrix)
604                 {
605                         return GetBounds (matrix, null);
606                 }
607
608                 [MonoTODO]
609                 public RectangleF GetBounds (Matrix matrix, Pen pen)
610                 {
611                         RectangleF retval;
612                         IntPtr m = (matrix == null) ? IntPtr.Zero : matrix.nativeMatrix;
613                         IntPtr p = (pen == null) ? IntPtr.Zero : pen.nativeObject;
614                         
615                         Status s = GDIPlus.GdipGetPathWorldBounds (nativePath, out retval, m, p);
616
617                         GDIPlus.CheckStatus (s);
618
619                         return retval;
620                 }
621
622                 public bool IsOutlineVisible (Point point, Pen pen)
623                 {
624                         return IsOutlineVisible (point.X, point.Y, pen, null);
625                 }               
626                 
627                 public bool IsOutlineVisible (PointF point, Pen pen)
628                 {
629                         return IsOutlineVisible (point.X, point.Y, pen, null);
630                 } 
631                 
632                 public bool IsOutlineVisible (int x, int y, Pen pen)
633                 {
634                         return IsOutlineVisible (x, y, pen, null);
635                 }
636
637                 public bool IsOutlineVisible (float x, float y, Pen pen)
638                 {
639                         return IsOutlineVisible (x, y, pen, null);
640                 }               
641                 
642                 public bool IsOutlineVisible (Point pt, Pen pen, Graphics graphics)
643                 {
644                         return IsOutlineVisible (pt.X, pt.Y, pen, graphics);
645                 }               
646                 
647                 public bool IsOutlineVisible (PointF pt, Pen pen, Graphics graphics)
648                 {
649                         return IsOutlineVisible (pt.X, pt.Y, pen, graphics);
650                 }               
651                                 
652                 [MonoTODO]
653                 public bool IsOutlineVisible (int x, int y, Pen pen, Graphics graphics)
654                 {
655                         bool result;
656                         IntPtr g = (graphics == null) ? IntPtr.Zero : graphics.nativeObject;
657                         
658                         Status s = GDIPlus.GdipIsOutlineVisiblePathPointI (nativePath, x, y, g, out result);
659                         GDIPlus.CheckStatus (s);
660
661                         return result;
662                 }               
663
664                 [MonoTODO]
665                 public bool IsOutlineVisible (float x, float y, Pen pen, Graphics graphics)
666                 {
667                         bool result;
668                         IntPtr g = (graphics == null) ? IntPtr.Zero : graphics.nativeObject;
669                         
670                         Status s = GDIPlus.GdipIsOutlineVisiblePathPoint (nativePath, x, y, g, out result);
671                         GDIPlus.CheckStatus (s);
672
673                         return result;
674                 }               
675                 
676                 public bool IsVisible (Point point)
677                 {
678                         return IsVisible (point.X, point.Y, null);
679                 }               
680                 
681                 public bool IsVisible (PointF point)
682                 {
683                         return IsVisible (point.X, point.Y, null);
684                 }               
685                 
686                 public bool IsVisible (int x, int y)
687                 {
688                         return IsVisible (x, y, null);
689                 }
690
691                 public bool IsVisible (float x, float y)
692                 {
693                         return IsVisible (x, y, null);
694                 }                               
695                 
696                 public bool IsVisible (Point pt, Graphics graphics)
697                 {
698                         return IsVisible (pt.X, pt.Y, graphics);
699                 }               
700                 
701                 public bool IsVisible (PointF pt, Graphics graphics)
702                 {
703                         return IsVisible (pt.X, pt.Y, graphics);
704                 }               
705                                 
706                 [MonoTODO]
707                 public bool IsVisible (int x, int y, Graphics graphics)
708                 {
709                         bool retval;
710
711                         IntPtr g = (graphics == null) ? IntPtr.Zero : graphics.nativeObject;
712
713                         Status s = GDIPlus.GdipIsVisiblePathPointI (nativePath, x, y, g, out retval);
714
715                         GDIPlus.CheckStatus (s);
716
717                         return retval;
718                 }               
719                 
720                 [MonoTODO]
721                 public bool IsVisible (float x, float y, Graphics graphics)
722                 {
723                         bool retval;
724
725                         IntPtr g = (graphics == null) ? IntPtr.Zero : graphics.nativeObject;
726
727                         Status s = GDIPlus.GdipIsVisiblePathPoint (nativePath, x, y, g, out retval);
728
729                         GDIPlus.CheckStatus (s);
730
731                         return retval;
732                 }               
733                 
734                 public void SetMarkers ()
735                 {
736                         Status s = GDIPlus.GdipSetPathMarker (nativePath);
737
738                         GDIPlus.CheckStatus (s);
739                 }
740                 
741                 public void StartFigure()
742                 {
743                         Status s = GDIPlus.GdipStartPathFigure (nativePath);
744
745                         GDIPlus.CheckStatus (s);
746                 }               
747                 
748                 public void Warp (PointF[] destPoints, RectangleF srcRect)
749                 {
750                         Warp (destPoints, srcRect, null, WarpMode.Perspective, 1.0f / 4.0f);
751                 }               
752
753                 public void Warp (PointF[] destPoints, RectangleF srcRect, Matrix matrix)
754                 {
755                         Warp (destPoints, srcRect, matrix, WarpMode.Perspective, 1.0f / 4.0f);
756                 }               
757
758                 public void Warp (PointF[] destPoints, RectangleF srcRect, Matrix matrix, WarpMode warpMode)
759                 {
760                         Warp (destPoints, srcRect, matrix, warpMode, 1.0f / 4.0f);
761                 }               
762
763                 [MonoTODO]
764                 public void Warp (PointF[] destPoints, RectangleF srcRect, Matrix matrix,  WarpMode warpMode, float flatness)
765                 {
766                         IntPtr m = (matrix == null) ? IntPtr.Zero : matrix.nativeMatrix;
767
768                         Status s = GDIPlus.GdipWarpPath (nativePath, m, destPoints, destPoints.Length,
769                                         srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, warpMode, flatness);
770
771                         GDIPlus.CheckStatus (s);
772                 }
773                 
774                 public void Widen (Pen pen)
775                 {
776                         Widen (pen, null, 1.0f / 4.0f);
777                 }               
778                 
779                 public void Widen (Pen pen, Matrix matrix)
780                 {       
781                         Widen (pen, matrix, 1.0f / 4.0f);
782                 }               
783                 
784                 [MonoTODO]
785                 public void Widen (Pen pen, Matrix matrix, float flatness)
786                 {
787                         IntPtr p = (pen == null) ? IntPtr.Zero : pen.nativeObject;
788                         IntPtr m = (matrix == null) ? IntPtr.Zero : matrix.nativeMatrix;
789
790                         Status s = GDIPlus.GdipWidenPath (nativePath, p, m, flatness);
791
792                         GDIPlus.CheckStatus (s);
793                 } 
794         }
795 }
796
797