2 // System.Drawing.Graphics.cs
4 // (C) 2003 Ximian, Inc. http://www.ximian.com
7 // Gonzalo Paniagua Javier (gonzalo@ximian.com) (stubbed out)
8 // Alexandre Pigolkine(pigolkine@gmx.de)
11 using System.Drawing.Drawing2D;
12 using System.Drawing.Imaging;
13 using System.Drawing.Text;
14 using System.Runtime.InteropServices;
16 namespace System.Drawing
19 public sealed class Graphics : MarshalByRefObject, IDisposable
21 internal IntPtr nativeObject = IntPtr.Zero;
23 public delegate bool EnumerateMetafileProc (EmfPlusRecordType recordType,
27 PlayRecordCallback callbackData);
29 public delegate bool DrawImageAbort (IntPtr callbackData);
31 private Graphics (IntPtr nativeGraphics)
33 nativeObject = nativeGraphics;
37 public void AddMetafileComment (byte [] data)
39 throw new NotImplementedException ();
43 public GraphicsContainer BeginContainer ()
45 throw new NotImplementedException ();
49 public GraphicsContainer BeginContainer (Rectangle dstrect, Rectangle srcrect, GraphicsUnit unit)
51 throw new NotImplementedException ();
55 public GraphicsContainer BeginContainer (RectangleF dstrect, RectangleF srcrect, GraphicsUnit unit)
57 throw new NotImplementedException ();
61 public void Clear (Color color)
63 Status status = GDIPlus.GdipGraphicsClear(nativeObject, color.ToArgb());
65 if (status != Status.Ok)
66 throw new ArgumentException ("Error calling GDIPlus.GdipGraphicsClear:" +status);
70 public void Dispose ()
75 public void DrawArc (Pen pen, Rectangle rect, float startAngle, float sweepAngle)
77 DrawArc (pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
81 public void DrawArc (Pen pen, RectangleF rect, float startAngle, float sweepAngle)
83 DrawArc (pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
87 public void DrawArc (Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)
89 Status status = GDIPlus.GdipDrawArc (nativeObject, pen.nativeObject,
90 x, y, width, height, startAngle, sweepAngle);
92 if (status != Status.Ok)
93 throw new ArgumentException ("Error calling GDIPlus.GdipGraphicsClear:" +status);
96 public void DrawArc (Pen pen, int x, int y, int width, int height, float startAngle, float sweepAngle)
98 Status status = GDIPlus.GdipDrawArcI (nativeObject, pen.nativeObject,
99 x, y, width, height, startAngle, sweepAngle);
101 if (status != Status.Ok)
102 throw new ArgumentException ("Error calling GDIPlus.GdipGraphicsClear:" +status);
106 public void DrawBezier (Pen pen, PointF pt1, PointF pt2, PointF pt3, PointF pt4)
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);
111 if (status != Status.Ok)
112 throw new ArgumentException ("Error calling GDIPlus.DrawBezier:" +status);
115 public void DrawBezier (Pen pen, Point pt1, Point pt2, Point pt3, Point pt4)
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);
120 if (status != Status.Ok)
121 throw new ArgumentException ("Error calling GDIPlus.GdipDrawBezierI:" +status);
124 public void DrawBezier (Pen pen, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
126 Status status = GDIPlus.GdipDrawBezier (nativeObject, pen.nativeObject, x1, y1, x2, y2, x3, y3, x4, y4);
128 if (status != Status.Ok)
129 throw new ArgumentException ("Error calling GDIPlus.GdipDrawBezier:" +status);
133 public void DrawBeziers (Pen pen, Point [] points)
135 int length = points.Length;
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];
146 GDIPlus.GdipDrawBezier (nativeObject, pen.nativeObject,
147 p1.X, p1.Y, p2.X, p2.Y,
148 p3.X, p3.Y, p4.X, p4.Y);
153 public void DrawBeziers (Pen pen, PointF [] points)
155 int length = points.Length;
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];
166 GDIPlus.GdipDrawBezier (nativeObject, pen.nativeObject,
167 p1.X, p1.Y, p2.X, p2.Y,
168 p3.X, p3.Y, p4.X, p4.Y);
173 public void DrawClosedCurve (Pen pen, PointF [] points)
175 Status status = GDIPlus.GdipDrawClosedCurve(nativeObject, pen.nativeObject, points, points.Length);
177 if (status != Status.Ok)
178 throw new ArgumentException ("Error calling GDIPlus.GdipDrawClosedCurve:" +status);
182 public void DrawClosedCurve (Pen pen, Point [] points)
184 Status status = GDIPlus.GdipDrawClosedCurveI(nativeObject, pen.nativeObject, points, points.Length);
186 if (status != Status.Ok)
187 throw new ArgumentException ("Error calling GDIPlus.GdipDrawClosedCurveI:" +status);
190 public void DrawClosedCurve (Pen pen, Point [] points, float tension, FillMode fillmode)
192 Status status = GDIPlus.GdipDrawClosedCurve2I(nativeObject, pen.nativeObject, points, points.Length, tension);
194 if (status != Status.Ok)
195 throw new ArgumentException ("Error calling GDIPlus.GdipDrawClosedCurve2I:" +status);
199 public void DrawClosedCurve (Pen pen, PointF [] points, float tension, FillMode fillmode)
201 Status status = GDIPlus.GdipDrawClosedCurve2(nativeObject, pen.nativeObject, points, points.Length, tension);
203 if (status != Status.Ok)
204 throw new ArgumentException ("Error calling GDIPlus.GdipDrawClosedCurve2:" +status);
208 public void DrawCurve (Pen pen, Point [] points)
210 Status status = GDIPlus.GdipDrawCurveI(nativeObject, pen.nativeObject, points, points.Length);
212 if (status != Status.Ok)
213 throw new ArgumentException ("Error calling GDIPlus.GdipDrawCurveI:" +status);
216 public void DrawCurve (Pen pen, PointF [] points)
218 Status status = GDIPlus.GdipDrawCurve(nativeObject, pen.nativeObject, points, points.Length);
220 if (status != Status.Ok)
221 throw new ArgumentException ("Error calling GDIPlus.GdipDrawCurve:" +status);
224 public void DrawCurve (Pen pen, PointF [] points, float tension)
226 Status status = GDIPlus.GdipDrawCurve2(nativeObject, pen.nativeObject, points, points.Length, tension);
228 if (status != Status.Ok)
229 throw new ArgumentException ("Error calling GDIPlus.GdipDrawCurve2:" +status);
232 public void DrawCurve (Pen pen, Point [] points, float tension)
234 Status status = GDIPlus.GdipDrawCurve2I(nativeObject, pen.nativeObject, points, points.Length, tension);
236 if (status != Status.Ok)
237 throw new ArgumentException ("Error calling GDIPlus.GdipDrawCurve2I:" +status);
241 public void DrawCurve (Pen pen, PointF [] points, int offset, int numberOfSegments)
246 public void DrawCurve (Pen pen, Point [] points, int offset, int numberOfSegments, float tension)
248 Status status = GDIPlus.GdipDrawCurve3I(nativeObject, pen.nativeObject, points, points.Length, offset, numberOfSegments, tension);
250 if (status != Status.Ok)
251 throw new ArgumentException ("Error calling GDIPlus.GdipDrawCurve3:" +status);
255 public void DrawCurve (Pen pen, PointF [] points, int offset, int numberOfSegments, float tension)
257 Status status = GDIPlus.GdipDrawCurve3(nativeObject, pen.nativeObject, points, points.Length, offset, numberOfSegments, tension);
259 if (status != Status.Ok)
260 throw new ArgumentException ("Error calling GDIPlus.GdipDrawCurve3:" +status);
263 public void DrawEllipse (Pen pen, Rectangle rect)
265 DrawEllipse (pen, rect.X, rect.Y, rect.Width, rect.Height);
268 public void DrawEllipse (Pen pen, RectangleF rect)
270 DrawEllipse (pen, rect.X, rect.Y, rect.Width, rect.Height);
273 public void DrawEllipse (Pen pen, int x, int y, int width, int height)
275 GDIPlus.GdipDrawEllipseI (nativeObject, pen.nativeObject, x, y, width, height);
278 public void DrawEllipse (Pen pen, float x, float y, float width, float height)
280 GDIPlus.GdipDrawEllipse (nativeObject, pen.nativeObject, x, y, width, height);
284 public void DrawIcon (Icon icon, Rectangle targetRect)
286 throw new NotImplementedException ();
290 public void DrawIcon (Icon icon, int x, int y)
292 throw new NotImplementedException ();
296 public void DrawIconUnstretched (Icon icon, Rectangle targetRect)
298 throw new NotImplementedException ();
302 public void DrawImage (Image image, RectangleF rect)
304 throw new NotImplementedException ();
308 public void DrawImage (Image image, PointF point)
310 Status status = GDIPlus.GdipDrawImage(nativeObject, image.NativeObject, point.X, point.Y);
312 if (status != Status.Ok)
313 throw new ArgumentException ("Error calling GDIPlus.DrawImage (Image image, PointF point):" +status);
317 public void DrawImage (Image image, Point [] destPoints)
319 throw new NotImplementedException ();
323 public void DrawImage (Image image, Point point)
325 throw new NotImplementedException ();
329 public void DrawImage (Image image, Rectangle rect)
331 throw new NotImplementedException ();
335 public void DrawImage (Image image, PointF [] destPoints)
337 throw new NotImplementedException ();
341 public void DrawImage (Image image, int x, int y)
343 throw new NotImplementedException ();
347 public void DrawImage (Image image, float x, float y)
349 throw new NotImplementedException ();
353 public void DrawImage (Image image, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit)
355 throw new NotImplementedException ();
359 public void DrawImage (Image image, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit)
361 throw new NotImplementedException ();
365 public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit)
367 throw new NotImplementedException ();
371 public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit)
373 throw new NotImplementedException ();
377 public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr)
379 throw new NotImplementedException ();
383 public void DrawImage (Image image, float x, float y, float width, float height)
385 throw new NotImplementedException ();
389 public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr)
391 throw new NotImplementedException ();
395 public void DrawImage (Image image, int x, int y, Rectangle srcRect, GraphicsUnit srcUnit)
397 throw new NotImplementedException ();
401 public void DrawImage (Image image, int x, int y, int width, int height)
403 GDIPlus.GdipDrawImageRectI (nativeObject, image.nativeObject, x, y, width, height);
407 public void DrawImage (Image image, float x, float y, RectangleF srcRect, GraphicsUnit srcUnit)
409 throw new NotImplementedException ();
413 public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
415 throw new NotImplementedException ();
419 public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
421 throw new NotImplementedException ();
425 public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, int callbackData)
427 throw new NotImplementedException ();
431 public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit)
433 throw new NotImplementedException ();
437 public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, int callbackData)
439 throw new NotImplementedException ();
443 public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit)
445 throw new NotImplementedException ();
449 public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs)
451 throw new NotImplementedException ();
454 public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr)
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);
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);
466 public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
468 throw new NotImplementedException ();
472 public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback)
474 throw new NotImplementedException ();
478 public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback, IntPtr callbackData)
480 throw new NotImplementedException ();
484 public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback, IntPtr callbackData)
486 throw new NotImplementedException ();
490 public void DrawImageUnscaled (Image image, Point point)
492 throw new NotImplementedException ();
496 public void DrawImageUnscaled (Image image, Rectangle rect)
498 throw new NotImplementedException ();
502 public void DrawImageUnscaled (Image image, int x, int y)
504 throw new NotImplementedException ();
508 public void DrawImageUnscaled (Image image, int x, int y, int width, int height)
510 throw new NotImplementedException ();
513 public void DrawLine (Pen pen, PointF pt1, PointF pt2)
516 Status status = GDIPlus.GdipDrawLine (
517 nativeObject, pen.nativeObject,
521 if (status != Status.Ok)
522 throw new ArgumentException ("Error calling GDIPlus.GdipDrawLine:" +status);
525 public void DrawLine (Pen pen, Point pt1, Point pt2)
527 Status status = GDIPlus.GdipDrawLineI (
528 nativeObject, pen.nativeObject,
532 if (status != Status.Ok)
533 throw new ArgumentException ("Error calling GDIPlus.GdipDrawLineI:" +status);
536 public void DrawLine (Pen pen, int x1, int y1, int x2, int y2)
538 Status status = GDIPlus.GdipDrawLineI (nativeObject, pen.nativeObject, x1, y1, x2, y2);
540 if (status != Status.Ok)
541 throw new ArgumentException ("Error calling GDIPlus.GdipDrawLineI:" +status);
544 public void DrawLine (Pen pen, float x1, float y1, float x2, float y2)
546 Status status = GDIPlus.GdipDrawLine (nativeObject, pen.nativeObject, x1, y1, x2, y2);
548 if (status != Status.Ok)
549 throw new ArgumentException ("Error calling GDIPlus.GdipDrawLine:" +status);
552 public void DrawLines (Pen pen, PointF [] points)
554 Status status = GDIPlus.GdipDrawLines (nativeObject, pen.nativeObject, points, points.Length);
556 if (status != Status.Ok)
557 throw new ArgumentException ("Error calling GDIPlus.GdipDrawLines:" +status);
560 public void DrawLines (Pen pen, Point [] points)
562 Status status = GDIPlus.GdipDrawLinesI (nativeObject, pen.nativeObject, points, points.Length);
564 if (status != Status.Ok)
565 throw new ArgumentException ("Error calling GDIPlus.GdipDrawLinesI:" +status);
568 public void DrawPath (Pen pen, GraphicsPath path)
570 GDIPlus.GdipDrawPath (nativeObject, pen.nativeObject, path.nativePath);
574 public void DrawPie (Pen pen, Rectangle rect, float startAngle, float sweepAngle)
576 DrawPie (pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
580 public void DrawPie (Pen pen, RectangleF rect, float startAngle, float sweepAngle)
582 DrawPie (pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
586 public void DrawPie (Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)
588 GDIPlus.GdipDrawPie (nativeObject, pen.nativeObject, x, y, width, height, startAngle, sweepAngle);
592 public void DrawPie (Pen pen, int x, int y, int width, int height, float startAngle, float sweepAngle)
594 GDIPlus.GdipDrawPieI (nativeObject, pen.nativeObject, x, y, width, height, startAngle, sweepAngle);
597 public void DrawPolygon (Pen pen, Point [] points)
599 GDIPlus.GdipDrawPolygonI (nativeObject, pen.nativeObject, points, points.Length);
602 public void DrawPolygon (Pen pen, PointF [] points)
604 GDIPlus.GdipDrawPolygon (nativeObject, pen.nativeObject, points, points.Length);
607 public void DrawRectangle (Pen pen, RectangleF rect)
609 DrawRectangle (pen, rect.Left, rect.Top, rect.Width, rect.Height);
612 public void DrawRectangle (Pen pen, Rectangle rect)
614 DrawRectangle (pen, rect.Left, rect.Top, rect.Width, rect.Height);
617 public void DrawRectangle (Pen pen, float x, float y, float width, float height)
619 GDIPlus.GdipDrawRectangle (nativeObject, pen.nativeObject, x, y, width, height);
622 public void DrawRectangle (Pen pen, int x, int y, int width, int height)
624 Console.WriteLine(" DrawRectangle (Pen pen, int x, int y, int width, int height)");
626 Console.WriteLine("Native->" + nativeObject);
628 Status status = GDIPlus.GdipDrawRectangleI (nativeObject, pen.nativeObject, x, y, width, height);
630 if (status != Status.Ok)
631 throw new ArgumentException ("Error calling GDIPlus.DrawRectangle:" +status);
634 public void DrawRectangles (Pen pen, RectangleF [] rects)
636 foreach (RectangleF rc in rects)
637 DrawRectangle (pen, rc.Left, rc.Top, rc.Width, rc.Height);
640 public void DrawRectangles (Pen pen, Rectangle [] rects)
642 foreach (RectangleF rc in rects)
643 DrawRectangle(pen, rc.Left, rc.Top, rc.Width, rc.Height);
646 [MonoTODO("Ignores the font")]
647 public void DrawString (string s, Font font, Brush brush, RectangleF layoutRectangle)
649 GDIPlus.GdipDrawString (nativeObject, s, s.Length, IntPtr.Zero, ref layoutRectangle, IntPtr.Zero, brush.nativeObject);
652 [MonoTODO("This ignores the font")]
653 public void DrawString (string s, Font font, Brush brush, PointF point)
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);
659 [MonoTODO ("This ignores the font and format")]
660 public void DrawString (string s, Font font, Brush brush, PointF point, StringFormat format)
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);
666 [MonoTODO ("This ignores the font and the format")]
667 public void DrawString (string s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format)
669 GDIPlus.GdipDrawString (nativeObject, s, s.Length, IntPtr.Zero, ref layoutRectangle, IntPtr.Zero, brush.nativeObject);
672 [MonoTODO("This ignores the font")]
673 public void DrawString (string s, Font font, Brush brush, float x, float y)
675 Console.WriteLine("DrawString!");
676 RectangleF rc = new RectangleF (x, y, 0, 0);
678 Status status = GDIPlus.GdipDrawString (nativeObject, s, s.Length, IntPtr.Zero,
679 ref rc, IntPtr.Zero, brush.nativeObject);
681 if (status != Status.Ok)
682 throw new ArgumentException ("Error calling GDIPlus.GdipDrawString(string s, Font font, Brush brush, float x, float y):" +s);
686 public void DrawString (string s, Font font, Brush brush, float x, float y, StringFormat format)
688 //throw new NotImplementedException ();
692 public void EndContainer (GraphicsContainer container)
694 throw new NotImplementedException ();
698 public void EnumerateMetafile (Metafile metafile, Point [] destPoints, EnumerateMetafileProc callback)
700 throw new NotImplementedException ();
704 public void EnumerateMetafile (Metafile metafile, RectangleF destRect, EnumerateMetafileProc callback)
706 throw new NotImplementedException ();
710 public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, EnumerateMetafileProc callback)
712 throw new NotImplementedException ();
716 public void EnumerateMetafile (Metafile metafile, Rectangle destRect, EnumerateMetafileProc callback)
718 throw new NotImplementedException ();
722 public void EnumerateMetafile (Metafile metafile, Point destPoint, EnumerateMetafileProc callback)
724 throw new NotImplementedException ();
728 public void EnumerateMetafile (Metafile metafile, PointF destPoint, EnumerateMetafileProc callback)
730 throw new NotImplementedException ();
734 public void EnumerateMetafile (Metafile metafile, PointF destPoint, EnumerateMetafileProc callback, IntPtr callbackData)
736 throw new NotImplementedException ();
740 public void EnumerateMetafile (Metafile metafile, Rectangle destRect, EnumerateMetafileProc callback, IntPtr callbackData)
742 throw new NotImplementedException ();
746 public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, EnumerateMetafileProc callback, IntPtr callbackData)
748 throw new NotImplementedException ();
752 public void EnumerateMetafile (Metafile metafile, Point destPoint, EnumerateMetafileProc callback, IntPtr callbackData)
754 throw new NotImplementedException ();
758 public void EnumerateMetafile (Metafile metafile, Point [] destPoints, EnumerateMetafileProc callback, IntPtr callbackData)
760 throw new NotImplementedException ();
764 public void EnumerateMetafile (Metafile metafile, RectangleF destRect, EnumerateMetafileProc callback, IntPtr callbackData)
766 throw new NotImplementedException ();
770 public void EnumerateMetafile (Metafile metafile, PointF destPoint, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
772 throw new NotImplementedException ();
776 public void EnumerateMetafile (Metafile metafile, Point destPoint, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
778 throw new NotImplementedException ();
782 public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
784 throw new NotImplementedException ();
788 public void EnumerateMetafile (Metafile metafile, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
790 throw new NotImplementedException ();
794 public void EnumerateMetafile (Metafile metafile, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
796 throw new NotImplementedException ();
800 public void EnumerateMetafile (Metafile metafile, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
802 throw new NotImplementedException ();
806 public void EnumerateMetafile (Metafile metafile, RectangleF destRect, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
808 throw new NotImplementedException ();
812 public void EnumerateMetafile (Metafile metafile, Point destPoint, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
814 throw new NotImplementedException ();
818 public void EnumerateMetafile (Metafile metafile, PointF destPoint, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
820 throw new NotImplementedException ();
824 public void EnumerateMetafile (Metafile metafile, Point [] destPoints, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
826 throw new NotImplementedException ();
830 public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
832 throw new NotImplementedException ();
836 public void EnumerateMetafile (Metafile metafile, Rectangle destRect, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
838 throw new NotImplementedException ();
842 public void EnumerateMetafile (Metafile metafile, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
844 throw new NotImplementedException ();
848 public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
850 throw new NotImplementedException ();
854 public void EnumerateMetafile (Metafile metafile, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
856 throw new NotImplementedException ();
860 public void EnumerateMetafile (Metafile metafile, PointF destPoint, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
862 throw new NotImplementedException ();
866 public void EnumerateMetafile (Metafile metafile, Point destPoint, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
868 throw new NotImplementedException ();
872 public void EnumerateMetafile (Metafile metafile, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
874 throw new NotImplementedException ();
878 public void EnumerateMetafile (Metafile metafile, Point [] destPoints, Rectangle srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
880 throw new NotImplementedException ();
884 public void EnumerateMetafile (Metafile metafile, Rectangle destRect, Rectangle srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
886 throw new NotImplementedException ();
890 public void EnumerateMetafile (Metafile metafile, Point destPoint, Rectangle srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
892 throw new NotImplementedException ();
896 public void EnumerateMetafile (Metafile metafile, RectangleF destRect, RectangleF srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
898 throw new NotImplementedException ();
902 public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, RectangleF srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
904 throw new NotImplementedException ();
908 public void EnumerateMetafile (Metafile metafile, PointF destPoint, RectangleF srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
910 throw new NotImplementedException ();
914 public void ExcludeClip (Rectangle rect)
916 throw new NotImplementedException ();
920 public void ExcludeClip (Region region)
922 throw new NotImplementedException ();
926 public void FillClosedCurve (Brush brush, PointF [] points)
928 throw new NotImplementedException ();
932 public void FillClosedCurve (Brush brush, Point [] points)
934 throw new NotImplementedException ();
938 public void FillClosedCurve (Brush brush, PointF [] points, FillMode fillmode)
940 throw new NotImplementedException ();
944 public void FillClosedCurve (Brush brush, Point [] points, FillMode fillmode)
946 throw new NotImplementedException ();
950 public void FillClosedCurve (Brush brush, PointF [] points, FillMode fillmode, float tension)
952 throw new NotImplementedException ();
956 public void FillClosedCurve (Brush brush, Point [] points, FillMode fillmode, float tension)
958 throw new NotImplementedException ();
961 public void FillEllipse (Brush brush, Rectangle rect)
963 FillEllipse (brush, rect.X, rect.Y, rect.Width, rect.Height);
966 public void FillEllipse (Brush brush, RectangleF rect)
968 FillEllipse (brush, rect.X, rect.Y, rect.Width, rect.Height);
971 public void FillEllipse (Brush brush, float x, float y, float width, float height)
973 GDIPlus.GdipFillEllipse (nativeObject, brush.nativeObject, x, y, width, height);
976 public void FillEllipse (Brush brush, int x, int y, int width, int height)
978 GDIPlus.GdipFillEllipseI (nativeObject, brush.nativeObject, x, y, width, height);
982 public void FillPath (Brush brush, GraphicsPath path)
984 throw new NotImplementedException ();
988 public void FillPie (Brush brush, Rectangle rect, float startAngle, float sweepAngle)
990 throw new NotImplementedException ();
994 public void FillPie (Brush brush, int x, int y, int width, int height, int startAngle, int sweepAngle)
996 throw new NotImplementedException ();
1000 public void FillPie (Brush brush, float x, float y, float width, float height, float startAngle, float sweepAngle)
1002 throw new NotImplementedException ();
1005 public void FillPolygon (Brush brush, PointF [] points)
1007 GDIPlus.GdipFillPolygon2 (nativeObject, brush.nativeObject, points, points.Length);
1010 public void FillPolygon (Brush brush, Point [] points)
1012 GDIPlus.GdipFillPolygon2I (nativeObject, brush.nativeObject, points, points.Length);
1015 public void FillPolygon (Brush brush, Point [] points, FillMode fillMode)
1017 GDIPlus.GdipFillPolygonI (nativeObject, brush.nativeObject, points, points.Length, fillMode);
1020 public void FillPolygon (Brush brush, PointF [] points, FillMode fillMode)
1022 GDIPlus.GdipFillPolygon (nativeObject, brush.nativeObject, points, points.Length, fillMode);
1025 public void FillRectangle (Brush brush, RectangleF rect)
1027 FillRectangle (brush, rect.Left, rect.Top, rect.Width, rect.Height);
1030 public void FillRectangle (Brush brush, Rectangle rect)
1032 FillRectangle (brush, rect.Left, rect.Top, rect.Width, rect.Height);
1035 public void FillRectangle (Brush brush, int x, int y, int width, int height)
1037 GDIPlus.GdipFillRectangle (nativeObject, brush.nativeObject, (float)x, (float)y, (float)width, (float)height);
1040 public void FillRectangle (Brush brush, float x, float y, float width, float height)
1042 GDIPlus.GdipFillRectangle (nativeObject, brush.nativeObject, x, y, width, height);
1045 public void FillRectangles (Brush brush, Rectangle [] rects)
1047 foreach (Rectangle rc in rects)
1048 FillRectangle(brush, rc);
1051 public void FillRectangles (Brush brush, RectangleF [] rects)
1053 foreach (RectangleF rc in rects)
1054 FillRectangle(brush, rc);
1058 public void FillRegion (Brush brush, Region region)
1060 throw new NotImplementedException ();
1064 public void Flush ()
1066 Flush(FlushIntention.Flush);
1070 public void Flush (FlushIntention intention)
1072 throw new NotImplementedException ();
1076 public static Graphics FromHdc (IntPtr hdc)
1079 GDIPlus.GdipCreateFromHDC (hdc, out graphics);
1080 Graphics result = new Graphics ((IntPtr)graphics);
1085 public static Graphics FromHdc (IntPtr hdc, IntPtr hdevice)
1087 throw new NotImplementedException ();
1091 public static Graphics FromHdcInternal (IntPtr hdc)
1093 throw new NotImplementedException ();
1096 public static Graphics FromHwnd (IntPtr hwnd)
1100 Status status = GDIPlus.GdipCreateFromHWND(hwnd, out graphics);
1102 if (status != Status.Ok)
1103 throw new ArgumentException ("Error calling GDIPlus.GdipCreateFromHWND:" +status);
1105 return new Graphics(graphics);
1109 public static Graphics FromHwndInternal (IntPtr hwnd)
1111 throw new NotImplementedException ();
1115 public static Graphics FromImage (Image image)
1117 if (image == null) throw new ArgumentException ();
1119 GDIPlus.GdipGetImageGraphicsContext (image.nativeObject, out graphics);
1120 Graphics result = new Graphics ((IntPtr)graphics);
1125 public static IntPtr GetHalftonePalette ()
1127 throw new NotImplementedException ();
1131 public IntPtr GetHdc ()
1134 GDIPlus.GdipGetDC (nativeObject, out hdc);
1139 public Color GetNearestColor (Color color)
1141 throw new NotImplementedException ();
1145 public void IntersectClip (Region region)
1147 throw new NotImplementedException ();
1151 public void IntersectClip (RectangleF rect)
1153 throw new NotImplementedException ();
1157 public void IntersectClip (Rectangle rect)
1159 throw new NotImplementedException ();
1163 public bool IsVisible (Point point)
1165 throw new NotImplementedException ();
1169 public bool IsVisible (RectangleF rect)
1171 throw new NotImplementedException ();
1175 public bool IsVisible (PointF point)
1177 throw new NotImplementedException ();
1181 public bool IsVisible (Rectangle rect)
1183 throw new NotImplementedException ();
1187 public bool IsVisible (float x, float y)
1189 throw new NotImplementedException ();
1193 public bool IsVisible (int x, int y)
1195 throw new NotImplementedException ();
1199 public bool IsVisible (float x, float y, float width, float height)
1201 throw new NotImplementedException ();
1205 public bool IsVisible (int x, int y, int width, int height)
1207 throw new NotImplementedException ();
1211 public Region [] MeasureCharacterRanges (string text, Font font, RectangleF layoutRect, StringFormat stringFormat)
1213 throw new NotImplementedException ();
1217 public SizeF MeasureString (string text, Font font)
1219 throw new NotImplementedException ();
1223 public SizeF MeasureString (string text, Font font, SizeF layoutArea)
1225 throw new NotImplementedException ();
1229 public SizeF MeasureString (string text, Font font, int width)
1231 throw new NotImplementedException ();
1235 public SizeF MeasureString (string text, Font font, SizeF layoutArea, StringFormat stringFormat)
1237 throw new NotImplementedException ();
1241 public SizeF MeasureString (string text, Font font, int width, StringFormat format)
1243 throw new NotImplementedException ();
1247 public SizeF MeasureString (string text, Font font, PointF origin, StringFormat stringFormat)
1249 throw new NotImplementedException ();
1253 public SizeF MeasureString (string text, Font font, SizeF layoutArea, StringFormat stringFormat, out int charactersFitted, out int linesFilled)
1255 throw new NotImplementedException ();
1258 public void MultiplyTransform (Matrix matrix)
1260 MultiplyTransform (matrix, MatrixOrder.Prepend);
1263 public void MultiplyTransform (Matrix matrix, MatrixOrder order)
1265 GDIPlus.GdipMultiplyWorldTransform (nativeObject, matrix.nativeMatrix, order);
1269 public void ReleaseHdc (IntPtr hdc)
1271 GDIPlus.GdipReleaseDC (nativeObject, hdc);
1275 public void ReleaseHdcInternal (IntPtr hdc)
1277 throw new NotImplementedException ();
1281 public void ResetClip ()
1283 throw new NotImplementedException ();
1286 public void ResetTransform ()
1288 GDIPlus.GdipResetWorldTransform (nativeObject);
1292 public void Restore (GraphicsState gstate)
1294 Transform = gstate.matrix.Clone();
1295 GDIPlus.GdipRestoreGraphics (nativeObject, gstate.nativeState);
1299 public void RotateTransform (float angle)
1301 RotateTransform(angle, MatrixOrder.Prepend);
1305 public void RotateTransform (float angle, MatrixOrder order)
1307 //transform.Rotate(angle, order);
1308 GDIPlus.GdipRotateWorldTransform (nativeObject, angle, order);
1312 public GraphicsState Save ()
1314 //return implementation.Save();
1315 GraphicsState state = new GraphicsState();
1316 state.matrix = Transform.Clone();
1318 GDIPlus.GdipSaveGraphics (nativeObject, out saveState);
1319 state.nativeState = saveState;
1323 public void ScaleTransform (float sx, float sy)
1325 ScaleTransform (sx, sy, MatrixOrder.Prepend);
1328 public void ScaleTransform (float sx, float sy, MatrixOrder order)
1330 GDIPlus.GdipScaleWorldTransform (nativeObject, sx, sy, order);
1334 public void SetClip (RectangleF rect)
1336 throw new NotImplementedException ();
1340 public void SetClip (GraphicsPath path)
1342 throw new NotImplementedException ();
1346 public void SetClip (Rectangle rect)
1348 throw new NotImplementedException ();
1352 public void SetClip (Graphics g)
1354 throw new NotImplementedException ();
1358 public void SetClip (Graphics g, CombineMode combineMode)
1360 throw new NotImplementedException ();
1364 public void SetClip (Rectangle rect, CombineMode combineMode)
1366 throw new NotImplementedException ();
1370 public void SetClip (RectangleF rect, CombineMode combineMode)
1372 throw new NotImplementedException ();
1376 public void SetClip (Region region, CombineMode combineMode)
1378 throw new NotImplementedException ();
1382 public void SetClip (GraphicsPath path, CombineMode combineMode)
1384 throw new NotImplementedException ();
1388 public void TransformPoints (CoordinateSpace destSpace, CoordinateSpace srcSpace, PointF [] pts)
1390 throw new NotImplementedException ();
1394 public void TransformPoints (CoordinateSpace destSpace, CoordinateSpace srcSpace, Point [] pts)
1396 throw new NotImplementedException ();
1400 public void TranslateClip (int dx, int dy)
1402 throw new NotImplementedException ();
1406 public void TranslateClip (float dx, float dy)
1408 throw new NotImplementedException ();
1411 public void TranslateTransform (float dx, float dy)
1413 TranslateTransform (dx, dy, MatrixOrder.Prepend);
1417 public void TranslateTransform (float dx, float dy, MatrixOrder order)
1419 //transform.Translate(dx, dy, order);
1420 GDIPlus.GdipTranslateWorldTransform (nativeObject, dx, dy, order);
1423 public Region Clip {
1425 throw new NotImplementedException ();
1428 //throw new NotImplementedException ();
1432 public RectangleF ClipBounds {
1434 throw new NotImplementedException ();
1438 public CompositingMode CompositingMode {
1440 throw new NotImplementedException ();
1443 throw new NotImplementedException ();
1448 public CompositingQuality CompositingQuality {
1450 throw new NotImplementedException ();
1453 throw new NotImplementedException ();
1459 throw new NotImplementedException ();
1465 throw new NotImplementedException ();
1469 public InterpolationMode InterpolationMode {
1471 throw new NotImplementedException ();
1474 throw new NotImplementedException ();
1478 public bool IsClipEmpty {
1480 throw new NotImplementedException ();
1484 public bool IsVisibleClipEmpty {
1486 throw new NotImplementedException ();
1490 public float PageScale {
1492 throw new NotImplementedException ();
1495 throw new NotImplementedException ();
1499 public GraphicsUnit PageUnit {
1501 throw new NotImplementedException ();
1504 throw new NotImplementedException ();
1508 public PixelOffsetMode PixelOffsetMode {
1510 throw new NotImplementedException ();
1513 throw new NotImplementedException ();
1517 public Point RenderingOrigin {
1520 GDIPlus.GdipGetRenderingOrigin (
1521 nativeObject, out x, out y);
1523 return new Point (x, y);
1527 GDIPlus.GdipSetRenderingOrigin (nativeObject, value.X, value.Y);
1531 public SmoothingMode SmoothingMode {
1533 throw new NotImplementedException ();
1536 throw new NotImplementedException ();
1540 public int TextContrast {
1542 throw new NotImplementedException ();
1545 throw new NotImplementedException ();
1549 public TextRenderingHint TextRenderingHint {
1551 throw new NotImplementedException ();
1554 throw new NotImplementedException ();
1558 public Matrix Transform {
1560 Matrix matrix = new Matrix ();
1561 GDIPlus.GdipGetWorldTransform (nativeObject, matrix.nativeMatrix);
1566 GDIPlus.GdipSetWorldTransform (nativeObject, value.nativeMatrix);
1570 public RectangleF VisibleClipBounds {
1572 throw new NotImplementedException ();