* Graphics.cs: fixed warning
[mono.git] / mcs / class / System.Drawing / System.Drawing / Graphics.cs
1 //
2 // System.Drawing.Graphics.cs
3 //
4 // (C) 2003 Ximian, Inc.  http://www.ximian.com
5 //
6 // Authors:
7 //      Gonzalo Paniagua Javier (gonzalo@ximian.com) (stubbed out)
8 //      Alexandre Pigolkine(pigolkine@gmx.de)
9 //              Jordi Mas i Hernandez (jordi@ximian.com)
10 //
11 using System;
12 using System.Drawing.Drawing2D;
13 using System.Drawing.Imaging;
14 using System.Drawing.Text;
15 using System.ComponentModel;
16 using System.Runtime.InteropServices;
17 using System.Text;
18
19 namespace System.Drawing
20 {
21         [ComVisible(false)]
22         public sealed class Graphics : MarshalByRefObject, IDisposable
23         {
24                 internal IntPtr nativeObject = IntPtr.Zero;
25
26                 private static float defDpiX = 0;
27                 private static float defDpiY = 0;
28         
29                 [ComVisible(false)]
30                 public delegate bool EnumerateMetafileProc (EmfPlusRecordType recordType,
31                                                             int flags,
32                                                             int dataSize,
33                                                             IntPtr data,
34                                                             PlayRecordCallback callbackData);
35                 
36                 [ComVisible (false)]
37                 public delegate bool DrawImageAbort (IntPtr callbackData);              
38                 
39                 private Graphics (IntPtr nativeGraphics)
40                 {
41                         if (nativeGraphics == IntPtr.Zero)
42                                 Console.WriteLine ("Here: " + Environment.StackTrace);
43                         nativeObject = nativeGraphics;
44                 }
45                 
46                 static internal float systemDpiX {
47                         get {                                   
48                                         if (defDpiX==0) {
49                                                 Bitmap bmp = new Bitmap(1,1);
50                                                 Graphics g = Graphics.FromImage(bmp);   
51                                         defDpiX = g.DpiX;
52                                 }
53                                 return defDpiX;
54                         }
55                 }
56
57                 static internal float systemDpiY {
58                         get {
59                                         if (defDpiY==0) {
60                                                 Bitmap bmp = new Bitmap(1,1);
61                                                 Graphics g = Graphics.FromImage(bmp);   
62                                         defDpiY = g.DpiY;
63                                 }
64                                 return defDpiY;
65                         }
66                 }
67                 
68                 internal IntPtr NativeObject {
69                         get{
70                                 return nativeObject;
71                         }
72
73                         set {
74                                 nativeObject = value;
75                         }
76                 }
77
78                 [MonoTODO]
79                 public void AddMetafileComment (byte [] data)
80                 {
81                         throw new NotImplementedException ();
82                 }
83
84                 
85                 public GraphicsContainer BeginContainer ()
86                 {
87                         int state;
88                         Status status;
89                         status = GDIPlus.GdipBeginContainer2 (nativeObject, out state);
90                         GDIPlus.CheckStatus (status);
91
92                         return new GraphicsContainer(state);
93                 }
94                 
95                 public GraphicsContainer BeginContainer (Rectangle dstrect, Rectangle srcrect, GraphicsUnit unit)
96                 {
97                         int state;
98                         Status status;
99                         status = GDIPlus.GdipBeginContainerI (nativeObject, dstrect, srcrect, unit, out state);
100                         GDIPlus.CheckStatus (status);
101
102                         return new GraphicsContainer (state);
103                 }
104
105                 
106                 public GraphicsContainer BeginContainer (RectangleF dstrect, RectangleF srcrect, GraphicsUnit unit)
107                 {
108                         int state;
109                         Status status;
110                         status = GDIPlus.GdipBeginContainer (nativeObject, dstrect, srcrect, unit, out state);
111                         GDIPlus.CheckStatus (status);
112
113                         return new GraphicsContainer (state);
114                 }
115
116                 
117                 public void Clear (Color color)
118                 {
119                         Status status;
120                         status = GDIPlus.GdipGraphicsClear (nativeObject, color.ToArgb ());                             GDIPlus.CheckStatus (status);
121                 }
122
123                 [MonoTODO]
124                 public void Dispose ()
125                 {
126                 }
127
128                 
129                 public void DrawArc (Pen pen, Rectangle rect, float startAngle, float sweepAngle)
130                 {
131                         DrawArc (pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
132                 }
133
134                 
135                 public void DrawArc (Pen pen, RectangleF rect, float startAngle, float sweepAngle)
136                 {
137                         DrawArc (pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
138                 }
139
140                 
141                 public void DrawArc (Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)
142                 {
143                         Status status;
144                         status = GDIPlus.GdipDrawArc (nativeObject, pen.nativeObject,
145                                         x, y, width, height, startAngle, sweepAngle);
146                         GDIPlus.CheckStatus (status);
147                 }
148
149                 // Microsoft documentation states that the signature for this member should be
150                 // public void DrawArc( Pen pen,  int x,  int y,  int width,  int height,   int startAngle,
151                 // int sweepAngle. However, GdipDrawArcI uses also float for the startAngle and sweepAngle params
152                 public void DrawArc (Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle)
153                 {
154                         Status status;
155                         status = GDIPlus.GdipDrawArcI (nativeObject, pen.nativeObject,
156                                                 x, y, width, height, startAngle, sweepAngle);
157                         GDIPlus.CheckStatus (status);
158                 }
159
160                 public void DrawBezier (Pen pen, PointF pt1, PointF pt2, PointF pt3, PointF pt4)
161                 {
162                         Status status;
163                         status = GDIPlus.GdipDrawBezier (nativeObject, pen.nativeObject,
164                                                         pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X,
165                                                         pt3.Y, pt4.X, pt4.Y);
166                         GDIPlus.CheckStatus (status);
167                 }
168
169                 public void DrawBezier (Pen pen, Point pt1, Point pt2, Point pt3, Point pt4)
170                 {
171                         Status status;
172                         status = GDIPlus.GdipDrawBezierI (nativeObject, pen.nativeObject,
173                                                         pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X,
174                                                         pt3.Y, pt4.X, pt4.Y);
175                         GDIPlus.CheckStatus (status);
176                 }
177
178                 public void DrawBezier (Pen pen, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
179                 {
180                         Status status;
181                         status = GDIPlus.GdipDrawBezier (nativeObject, pen.nativeObject, x1,
182                                                         y1, x2, y2, x3, y3, x4, y4);
183                         GDIPlus.CheckStatus (status);
184                 }
185
186                 public void DrawBeziers (Pen pen, Point [] points)
187                 {
188                         int length = points.Length;
189                         Status status;
190
191                         if (length < 3)
192                                 return;
193
194                         for (int i = 0; i < length; i += 3) {
195                                 Point p1 = points [i];
196                                 Point p2 = points [i + 1];
197                                 Point p3 = points [i + 2];
198                                 Point p4 = points [i + 3];
199
200                                 status = GDIPlus.GdipDrawBezier (nativeObject, 
201                                                         pen.nativeObject,
202                                                         p1.X, p1.Y, p2.X, p2.Y, 
203                                                         p3.X, p3.Y, p4.X, p4.Y);
204                                 GDIPlus.CheckStatus (status);
205                         }
206                 }
207
208                 public void DrawBeziers (Pen pen, PointF [] points)
209                 {
210                         int length = points.Length;
211                         Status status;
212
213                         if (length < 3)
214                                 return;
215
216                         for (int i = 0; i < length; i += 3) {
217                                 PointF p1 = points [i];
218                                 PointF p2 = points [i + 1];
219                                 PointF p3 = points [i + 2];
220                                 PointF p4 = points [i + 3];
221
222                                 status = GDIPlus.GdipDrawBezier (nativeObject, 
223                                                         pen.nativeObject,
224                                                         p1.X, p1.Y, p2.X, p2.Y, 
225                                                         p3.X, p3.Y, p4.X, p4.Y);
226                                 GDIPlus.CheckStatus (status);
227                         }
228                 }
229
230                 
231                 public void DrawClosedCurve (Pen pen, PointF [] points)
232                 {
233                         Status status;
234                         status = GDIPlus.GdipDrawClosedCurve (nativeObject, pen.nativeObject, points, points.Length);
235                         GDIPlus.CheckStatus (status);
236                 }
237                 
238                 public void DrawClosedCurve (Pen pen, Point [] points)
239                 {
240                         Status status;
241                         status = GDIPlus.GdipDrawClosedCurveI (nativeObject, pen.nativeObject, points, points.Length);
242                         GDIPlus.CheckStatus (status);
243                 }
244                         
245                 public void DrawClosedCurve (Pen pen, Point [] points, float tension, FillMode fillmode)
246                 {
247                         Status status;
248                         status = GDIPlus.GdipDrawClosedCurve2I (nativeObject, pen.nativeObject, points, points.Length, tension);
249                         GDIPlus.CheckStatus (status);
250                 }
251                 
252                 public void DrawClosedCurve (Pen pen, PointF [] points, float tension, FillMode fillmode)
253                 {
254                         Status status;
255                         status = GDIPlus.GdipDrawClosedCurve2 (nativeObject, pen.nativeObject, points, points.Length, tension);
256                         GDIPlus.CheckStatus (status);
257                 }
258                 
259                 public void DrawCurve (Pen pen, Point [] points)
260                 {
261                         Status status;
262                         status = GDIPlus.GdipDrawCurveI (nativeObject, pen.nativeObject, points, points.Length);
263                         GDIPlus.CheckStatus (status);
264                 }
265                 
266                 public void DrawCurve (Pen pen, PointF [] points)
267                 {
268                         Status status;
269                         status = GDIPlus.GdipDrawCurve (nativeObject, pen.nativeObject, points, points.Length);
270                         GDIPlus.CheckStatus (status);
271                 }
272                 
273                 public void DrawCurve (Pen pen, PointF [] points, float tension)
274                 {
275                         Status status;
276                         status = GDIPlus.GdipDrawCurve2 (nativeObject, pen.nativeObject, points, points.Length, tension);
277                         GDIPlus.CheckStatus (status);
278                 }
279                 
280                 public void DrawCurve (Pen pen, Point [] points, float tension)
281                 {
282                         Status status;
283                         status = GDIPlus.GdipDrawCurve2I (nativeObject, pen.nativeObject, points, points.Length, tension);              
284                         GDIPlus.CheckStatus (status);
285                 }
286                 
287                 
288                 public void DrawCurve (Pen pen, PointF [] points, int offset, int numberOfSegments)
289                 {
290                         Status status;
291                         status = GDIPlus.GdipDrawCurve3 (nativeObject, pen.nativeObject,
292                                                         points, points.Length, offset,
293                                                         numberOfSegments, 0.5f);
294                         GDIPlus.CheckStatus (status);
295                 }
296
297                 public void DrawCurve (Pen pen, Point [] points, int offset, int numberOfSegments, float tension)
298                 {
299                         Status status;
300                         status = GDIPlus.GdipDrawCurve3I (nativeObject, pen.nativeObject,
301                                                         points, points.Length, offset,
302                                                         numberOfSegments, tension);
303                         GDIPlus.CheckStatus (status);
304                 }
305
306                 
307                 public void DrawCurve (Pen pen, PointF [] points, int offset, int numberOfSegments, float tension)
308                 {
309                         Status status;
310                         status = GDIPlus.GdipDrawCurve3 (nativeObject, pen.nativeObject,
311                                                         points, points.Length, offset,
312                                                         numberOfSegments, tension);
313                         GDIPlus.CheckStatus (status);
314                 }
315
316                 public void DrawEllipse (Pen pen, Rectangle rect)
317                 {
318                         DrawEllipse (pen, rect.X, rect.Y, rect.Width, rect.Height);
319                 }
320
321                 public void DrawEllipse (Pen pen, RectangleF rect)
322                 {
323                         DrawEllipse (pen, rect.X, rect.Y, rect.Width, rect.Height);
324                 }
325
326                 public void DrawEllipse (Pen pen, int x, int y, int width, int height)
327                 {
328                         Status status;
329                         status = GDIPlus.GdipDrawEllipseI (nativeObject, pen.nativeObject, x, y, width, height);
330                         GDIPlus.CheckStatus (status);
331                 }
332
333                 public void DrawEllipse (Pen pen, float x, float y, float width, float height)
334                 {
335                         Status status = GDIPlus.GdipDrawEllipse (nativeObject, pen.nativeObject, x, y, width, height);
336                         GDIPlus.CheckStatus (status);
337                 }
338
339                 [MonoTODO]
340                 public void DrawIcon (Icon icon, Rectangle targetRect)
341                 {
342                         throw new NotImplementedException ();
343                 }
344
345                 [MonoTODO]
346                 public void DrawIcon (Icon icon, int x, int y)
347                 {
348                         throw new NotImplementedException ();
349                 }
350
351                 [MonoTODO]
352                 public void DrawIconUnstretched (Icon icon, Rectangle targetRect)
353                 {
354                         throw new NotImplementedException ();
355                 }
356                 
357                 public void DrawImage (Image image, RectangleF rect)
358                 {
359                         Status status = GDIPlus.GdipDrawImageRect(nativeObject, image.NativeObject, rect.X, rect.Y, rect.Width, rect.Height);
360                         GDIPlus.CheckStatus (status);
361                 }
362
363                 
364                 public void DrawImage (Image image, PointF point)
365                 {
366                         Status status = GDIPlus.GdipDrawImage (nativeObject, image.NativeObject, point.X, point.Y);
367                         GDIPlus.CheckStatus (status);
368                 }
369
370                 
371                 public void DrawImage (Image image, Point [] destPoints)
372                 {
373                         Status status = GDIPlus.GdipDrawImagePointsI (nativeObject, image.NativeObject, destPoints, destPoints.Length);
374                         GDIPlus.CheckStatus (status);
375                 }
376
377                 
378                 public void DrawImage (Image image, Point point)
379                 {
380                         DrawImage (image, point.X, point.Y);
381                 }
382
383                 
384                 public void DrawImage (Image image, Rectangle rect)
385                 {
386                         DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height);
387                 }
388
389                 
390                 public void DrawImage (Image image, PointF [] destPoints)
391                 {
392                         Status status = GDIPlus.GdipDrawImagePoints (nativeObject, image.NativeObject, destPoints, destPoints.Length);
393                         GDIPlus.CheckStatus (status);
394                 }
395
396                 
397                 public void DrawImage (Image image, int x, int y)
398                 {
399                         Status status = GDIPlus.GdipDrawImageI (nativeObject, image.NativeObject, x, y);
400                         GDIPlus.CheckStatus (status);
401                 }
402
403                 
404                 public void DrawImage (Image image, float x, float y)
405                 {
406                         Status status = GDIPlus.GdipDrawImage (nativeObject, image.NativeObject, x, y);
407                         GDIPlus.CheckStatus (status);
408                 }
409
410                 
411                 public void DrawImage (Image image, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit)
412                 {
413                         Status status = GDIPlus.GdipDrawImageRectRectI (nativeObject, image.NativeObject,
414                                 destRect.X, destRect.Y, destRect.Width, destRect.Height,
415                                 srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height,
416                                 srcUnit, IntPtr.Zero, null, IntPtr.Zero);
417                         GDIPlus.CheckStatus (status);
418                 }
419                 
420                 public void DrawImage (Image image, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit)
421                 {                       
422                         Status status = GDIPlus.GdipDrawImageRectRect (nativeObject, image.NativeObject,
423                                 destRect.X, destRect.Y, destRect.Width, destRect.Height,
424                                 srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height,
425                                 srcUnit, IntPtr.Zero, null, IntPtr.Zero);
426                         GDIPlus.CheckStatus (status);
427                 }
428
429                 
430                 public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit)
431                 {
432                         Status status = GDIPlus.GdipDrawImagePointsRectI (nativeObject, image.NativeObject,
433                                 destPoints, destPoints.Length , srcRect.X, srcRect.Y, 
434                                 srcRect.Width, srcRect.Height, srcUnit, IntPtr.Zero, 
435                                 null, IntPtr.Zero);
436                         GDIPlus.CheckStatus (status);
437                 }
438
439                 
440                 public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit)
441                 {
442                         
443                         Status status = GDIPlus.GdipDrawImagePointsRect (nativeObject, image.NativeObject,
444                                 destPoints, destPoints.Length , srcRect.X, srcRect.Y, 
445                                 srcRect.Width, srcRect.Height, srcUnit, IntPtr.Zero, 
446                                 null, IntPtr.Zero);
447                         GDIPlus.CheckStatus (status);
448                 }
449
450                 
451                 public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, 
452                                 ImageAttributes imageAttr)
453                 {
454                         Status status = GDIPlus.GdipDrawImagePointsRectI (nativeObject, image.NativeObject,
455                                 destPoints, destPoints.Length , srcRect.X, srcRect.Y,
456                                 srcRect.Width, srcRect.Height, srcUnit,
457                                 imageAttr.NativeObject, null, IntPtr.Zero);
458                         GDIPlus.CheckStatus (status);
459                 }
460                 
461                 public void DrawImage (Image image, float x, float y, float width, float height)
462                 {
463                         Status status = GDIPlus.GdipDrawImageRect(nativeObject, image.NativeObject, x, y,
464                            width, height);
465                         GDIPlus.CheckStatus (status);
466                 }
467
468                 
469                 public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, 
470                                 ImageAttributes imageAttr)
471                 {
472                         Status status = GDIPlus.GdipDrawImagePointsRect (nativeObject, image.NativeObject,
473                                 destPoints, destPoints.Length , srcRect.X, srcRect.Y,
474                                 srcRect.Width, srcRect.Height, srcUnit, 
475                                 imageAttr.NativeObject, null, IntPtr.Zero);
476                         GDIPlus.CheckStatus (status);
477                 }
478
479                 
480                 public void DrawImage (Image image, int x, int y, Rectangle srcRect, GraphicsUnit srcUnit)
481                 {                       
482                         Status status = GDIPlus.GdipDrawImagePointRectI(nativeObject, image.NativeObject, x, y, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit);
483                         GDIPlus.CheckStatus (status);
484                 }
485                 
486                 public void DrawImage (Image image, int x, int y, int width, int height)
487                 {
488                         Status status = GDIPlus.GdipDrawImageRectI (nativeObject, image.nativeObject, x, y, width, height);
489                         GDIPlus.CheckStatus (status);
490                 }
491
492                 public void DrawImage (Image image, float x, float y, RectangleF srcRect, GraphicsUnit srcUnit)
493                 {                       
494                         Status status = GDIPlus.GdipDrawImagePointRect (nativeObject, image.nativeObject, x, y, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit);
495                         GDIPlus.CheckStatus (status);
496                 }
497
498                 
499                 public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
500                 {
501                         Status status = GDIPlus.GdipDrawImagePointsRect (nativeObject, image.NativeObject,
502                                 destPoints, destPoints.Length , srcRect.X, srcRect.Y,
503                                 srcRect.Width, srcRect.Height, srcUnit, 
504                                 imageAttr.NativeObject, callback, IntPtr.Zero);
505                         GDIPlus.CheckStatus (status);
506                 }
507
508                 
509                 public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
510                 {
511                         
512                         Status status = GDIPlus.GdipDrawImagePointsRectI (nativeObject, image.NativeObject,
513                                 destPoints, destPoints.Length , srcRect.X, srcRect.Y,
514                                 srcRect.Width, srcRect.Height, srcUnit, 
515                                 imageAttr.NativeObject, callback, IntPtr.Zero);
516                         GDIPlus.CheckStatus (status);
517                 }
518
519                 
520                 public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, int callbackData)
521                 {
522
523                         Status status = GDIPlus.GdipDrawImagePointsRectI (nativeObject, image.NativeObject,
524                                 destPoints, destPoints.Length , srcRect.X, srcRect.Y, 
525                                 srcRect.Width, srcRect.Height, srcUnit, 
526                                 imageAttr.NativeObject, callback, (IntPtr) callbackData);
527                         GDIPlus.CheckStatus (status);
528                 }
529
530                 
531                 public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit)
532                 {
533                         Status status = GDIPlus.GdipDrawImageRectRect (nativeObject, image.NativeObject,
534                                 destRect.X, destRect.Y, destRect.Width, destRect.Height,
535                                 srcX, srcY, srcWidth, srcHeight, srcUnit, IntPtr.Zero, 
536                                 null, IntPtr.Zero);
537                         GDIPlus.CheckStatus (status);                                   
538                 }
539                 
540                 public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, int callbackData)
541                 {
542                         Status status = GDIPlus.GdipDrawImagePointsRect (nativeObject, image.NativeObject,
543                                 destPoints, destPoints.Length , srcRect.X, srcRect.Y,
544                                 srcRect.Width, srcRect.Height, srcUnit, 
545                                 imageAttr.NativeObject, callback, (IntPtr) callbackData);
546                         GDIPlus.CheckStatus (status);
547                 }
548
549                 
550                 public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit)
551                 {
552                         Status status = GDIPlus.GdipDrawImageRectRectI (nativeObject, image.NativeObject,
553                                 destRect.X, destRect.Y, destRect.Width, destRect.Height,
554                                 srcX, srcY, srcWidth, srcHeight, srcUnit, IntPtr.Zero, 
555                                 null, IntPtr.Zero);
556                         GDIPlus.CheckStatus (status);
557                 }
558
559                 
560                 public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs)
561                 {
562                         Status status = GDIPlus.GdipDrawImageRectRect (nativeObject, image.NativeObject,
563                                 destRect.X, destRect.Y, destRect.Width, destRect.Height,
564                                 srcX, srcY, srcWidth, srcHeight, srcUnit,
565                                 imageAttrs.NativeObject, null, IntPtr.Zero);
566                         GDIPlus.CheckStatus (status);
567                 }
568                 
569                 public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr)
570                 {                       
571                         Status status = GDIPlus.GdipDrawImageRectRectI (nativeObject, image.NativeObject, 
572                                         destRect.X, destRect.Y, destRect.Width, 
573                                         destRect.Height, srcX, srcY, srcWidth, srcHeight,
574                                         srcUnit, imageAttr.NativeObject, null, IntPtr.Zero);
575                         GDIPlus.CheckStatus (status);
576                 }
577                 
578                 public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
579                 {
580                         Status status = GDIPlus.GdipDrawImageRectRectI (nativeObject, image.NativeObject, 
581                                         destRect.X, destRect.Y, destRect.Width, 
582                                         destRect.Height, srcX, srcY, srcWidth, srcHeight,
583                                         srcUnit, imageAttr.NativeObject, callback,
584                                         IntPtr.Zero);
585                         GDIPlus.CheckStatus (status);
586                 }
587                 
588                 public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
589                 {
590                         Status status = GDIPlus.GdipDrawImageRectRect (nativeObject, image.NativeObject, 
591                                         destRect.X, destRect.Y, destRect.Width, 
592                                         destRect.Height, srcX, srcY, srcWidth, srcHeight,
593                                         srcUnit, imageAttr.NativeObject, 
594                                         callback, IntPtr.Zero);
595                         GDIPlus.CheckStatus (status);
596                 }
597
598                 
599                 public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, IntPtr callbackData)
600                 {
601                         Status status = GDIPlus.GdipDrawImageRectRect (nativeObject, image.NativeObject, 
602                                 destRect.X, destRect.Y, destRect.Width, destRect.Height,
603                                 srcX, srcY, srcWidth, srcHeight, srcUnit, 
604                                 imageAttr.NativeObject, callback, callbackData);
605                         GDIPlus.CheckStatus (status);
606                 }
607
608                 
609                 public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, IntPtr callbackData)
610                 {
611                         Status status = GDIPlus.GdipDrawImageRectRect (nativeObject, image.NativeObject, 
612                                 destRect.X, destRect.Y, destRect.Width, destRect.Height,
613                                 srcX, srcY, srcWidth, srcHeight, srcUnit,
614                                 imageAttr.NativeObject, callback, callbackData);
615                         GDIPlus.CheckStatus (status);
616                 }               
617                 
618                 public void DrawImageUnscaled (Image image, Point point)
619                 {
620                         DrawImage(image, point.X, point.Y);
621                 }
622                 
623                 public void DrawImageUnscaled (Image image, Rectangle rect)
624                 {
625                         DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height);
626                 }
627                 
628                 public void DrawImageUnscaled (Image image, int x, int y)
629                 {
630                         DrawImage(image, x, y);
631                 }
632
633                 public void DrawImageUnscaled (Image image, int x, int y, int width, int height)
634                 {
635                         DrawImage(image, x, y, width, height);
636                 }
637
638                 public void DrawLine (Pen pen, PointF pt1, PointF pt2)
639                 {
640                         Status status = GDIPlus.GdipDrawLine (nativeObject, pen.nativeObject,
641                                                 pt1.X, pt1.Y, pt2.X, pt2.Y);
642                         GDIPlus.CheckStatus (status);
643                 }
644
645                 public void DrawLine (Pen pen, Point pt1, Point pt2)
646                 {
647                         Status status = GDIPlus.GdipDrawLineI (nativeObject, pen.nativeObject,
648                                                 pt1.X, pt1.Y, pt2.X, pt2.Y);
649                         GDIPlus.CheckStatus (status);
650                 }
651
652                 public void DrawLine (Pen pen, int x1, int y1, int x2, int y2)
653                 {
654                         Status status = GDIPlus.GdipDrawLineI (nativeObject, pen.nativeObject, x1, y1, x2, y2);
655                         GDIPlus.CheckStatus (status);
656                 }
657
658                 public void DrawLine (Pen pen, float x1, float y1, float x2, float y2)
659                 {
660                         Status status = GDIPlus.GdipDrawLine (nativeObject, pen.nativeObject, x1, y1, x2, y2);
661                         GDIPlus.CheckStatus (status);
662                 }
663
664                 public void DrawLines (Pen pen, PointF [] points)
665                 {
666                         Status status = GDIPlus.GdipDrawLines (nativeObject, pen.nativeObject, points, points.Length);
667                         GDIPlus.CheckStatus (status);
668                 }
669
670                 public void DrawLines (Pen pen, Point [] points)
671                 {
672                         Status status = GDIPlus.GdipDrawLinesI (nativeObject, pen.nativeObject, points, points.Length);
673                         GDIPlus.CheckStatus (status);
674                 }
675
676                 public void DrawPath (Pen pen, GraphicsPath path)
677                 {
678                         Status status = GDIPlus.GdipDrawPath (nativeObject, pen.nativeObject, path.nativePath);
679                         GDIPlus.CheckStatus (status);
680                 }
681                 
682                 public void DrawPie (Pen pen, Rectangle rect, float startAngle, float sweepAngle)
683                 {
684                         DrawPie (pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
685                 }
686                 
687                 public void DrawPie (Pen pen, RectangleF rect, float startAngle, float sweepAngle)
688                 {
689                         DrawPie (pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
690                 }
691                 
692                 public void DrawPie (Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)
693                 {
694                         Status status = GDIPlus.GdipDrawPie (nativeObject, pen.nativeObject, x, y, width, height, startAngle, sweepAngle);
695                         GDIPlus.CheckStatus (status);
696                 }
697                 
698                 // Microsoft documentation states that the signature for this member should be
699                 // public void DrawPie(Pen pen, int x,  int y,  int width,   int height,   int startAngle
700                 // int sweepAngle. However, GdipDrawPieI uses also float for the startAngle and sweepAngle params
701                 public void DrawPie (Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle)
702                 {
703                         Status status = GDIPlus.GdipDrawPieI (nativeObject, pen.nativeObject, x, y, width, height, startAngle, sweepAngle);
704                         GDIPlus.CheckStatus (status);
705                 }
706
707                 public void DrawPolygon (Pen pen, Point [] points)
708                 {
709                         Status status = GDIPlus.GdipDrawPolygonI (nativeObject, pen.nativeObject, points, points.Length);
710                         GDIPlus.CheckStatus (status);
711                 }
712
713                 public void DrawPolygon (Pen pen, PointF [] points)
714                 {
715                         Status status = GDIPlus.GdipDrawPolygon (nativeObject, pen.nativeObject, points, points.Length);
716                         GDIPlus.CheckStatus (status);
717                 }
718
719                 internal void DrawRectangle (Pen pen, RectangleF rect)
720                 {
721                         DrawRectangle (pen, rect.Left, rect.Top, rect.Width, rect.Height);
722                 }
723
724                 public void DrawRectangle (Pen pen, Rectangle rect)
725                 {
726                         DrawRectangle (pen, rect.Left, rect.Top, rect.Width, rect.Height);
727                 }
728
729                 public void DrawRectangle (Pen pen, float x, float y, float width, float height)
730                 {
731                         Status status = GDIPlus.GdipDrawRectangle (nativeObject, pen.nativeObject, x, y, width, height);
732                         GDIPlus.CheckStatus (status);
733                 }
734
735                 public void DrawRectangle (Pen pen, int x, int y, int width, int height)
736                 {
737                         Status status = GDIPlus.GdipDrawRectangleI (nativeObject, pen.nativeObject, x, y, width, height);
738                         GDIPlus.CheckStatus (status);
739                 }
740
741                 public void DrawRectangles (Pen pen, RectangleF [] rects)
742                 {
743                         foreach (RectangleF rc in rects)
744                                 DrawRectangle (pen, rc.Left, rc.Top, rc.Width, rc.Height);
745                 }
746
747                 public void DrawRectangles (Pen pen, Rectangle [] rects)
748                 {
749                         foreach (RectangleF rc in rects)
750                                 DrawRectangle(pen, rc.Left, rc.Top, rc.Width, rc.Height);
751                 }
752
753                 
754                 public void DrawString (string s, Font font, Brush brush, RectangleF layoutRectangle)
755                 {                       
756                         Status status = GDIPlus.GdipDrawString (nativeObject, s, s.Length, font.NativeObject, ref layoutRectangle, IntPtr.Zero, brush.nativeObject);
757                         GDIPlus.CheckStatus (status);
758                 }
759                 
760                 public void DrawString (string s, Font font, Brush brush, PointF point)
761                 {
762                         RectangleF rc = new RectangleF (point.X, point.Y, 0, 0);
763                         Status status = GDIPlus.GdipDrawString (nativeObject, s, s.Length, font.NativeObject, ref rc, IntPtr.Zero, brush.nativeObject);
764                         GDIPlus.CheckStatus (status);
765                 }
766                 
767                 public void DrawString (string s, Font font, Brush brush, PointF point, StringFormat format)
768                 {
769                         RectangleF rc = new RectangleF (point.X, point.Y, 0, 0);
770                         Status status = GDIPlus.GdipDrawString (nativeObject, s, s.Length, font.NativeObject, ref rc, format.NativeObject, brush.nativeObject);
771                         GDIPlus.CheckStatus (status);
772                 }
773                 
774                 public void DrawString (string s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format)
775                 {
776                         Status status = GDIPlus.GdipDrawString (nativeObject, s, s.Length, font.NativeObject, ref layoutRectangle, format.NativeObject, brush.nativeObject);
777                         GDIPlus.CheckStatus (status);
778                 }
779
780                 public void DrawString (string s, Font font, Brush brush, float x, float y)
781                 {
782                         RectangleF rc = new RectangleF (x, y, 0, 0);
783                         
784                         Status status = GDIPlus.GdipDrawString (nativeObject, s, s.Length, font.NativeObject, 
785                                 ref rc, IntPtr.Zero, brush.nativeObject);
786                         GDIPlus.CheckStatus (status);
787                 }
788
789                 public void DrawString (string s, Font font, Brush brush, float x, float y, StringFormat format)
790                 {
791                         RectangleF rc = new RectangleF (x, y, 0, 0);
792
793                         Status status = GDIPlus.GdipDrawString (nativeObject, s, s.Length, font.NativeObject,
794                                 ref rc, format.NativeObject, brush.nativeObject);
795                         GDIPlus.CheckStatus (status);
796                 }
797
798                 
799                 public void EndContainer (GraphicsContainer container)
800                 {
801                         Status status = GDIPlus.GdipEndContainer(nativeObject, container.NativeObject);
802                         GDIPlus.CheckStatus (status);
803                 }
804
805                 [MonoTODO]
806                 public void EnumerateMetafile (Metafile metafile, Point [] destPoints, EnumerateMetafileProc callback)
807                 {
808                         throw new NotImplementedException ();
809                 }
810
811                 [MonoTODO]
812                 public void EnumerateMetafile (Metafile metafile, RectangleF destRect, EnumerateMetafileProc callback)
813                 {
814                         throw new NotImplementedException ();
815                 }
816
817                 [MonoTODO]
818                 public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, EnumerateMetafileProc callback)
819                 {
820                         throw new NotImplementedException ();
821                 }
822
823                 [MonoTODO]
824                 public void EnumerateMetafile (Metafile metafile, Rectangle destRect, EnumerateMetafileProc callback)
825                 {
826                         throw new NotImplementedException ();
827                 }
828
829                 [MonoTODO]
830                 public void EnumerateMetafile (Metafile metafile, Point destPoint, EnumerateMetafileProc callback)
831                 {
832                         throw new NotImplementedException ();
833                 }
834
835                 [MonoTODO]
836                 public void EnumerateMetafile (Metafile metafile, PointF destPoint, EnumerateMetafileProc callback)
837                 {
838                         throw new NotImplementedException ();
839                 }
840
841                 [MonoTODO]
842                 public void EnumerateMetafile (Metafile metafile, PointF destPoint, EnumerateMetafileProc callback, IntPtr callbackData)
843                 {
844                         throw new NotImplementedException ();
845                 }
846
847                 [MonoTODO]
848                 public void EnumerateMetafile (Metafile metafile, Rectangle destRect, EnumerateMetafileProc callback, IntPtr callbackData)
849                 {
850                         throw new NotImplementedException ();
851                 }
852
853                 [MonoTODO]
854                 public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, EnumerateMetafileProc callback, IntPtr callbackData)
855                 {
856                         throw new NotImplementedException ();
857                 }
858
859                 [MonoTODO]
860                 public void EnumerateMetafile (Metafile metafile, Point destPoint, EnumerateMetafileProc callback, IntPtr callbackData)
861                 {
862                         throw new NotImplementedException ();
863                 }
864
865                 [MonoTODO]
866                 public void EnumerateMetafile (Metafile metafile, Point [] destPoints, EnumerateMetafileProc callback, IntPtr callbackData)
867                 {
868                         throw new NotImplementedException ();
869                 }
870
871                 [MonoTODO]
872                 public void EnumerateMetafile (Metafile metafile, RectangleF destRect, EnumerateMetafileProc callback, IntPtr callbackData)
873                 {
874                         throw new NotImplementedException ();
875                 }
876
877                 [MonoTODO]
878                 public void EnumerateMetafile (Metafile metafile, PointF destPoint, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
879                 {
880                         throw new NotImplementedException ();
881                 }
882
883                 [MonoTODO]
884                 public void EnumerateMetafile (Metafile metafile, Point destPoint, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
885                 {
886                         throw new NotImplementedException ();
887                 }
888
889                 [MonoTODO]
890                 public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
891                 {
892                         throw new NotImplementedException ();
893                 }
894
895                 [MonoTODO]
896                 public void EnumerateMetafile (Metafile metafile, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
897                 {
898                         throw new NotImplementedException ();
899                 }
900
901                 [MonoTODO]
902                 public void EnumerateMetafile (Metafile metafile, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
903                 {
904                         throw new NotImplementedException ();
905                 }
906
907                 [MonoTODO]
908                 public void EnumerateMetafile (Metafile metafile, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
909                 {
910                         throw new NotImplementedException ();
911                 }
912
913                 [MonoTODO]
914                 public void EnumerateMetafile (Metafile metafile, RectangleF destRect, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
915                 {
916                         throw new NotImplementedException ();
917                 }
918
919                 [MonoTODO]
920                 public void EnumerateMetafile (Metafile metafile, Point destPoint, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
921                 {
922                         throw new NotImplementedException ();
923                 }
924
925                 [MonoTODO]
926                 public void EnumerateMetafile (Metafile metafile, PointF destPoint, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
927                 {
928                         throw new NotImplementedException ();
929                 }
930
931                 [MonoTODO]
932                 public void EnumerateMetafile (Metafile metafile, Point [] destPoints, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
933                 {
934                         throw new NotImplementedException ();
935                 }
936
937                 [MonoTODO]
938                 public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
939                 {
940                         throw new NotImplementedException ();
941                 }
942
943                 [MonoTODO]
944                 public void EnumerateMetafile (Metafile metafile, Rectangle destRect, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
945                 {
946                         throw new NotImplementedException ();
947                 }
948
949                 [MonoTODO]
950                 public void EnumerateMetafile (Metafile metafile, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
951                 {
952                         throw new NotImplementedException ();
953                 }
954
955                 [MonoTODO]
956                 public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
957                 {
958                         throw new NotImplementedException ();
959                 }
960
961                 [MonoTODO]
962                 public void EnumerateMetafile (Metafile metafile, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
963                 {
964                         throw new NotImplementedException ();
965                 }
966
967                 [MonoTODO]
968                 public void EnumerateMetafile (Metafile metafile, PointF destPoint, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
969                 {
970                         throw new NotImplementedException ();
971                 }
972
973                 [MonoTODO]
974                 public void EnumerateMetafile (Metafile metafile, Point destPoint, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
975                 {
976                         throw new NotImplementedException ();
977                 }
978
979                 [MonoTODO]
980                 public void EnumerateMetafile (Metafile metafile, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
981                 {
982                         throw new NotImplementedException ();
983                 }
984
985                 [MonoTODO]
986                 public void EnumerateMetafile (Metafile metafile, Point [] destPoints, Rectangle srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
987                 {
988                         throw new NotImplementedException ();
989                 }
990
991                 [MonoTODO]
992                 public void EnumerateMetafile (Metafile metafile, Rectangle destRect, Rectangle srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
993                 {
994                         throw new NotImplementedException ();
995                 }
996
997                 [MonoTODO]
998                 public void EnumerateMetafile (Metafile metafile, Point destPoint, Rectangle srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
999                 {
1000                         throw new NotImplementedException ();
1001                 }
1002
1003                 [MonoTODO]
1004                 public void EnumerateMetafile (Metafile metafile, RectangleF destRect, RectangleF srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
1005                 {
1006                         throw new NotImplementedException ();
1007                 }
1008
1009                 [MonoTODO]
1010                 public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, RectangleF srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
1011                 {
1012                         throw new NotImplementedException ();
1013                 }
1014
1015                 [MonoTODO]
1016                 public void EnumerateMetafile (Metafile metafile, PointF destPoint, RectangleF srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
1017                 {
1018                         throw new NotImplementedException ();
1019                 }
1020         
1021                 public void ExcludeClip (Rectangle rect)
1022                 {
1023                         Status status = GDIPlus.GdipSetClipRectI (nativeObject, rect.X, rect.Y, rect.Width, rect.Height, CombineMode.Exclude);
1024                         GDIPlus.CheckStatus (status);
1025                 }
1026
1027                 [MonoTODO]
1028                 public void ExcludeClip (Region region)
1029                 {
1030                         throw new NotImplementedException ();
1031                 }
1032
1033                 
1034                 public void FillClosedCurve (Brush brush, PointF [] points)
1035                 {
1036                        Status status = GDIPlus.GdipFillClosedCurve (nativeObject, brush.NativeObject, points, points.Length);
1037                         GDIPlus.CheckStatus (status);
1038                 }
1039
1040                 
1041                 public void FillClosedCurve (Brush brush, Point [] points)
1042                 {
1043                         Status status = GDIPlus.GdipFillClosedCurveI (nativeObject, brush.NativeObject, points, points.Length);
1044                         GDIPlus.CheckStatus (status);
1045                 }
1046
1047                 
1048                 public void FillClosedCurve (Brush brush, PointF [] points, FillMode fillmode)
1049                 {
1050                         FillClosedCurve (brush, points, fillmode, 0.5f);
1051                 }
1052                 
1053                 public void FillClosedCurve (Brush brush, Point [] points, FillMode fillmode)
1054                 {
1055                         FillClosedCurve (brush, points, fillmode, 0.5f);
1056                 }
1057
1058                 public void FillClosedCurve (Brush brush, PointF [] points, FillMode fillmode, float tension)
1059                 {
1060                         Status status = GDIPlus.GdipFillClosedCurve2 (nativeObject, brush.NativeObject, points, points.Length, tension, fillmode);
1061                         GDIPlus.CheckStatus (status);
1062                 }
1063
1064                 public void FillClosedCurve (Brush brush, Point [] points, FillMode fillmode, float tension)
1065                 {
1066                         Status status = GDIPlus.GdipFillClosedCurve2I (nativeObject, brush.NativeObject, points, points.Length, tension, fillmode);
1067                         GDIPlus.CheckStatus (status);
1068                 }
1069
1070                 public void FillEllipse (Brush brush, Rectangle rect)
1071                 {
1072                         FillEllipse (brush, rect.X, rect.Y, rect.Width, rect.Height);
1073                 }
1074
1075                 public void FillEllipse (Brush brush, RectangleF rect)
1076                 {
1077                         FillEllipse (brush, rect.X, rect.Y, rect.Width, rect.Height);
1078                 }
1079
1080                 public void FillEllipse (Brush brush, float x, float y, float width, float height)
1081                 {
1082                         Status status = GDIPlus.GdipFillEllipse (nativeObject, brush.nativeObject, x, y, width, height);
1083                         GDIPlus.CheckStatus (status);
1084                 }
1085
1086                 public void FillEllipse (Brush brush, int x, int y, int width, int height)
1087                 {
1088                         Status status = GDIPlus.GdipFillEllipseI (nativeObject, brush.nativeObject, x, y, width, height);
1089                         GDIPlus.CheckStatus (status);
1090                 }
1091
1092                 public void FillPath (Brush brush, GraphicsPath path)
1093                 {
1094                         Status status = GDIPlus.GdipFillPath (nativeObject, brush.NativeObject,  path.NativeObject);
1095                         GDIPlus.CheckStatus (status);
1096                 }
1097
1098                 public void FillPie (Brush brush, Rectangle rect, float startAngle, float sweepAngle)
1099                 {
1100                         Status status = GDIPlus.GdipFillPie (nativeObject, brush.NativeObject, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
1101                         GDIPlus.CheckStatus (status);
1102                 }
1103
1104                 public void FillPie (Brush brush, int x, int y, int width, int height, int startAngle, int sweepAngle)
1105                 {
1106                         Status status = GDIPlus.GdipFillPieI (nativeObject, brush.NativeObject, x, y, width, height, startAngle, sweepAngle);
1107                         GDIPlus.CheckStatus (status);
1108                 }
1109
1110                 public void FillPie (Brush brush, float x, float y, float width, float height, float startAngle, float sweepAngle)
1111                 {
1112                         Status status = GDIPlus.GdipFillPie (nativeObject, brush.NativeObject, x, y, width, height, startAngle, sweepAngle);
1113                         GDIPlus.CheckStatus (status);
1114                 }
1115
1116                 public void FillPolygon (Brush brush, PointF [] points)
1117                 {
1118                         Status status = GDIPlus.GdipFillPolygon2 (nativeObject, brush.nativeObject, points, points.Length);
1119                         GDIPlus.CheckStatus (status);
1120                 }
1121
1122                 public void FillPolygon (Brush brush, Point [] points)
1123                 {
1124                         Status status = GDIPlus.GdipFillPolygon2I (nativeObject, brush.nativeObject, points, points.Length);
1125                         GDIPlus.CheckStatus (status);
1126                 }
1127
1128                 public void FillPolygon (Brush brush, Point [] points, FillMode fillMode)
1129                 {
1130                         Status status = GDIPlus.GdipFillPolygonI (nativeObject, brush.nativeObject, points, points.Length, fillMode);
1131                         GDIPlus.CheckStatus (status);
1132                 }
1133
1134                 public void FillPolygon (Brush brush, PointF [] points, FillMode fillMode)
1135                 {
1136                         Status status = GDIPlus.GdipFillPolygon (nativeObject, brush.nativeObject, points, points.Length, fillMode);
1137                         GDIPlus.CheckStatus (status);
1138                 }
1139
1140                 public void FillRectangle (Brush brush, RectangleF rect)
1141                 {
1142                         FillRectangle (brush, rect.Left, rect.Top, rect.Width, rect.Height);
1143                 }
1144
1145                 public void FillRectangle (Brush brush, Rectangle rect)
1146                 {
1147                         FillRectangle (brush, rect.Left, rect.Top, rect.Width, rect.Height);
1148                 }
1149
1150                 public void FillRectangle (Brush brush, int x, int y, int width, int height)
1151                 {
1152                         Status status = GDIPlus.GdipFillRectangle (nativeObject, brush.nativeObject, (float)x, (float)y, (float)width, (float)height);
1153                         GDIPlus.CheckStatus (status);
1154                 }
1155
1156                 public void FillRectangle (Brush brush, float x, float y, float width, float height)
1157                 {
1158                         Status status = GDIPlus.GdipFillRectangle (nativeObject, brush.nativeObject, x, y, width, height);
1159                         GDIPlus.CheckStatus (status);
1160                 }
1161
1162                 public void FillRectangles (Brush brush, Rectangle [] rects)
1163                 {
1164                         foreach (Rectangle rc in rects)
1165                                 FillRectangle(brush, rc);
1166                 }
1167
1168                 public void FillRectangles (Brush brush, RectangleF [] rects)
1169                 {
1170                         foreach (RectangleF rc in rects)
1171                                 FillRectangle(brush, rc);
1172                 }
1173
1174                 
1175                 public void FillRegion (Brush brush, Region region)
1176                 {
1177                         Status status = GDIPlus.GdipFillRegion (nativeObject, brush.NativeObject, region.NativeObject);                  
1178                         GDIPlus.CheckStatus(status);
1179                 }
1180
1181                 
1182                 public void Flush ()
1183                 {
1184                         Flush (FlushIntention.Flush);
1185                 }
1186
1187                 
1188                 public void Flush (FlushIntention intention)
1189                 {
1190                         Status status = GDIPlus.GdipFlush (nativeObject, intention);
1191                         GDIPlus.CheckStatus (status);                     
1192                 }
1193
1194                 [EditorBrowsable (EditorBrowsableState.Advanced)]               
1195                 public static Graphics FromHdc (IntPtr hdc)
1196                 {
1197                         int graphics;
1198                         Status status = GDIPlus.GdipCreateFromHDC (hdc, out graphics);                          GDIPlus.CheckStatus (status);
1199                             
1200                         Graphics result = new Graphics ((IntPtr) graphics);
1201                         return result;
1202                 }
1203
1204                 [MonoTODO]
1205                 [EditorBrowsable (EditorBrowsableState.Advanced)]
1206                 public static Graphics FromHdc (IntPtr hdc, IntPtr hdevice)
1207                 {
1208                         throw new NotImplementedException ();
1209                 }
1210
1211                 [MonoTODO]
1212                 [EditorBrowsable (EditorBrowsableState.Advanced)]
1213                 public static Graphics FromHdcInternal (IntPtr hdc)
1214                 {
1215                         throw new NotImplementedException ();
1216                 }
1217
1218                 [EditorBrowsable (EditorBrowsableState.Advanced)]               
1219                 public static Graphics FromHwnd (IntPtr hwnd)
1220                 {
1221                         IntPtr graphics;
1222                         
1223                         Status status = GDIPlus.GdipCreateFromHWND (hwnd, out graphics);                                GDIPlus.CheckStatus (status);
1224                         
1225                         return new Graphics (graphics); 
1226                 }
1227
1228                 [MonoTODO]
1229                 [EditorBrowsable (EditorBrowsableState.Advanced)]
1230                 public static Graphics FromHwndInternal (IntPtr hwnd)
1231                 {
1232                         throw new NotImplementedException ();
1233                 }
1234
1235                 [MonoTODO]
1236                 public static Graphics FromImage (Image image)
1237                 {
1238                         if (image == null) throw new ArgumentException ();
1239                         int graphics;
1240                         Status status = GDIPlus.GdipGetImageGraphicsContext (image.nativeObject, out graphics);
1241                         GDIPlus.CheckStatus (status);
1242                         Graphics result = new Graphics ((IntPtr) graphics);
1243                         return result;
1244                 }
1245
1246                 internal static Graphics FromXDrawable (IntPtr drawable, IntPtr display)
1247                 {
1248                   IntPtr graphics;
1249                   Status s = GDIPlus.GdipCreateFromXDrawable_linux (drawable, display, out graphics);
1250                   GDIPlus.CheckStatus (s);
1251                   return new Graphics (graphics);
1252                 }
1253
1254                 [MonoTODO]
1255                 public static IntPtr GetHalftonePalette ()
1256                 {
1257                         throw new NotImplementedException ();
1258                 }
1259
1260                 [MonoTODO]
1261                 [EditorBrowsable (EditorBrowsableState.Advanced)]
1262                 public IntPtr GetHdc ()
1263                 {
1264                         int hdc;
1265                         Status status = GDIPlus.GdipGetDC (nativeObject, out hdc);
1266                         GDIPlus.CheckStatus (status);
1267
1268                         return (IntPtr) hdc;
1269                 }
1270
1271                 
1272                 public Color GetNearestColor (Color color)
1273                 {
1274                         int argb;
1275                         
1276                         Status status = GDIPlus.GdipGetNearestColor (nativeObject, out argb);
1277                         GDIPlus.CheckStatus (status);
1278
1279                         return Color.FromArgb (argb);
1280                 }
1281
1282                 [MonoTODO]
1283                 public void IntersectClip (Region region)
1284                 {
1285                         throw new NotImplementedException ();
1286                 }
1287                 
1288                 public void IntersectClip (RectangleF rect)
1289                 {
1290                         Status status = GDIPlus.GdipSetClipRect (nativeObject, rect.X, rect.Y, rect.Width, rect.Height, CombineMode.Intersect);
1291                         GDIPlus.CheckStatus (status);
1292                 }
1293
1294                 public void IntersectClip (Rectangle rect)
1295                 {                       
1296                         Status status = GDIPlus.GdipSetClipRectI (nativeObject, rect.X, rect.Y, rect.Width, rect.Height, CombineMode.Intersect);
1297                         GDIPlus.CheckStatus (status);
1298                 }
1299
1300                 public bool IsVisible (Point point)
1301                 {
1302                         bool isVisible = false;
1303
1304                         Status status = GDIPlus.GdipIsVisiblePointI (nativeObject, point.X, point.Y, out isVisible);
1305                         GDIPlus.CheckStatus (status);
1306
1307                         return isVisible;
1308                 }
1309
1310                 
1311                 public bool IsVisible (RectangleF rect)
1312                 {
1313                         bool isVisible = false;
1314
1315                         Status status = GDIPlus.GdipIsVisibleRect (nativeObject, rect.X, rect.Y, rect.Width, rect.Height, out isVisible);
1316                         GDIPlus.CheckStatus (status);
1317
1318                         return isVisible;
1319                 }
1320
1321                 public bool IsVisible (PointF point)
1322                 {
1323                         bool isVisible = false;
1324
1325                         Status status = GDIPlus.GdipIsVisiblePoint (nativeObject, point.X, point.Y, out isVisible);
1326                         GDIPlus.CheckStatus (status);
1327
1328                         return isVisible;
1329                 }
1330                 
1331                 public bool IsVisible (Rectangle rect)
1332                 {
1333                         bool isVisible = false;
1334
1335                         Status status = GDIPlus.GdipIsVisibleRectI (nativeObject, rect.X, rect.Y, rect.Width, rect.Height, out isVisible);
1336                         GDIPlus.CheckStatus (status);
1337
1338                         return isVisible;
1339                 }
1340                 
1341                 public bool IsVisible (float x, float y)
1342                 {
1343                         return IsVisible (new PointF (x, y));
1344                 }
1345                 
1346                 public bool IsVisible (int x, int y)
1347                 {
1348                         return IsVisible (new Point (x, y));
1349                 }
1350                 
1351                 public bool IsVisible (float x, float y, float width, float height)
1352                 {
1353                         return IsVisible (new RectangleF (x, y, width, height));
1354                 }
1355
1356                 
1357                 public bool IsVisible (int x, int y, int width, int height)
1358                 {
1359                         return IsVisible (new Rectangle (x, y, width, height));
1360                 }
1361
1362                 [MonoTODO]
1363                 public Region [] MeasureCharacterRanges (string text, Font font, RectangleF layoutRect, StringFormat stringFormat)
1364                 {
1365                         Region []       result=new Region[stringFormat.GetCharRanges.Length];
1366                         string          textFragment;
1367                         SizeF           fragmentSize;
1368                         
1369                         for (int i=0; i<stringFormat.GetCharRanges.Length; i++) { 
1370                                 textFragment=text.Substring(stringFormat.GetCharRanges[i].First, stringFormat.GetCharRanges[i].Length);
1371                                 fragmentSize=MeasureString(textFragment, font, new SizeF(layoutRect.Width, layoutRect.Height), stringFormat);
1372                                 result[i]=new Region(new RectangleF(layoutRect.X, layoutRect.Y, layoutRect.X+fragmentSize.Width, layoutRect.Y+fragmentSize.Height));
1373                         }
1374
1375                         return(result);
1376                 }
1377
1378                 
1379                 public SizeF MeasureString (string text, Font font)
1380                 {
1381                         return MeasureString (text, font, new Size(0,0));
1382                 }
1383
1384                 
1385                 public SizeF MeasureString (string text, Font font, SizeF layoutArea)
1386                 {
1387                         int charactersFitted, linesFilled;                      
1388                         RectangleF boundingBox = new RectangleF ();
1389                         RectangleF rect = new RectangleF (0,0,layoutArea.Width, layoutArea.Height);
1390                                         
1391                         Status status = GDIPlus.GdipMeasureString (nativeObject, text, text.Length, 
1392                                 font.NativeObject, ref rect, IntPtr.Zero, out boundingBox,
1393                                 out charactersFitted, out linesFilled);
1394                         GDIPlus.CheckStatus (status);
1395
1396                         return new SizeF(boundingBox.Width, boundingBox.Height);
1397                 }
1398
1399                 [MonoTODO]
1400                 public SizeF MeasureString (string text, Font font, int width)
1401                 {
1402                         throw new NotImplementedException ();
1403                 }
1404
1405                 
1406                 public SizeF MeasureString (string text, Font font, SizeF layoutArea, StringFormat stringFormat)
1407                 {
1408                         int charactersFitted, linesFilled;                      
1409                         return MeasureString (text, font, layoutArea, stringFormat, out charactersFitted, out linesFilled);
1410                 }
1411
1412                 [MonoTODO]
1413                 public SizeF MeasureString (string text, Font font, int width, StringFormat format)
1414                 {
1415                         throw new NotImplementedException ();
1416                 }
1417
1418                 
1419                 public SizeF MeasureString (string text, Font font, PointF origin, StringFormat stringFormat)
1420                 {
1421                         RectangleF boundingBox = new RectangleF ();
1422                         RectangleF rect = new RectangleF (origin.X, origin.Y, 0,0);
1423                         int charactersFitted, linesFilled;
1424
1425                         Status status = GDIPlus.GdipMeasureString (nativeObject, text, text.Length, 
1426                                 font.NativeObject, ref rect, stringFormat.NativeObject, 
1427                                 out boundingBox, out charactersFitted, out linesFilled);
1428                         GDIPlus.CheckStatus (status);
1429
1430                         return new SizeF (boundingBox.Width, boundingBox.Height);
1431                 }
1432
1433                 
1434                 public SizeF MeasureString (string text, Font font, SizeF layoutArea, StringFormat stringFormat, out int charactersFitted, out int linesFilled)
1435                 {       
1436                         RectangleF boundingBox = new RectangleF ();
1437                         RectangleF rect = new RectangleF (0,0,layoutArea.Width, layoutArea.Height);
1438                         Status status = GDIPlus.GdipMeasureString (nativeObject, text, text.Length, 
1439                                 font.NativeObject, ref rect, stringFormat.NativeObject,
1440                                 out boundingBox, out charactersFitted, out linesFilled);
1441                         GDIPlus.CheckStatus (status);
1442
1443                         return new SizeF (boundingBox.Width, boundingBox.Height);
1444                 }
1445
1446                 public void MultiplyTransform (Matrix matrix)
1447                 {
1448                         MultiplyTransform (matrix, MatrixOrder.Prepend);
1449                 }
1450
1451                 public void MultiplyTransform (Matrix matrix, MatrixOrder order)
1452                 {
1453                         Status status = GDIPlus.GdipMultiplyWorldTransform (nativeObject, matrix.nativeMatrix, order);
1454                         GDIPlus.CheckStatus (status);
1455                 }
1456
1457                 [EditorBrowsable (EditorBrowsableState.Advanced)]
1458                 public void ReleaseHdc (IntPtr hdc)
1459                 {
1460                         Status status = GDIPlus.GdipReleaseDC (nativeObject, hdc);
1461                         GDIPlus.CheckStatus (status);
1462                 }
1463
1464                 [MonoTODO]
1465                 [EditorBrowsable (EditorBrowsableState.Advanced)]
1466                 public void ReleaseHdcInternal (IntPtr hdc)
1467                 {
1468                         throw new NotImplementedException ();
1469                 }
1470
1471                 
1472                 public void ResetClip ()
1473                 {
1474                         Status status = GDIPlus.GdipResetClip (nativeObject);
1475                         GDIPlus.CheckStatus (status);
1476                 }
1477
1478                 public void ResetTransform ()
1479                 {
1480                         Status status = GDIPlus.GdipResetWorldTransform (nativeObject);
1481                         GDIPlus.CheckStatus (status);
1482                 }
1483
1484                 public void Restore (GraphicsState gstate)
1485                 {
1486                         Transform = gstate.matrix.Clone ();
1487                         Status status = GDIPlus.GdipRestoreGraphics (nativeObject, gstate.nativeState);
1488                         GDIPlus.CheckStatus (status);
1489                 }
1490
1491
1492                 public void RotateTransform (float angle)
1493                 {
1494                         RotateTransform (angle, MatrixOrder.Prepend);
1495                 }
1496
1497                 public void RotateTransform (float angle, MatrixOrder order)
1498                 {
1499
1500                         Status status = GDIPlus.GdipRotateWorldTransform (nativeObject, angle, order);
1501                         GDIPlus.CheckStatus (status);
1502                 }
1503
1504                 public GraphicsState Save ()
1505                 {
1506                         GraphicsState state = new GraphicsState ();
1507                         state.matrix = Transform.Clone ();
1508                         uint saveState;
1509                         Status status = GDIPlus.GdipSaveGraphics (nativeObject, out saveState);
1510                         GDIPlus.CheckStatus (status);
1511
1512                         state.nativeState = saveState;
1513                         return state;
1514                 }
1515
1516                 public void ScaleTransform (float sx, float sy)
1517                 {
1518                         ScaleTransform (sx, sy, MatrixOrder.Prepend);
1519                 }
1520
1521                 public void ScaleTransform (float sx, float sy, MatrixOrder order)
1522                 {
1523                         Status status = GDIPlus.GdipScaleWorldTransform (nativeObject, sx, sy, order);
1524                         GDIPlus.CheckStatus (status);
1525                 }
1526
1527                 
1528                 public void SetClip (RectangleF rect)
1529                 {
1530                         SetClip (rect, CombineMode.Replace);
1531                 }
1532
1533                 
1534                 public void SetClip (GraphicsPath path)
1535                 {
1536                         SetClip (path, CombineMode.Replace);
1537                 }
1538
1539                 
1540                 public void SetClip (Rectangle rect)
1541                 {
1542                         SetClip (rect, CombineMode.Replace);
1543                 }
1544
1545                 
1546                 public void SetClip (Graphics g)
1547                 {
1548                         SetClip (g, CombineMode.Replace);
1549                 }
1550
1551                 
1552                 public void SetClip (Graphics g, CombineMode combineMode)
1553                 {
1554                         Status status = GDIPlus.GdipSetClipGraphics (nativeObject, g.NativeObject, combineMode);
1555                         GDIPlus.CheckStatus (status);
1556                 }
1557
1558                 
1559                 public void SetClip (Rectangle rect, CombineMode combineMode)
1560                 {
1561                         Status status = GDIPlus.GdipSetClipRectI (nativeObject, rect.X, rect.Y, rect.Width, rect.Height, combineMode);
1562                         GDIPlus.CheckStatus (status);
1563                 }
1564
1565                 
1566                 public void SetClip (RectangleF rect, CombineMode combineMode)
1567                 {
1568                         Status status = GDIPlus.GdipSetClipRect (nativeObject, rect.X, rect.Y, rect.Width, rect.Height, combineMode);
1569                         GDIPlus.CheckStatus (status);
1570                 }
1571
1572                 [MonoTODO]
1573                 public void SetClip (Region region, CombineMode combineMode)
1574                 {
1575                         //GDIPlus.GdipSetClipRegion(nativeObject,  region.NativeObject, combineMode); //TODO: Region not implemented yet
1576                         throw new NotImplementedException();
1577                 }
1578
1579                 
1580                 public void SetClip (GraphicsPath path, CombineMode combineMode)
1581                 {
1582                         Status status = GDIPlus.GdipSetClipPath (nativeObject, path.NativeObject, combineMode);
1583                         GDIPlus.CheckStatus (status);
1584                 }
1585
1586                 
1587                 public void TransformPoints (CoordinateSpace destSpace, CoordinateSpace srcSpace, PointF [] pts)
1588                 {
1589                         IntPtr ptrPt =  GDIPlus.FromPointToUnManagedMemory (pts);
1590             
1591                         Status status = GDIPlus.GdipTransformPoints (nativeObject, destSpace, srcSpace,  ptrPt, pts.Length);
1592                         GDIPlus.CheckStatus (status);
1593                         
1594                         GDIPlus.FromUnManagedMemoryToPoint (ptrPt, pts);
1595                 }
1596
1597
1598                 public void TransformPoints (CoordinateSpace destSpace, CoordinateSpace srcSpace, Point [] pts)
1599                 {                                               
1600                         IntPtr ptrPt =  GDIPlus.FromPointToUnManagedMemoryI (pts);
1601             
1602                         Status status = GDIPlus.GdipTransformPointsI (nativeObject, destSpace, srcSpace, ptrPt, pts.Length);
1603                         GDIPlus.CheckStatus (status);
1604                         
1605                         GDIPlus.FromUnManagedMemoryToPointI (ptrPt, pts);
1606                 }
1607
1608                 
1609                 public void TranslateClip (int dx, int dy)
1610                 {
1611                         Status status = GDIPlus.GdipTranslateClipI (nativeObject, dx, dy);
1612                         GDIPlus.CheckStatus (status);
1613                 }
1614
1615                 
1616                 public void TranslateClip (float dx, float dy)
1617                 {
1618                         Status status = GDIPlus.GdipTranslateClip (nativeObject, dx, dy);
1619                         GDIPlus.CheckStatus (status);
1620                 }
1621
1622                 public void TranslateTransform (float dx, float dy)
1623                 {
1624                         TranslateTransform (dx, dy, MatrixOrder.Prepend);
1625                 }
1626
1627                 
1628                 public void TranslateTransform (float dx, float dy, MatrixOrder order)
1629                 {                       
1630                         Status status = GDIPlus.GdipTranslateWorldTransform (nativeObject, dx, dy, order);
1631                         GDIPlus.CheckStatus (status);
1632                 }
1633
1634                 public Region Clip {
1635                         get {
1636                                 throw new NotImplementedException ();
1637                         }
1638                         set {
1639                                 //throw new NotImplementedException ();
1640                         }
1641                 }
1642
1643                 public RectangleF ClipBounds {
1644                         get {
1645                                 RectangleF rect = new RectangleF ();
1646                                 Status status = GDIPlus.GdipGetClipBounds (nativeObject, out rect);
1647                                 GDIPlus.CheckStatus (status);
1648                                 return rect;
1649                         }
1650                 }
1651
1652                 public CompositingMode CompositingMode {
1653                         get {
1654                                 CompositingMode mode;
1655                                 Status status = GDIPlus.GdipGetCompositingMode (nativeObject, out mode);
1656                                 GDIPlus.CheckStatus (status);
1657
1658                                 return mode;
1659                         }
1660                         set {
1661                                 Status status = GDIPlus.GdipSetCompositingMode (nativeObject, value);
1662                                 GDIPlus.CheckStatus (status);
1663                         }
1664
1665                 }
1666
1667                 public CompositingQuality CompositingQuality {
1668                         get {
1669                                 CompositingQuality quality;
1670
1671                                 Status status = GDIPlus.GdipGetCompositingQuality (nativeObject, out quality);
1672                                 GDIPlus.CheckStatus (status);
1673                                 return quality;
1674                         }
1675                         set {
1676                                 Status status = GDIPlus.GdipSetCompositingQuality (nativeObject, value);
1677                                 GDIPlus.CheckStatus (status);
1678                         }
1679                 }
1680
1681                 public float DpiX {
1682                         get {
1683                                 float x;
1684
1685                                 Status status = GDIPlus.GdipGetDpiX (nativeObject, out x);
1686                                 GDIPlus.CheckStatus (status);
1687                                 return x;
1688                         }
1689                 }
1690
1691                 public float DpiY {
1692                         get {
1693                                 float y;
1694
1695                                 Status status = GDIPlus.GdipGetDpiY (nativeObject, out y);
1696                                 GDIPlus.CheckStatus (status);
1697                                 return y;
1698                         }
1699                 }
1700
1701                 public InterpolationMode InterpolationMode {
1702                         get {                           
1703                                 InterpolationMode imode = InterpolationMode.Invalid;
1704                                 Status status = GDIPlus.GdipGetInterpolationMode (nativeObject, out imode);
1705                                 GDIPlus.CheckStatus (status);
1706                                 return imode;
1707                         }
1708                         set {
1709                                 Status status = GDIPlus.GdipSetInterpolationMode (nativeObject, value);
1710                                 GDIPlus.CheckStatus (status);
1711                         }
1712                 }
1713
1714                 public bool IsClipEmpty {
1715                         get {
1716                                 bool isEmpty = false;
1717
1718                                 Status status = GDIPlus.GdipIsClipEmpty (nativeObject, out isEmpty);
1719                                 GDIPlus.CheckStatus (status);
1720                                 return isEmpty;
1721                         }
1722                 }
1723
1724                 public bool IsVisibleClipEmpty {
1725                         get {
1726                                 bool isEmpty = false;
1727
1728                                 Status status = GDIPlus.GdipIsVisibleClipEmpty (nativeObject, out isEmpty);
1729                                 GDIPlus.CheckStatus (status);
1730                                 return isEmpty;
1731                         }
1732                 }
1733
1734                 public float PageScale {
1735                         get {
1736                                 float scale;
1737
1738                                 Status status = GDIPlus.GdipGetPageScale (nativeObject, out scale);
1739                                 GDIPlus.CheckStatus (status);
1740                                 return scale;
1741                         }
1742                         set {
1743                                 Status status = GDIPlus.GdipSetPageScale (nativeObject, value);
1744                                 GDIPlus.CheckStatus (status);
1745                         }
1746                 }
1747
1748                 public GraphicsUnit PageUnit {
1749                         get {
1750                                 GraphicsUnit unit;
1751                                 
1752                                 Status status = GDIPlus.GdipGetPageUnit (nativeObject, out unit);
1753                                 GDIPlus.CheckStatus (status);
1754                                 return unit;
1755                         }
1756                         set {
1757                                 Status status = GDIPlus.GdipSetPageUnit (nativeObject, value);
1758                                 GDIPlus.CheckStatus (status);
1759                         }
1760                 }
1761
1762                 public PixelOffsetMode PixelOffsetMode {
1763                         get {
1764                                 PixelOffsetMode pixelOffset = PixelOffsetMode.Invalid;
1765                                 
1766                                 Status status = GDIPlus.GdipGetPixelOffsetMode (nativeObject, out pixelOffset);
1767                                 GDIPlus.CheckStatus (status);
1768                                 return pixelOffset;
1769                         }
1770                         set {
1771                                 Status status = GDIPlus.GdipSetPixelOffsetMode (nativeObject, value); 
1772                                 GDIPlus.CheckStatus (status);
1773                         }
1774                 }
1775
1776                 public Point RenderingOrigin {
1777                         get {
1778                                 int x, y;
1779                                 Status status = GDIPlus.GdipGetRenderingOrigin (nativeObject, out x, out y);
1780                                 GDIPlus.CheckStatus (status);
1781                                 return new Point (x, y);
1782                         }
1783
1784                         set {
1785                                 Status status = GDIPlus.GdipSetRenderingOrigin (nativeObject, value.X, value.Y);
1786                                 GDIPlus.CheckStatus (status);
1787                         }
1788                 }
1789
1790                 public SmoothingMode SmoothingMode {
1791                         get {
1792                                 SmoothingMode mode = SmoothingMode.Invalid;
1793
1794                                 Status status = GDIPlus.GdipGetSmoothingMode (nativeObject, out mode);
1795                                 GDIPlus.CheckStatus (status);
1796                                 return mode;
1797                         }
1798
1799                         set {
1800                                 Status status = GDIPlus.GdipSetSmoothingMode (nativeObject, value);
1801                                 GDIPlus.CheckStatus (status);
1802                         }
1803                 }
1804
1805                 public int TextContrast {
1806                         get {   
1807                                 int contrast;
1808                                         
1809                                 Status status = GDIPlus.GdipGetTextContrast (nativeObject, out contrast);
1810                                 GDIPlus.CheckStatus (status);
1811                                 return contrast;
1812                         }
1813
1814                         set {
1815                                 Status status = GDIPlus.GdipSetTextContrast (nativeObject, value);
1816                                 GDIPlus.CheckStatus (status);
1817                         }
1818                 }
1819
1820                 public TextRenderingHint TextRenderingHint {
1821                         get {
1822                                 TextRenderingHint hint;
1823
1824                                 Status status = GDIPlus.GdipGetTextRenderingHint (nativeObject, out hint);
1825                                 GDIPlus.CheckStatus (status);
1826                                 return hint;        
1827                         }
1828
1829                         set {
1830                                 Status status = GDIPlus.GdipSetTextRenderingHint (nativeObject, value);
1831                                 GDIPlus.CheckStatus (status);
1832                         }
1833                 }
1834
1835                 public Matrix Transform {
1836                         get {
1837                                 Matrix matrix = new Matrix ();
1838                                 Status status = GDIPlus.GdipGetWorldTransform (nativeObject, matrix.nativeMatrix);
1839                                 GDIPlus.CheckStatus (status);
1840                                 return matrix;
1841                         }
1842                         set {
1843                                 Status status = GDIPlus.GdipSetWorldTransform (nativeObject, value.nativeMatrix);
1844                                 GDIPlus.CheckStatus (status);
1845                         }
1846                 }
1847
1848                 public RectangleF VisibleClipBounds {
1849                         get {
1850                                 RectangleF rect;
1851                                         
1852                                 Status status = GDIPlus.GdipGetVisibleClipBounds (nativeObject, out rect);
1853                                 GDIPlus.CheckStatus (status);
1854                                 return rect;
1855                         }
1856                 }
1857         }
1858 }
1859