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