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)
9 // Jordi Mas i Hernandez (jordi@ximian.com)
12 using System.Drawing.Drawing2D;
13 using System.Drawing.Imaging;
14 using System.Drawing.Text;
15 using System.Runtime.InteropServices;
18 namespace System.Drawing
21 public sealed class Graphics : MarshalByRefObject, IDisposable
23 internal IntPtr nativeObject = IntPtr.Zero;
24 internal static float defDpiX = 0;
25 internal static float defDpiY = 0;
27 public delegate bool EnumerateMetafileProc (EmfPlusRecordType recordType,
31 PlayRecordCallback callbackData);
33 public delegate bool DrawImageAbort (IntPtr callbackData);
35 private Graphics (IntPtr nativeGraphics)
37 if (nativeGraphics == IntPtr.Zero)
38 Console.WriteLine ("Here: " + Environment.StackTrace);
39 nativeObject = nativeGraphics;
42 static internal float systemDpiX {
45 Bitmap bmp = new Bitmap(1,1);
46 Graphics g = Graphics.FromImage(bmp);
53 static internal float systemDpiY {
56 Bitmap bmp = new Bitmap(1,1);
57 Graphics g = Graphics.FromImage(bmp);
64 internal IntPtr NativeObject {
75 public void AddMetafileComment (byte [] data)
77 throw new NotImplementedException ();
81 public GraphicsContainer BeginContainer ()
85 GDIPlus.GdipBeginContainer2 (nativeObject, out state);
87 return new GraphicsContainer(state);
90 public GraphicsContainer BeginContainer (Rectangle dstrect, Rectangle srcrect, GraphicsUnit unit)
94 GDIPlus.GdipBeginContainerI (nativeObject, dstrect, srcrect, unit, out state);
96 return new GraphicsContainer (state);
100 public GraphicsContainer BeginContainer (RectangleF dstrect, RectangleF srcrect, GraphicsUnit unit)
104 GDIPlus.GdipBeginContainer (nativeObject, dstrect, srcrect, unit, out state);
106 return new GraphicsContainer (state);
110 public void Clear (Color color)
112 GDIPlus.GdipGraphicsClear(nativeObject, color.ToArgb());
116 public void Dispose ()
121 public void DrawArc (Pen pen, Rectangle rect, float startAngle, float sweepAngle)
123 DrawArc (pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
127 public void DrawArc (Pen pen, RectangleF rect, float startAngle, float sweepAngle)
129 DrawArc (pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
133 public void DrawArc (Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)
135 GDIPlus.GdipDrawArc (nativeObject, pen.nativeObject,
136 x, y, width, height, startAngle, sweepAngle);
139 // Microsoft documentation states that the signature for this member should be
140 // public void DrawArc( Pen pen, int x, int y, int width, int height, int startAngle,
141 // int sweepAngle. However, GdipDrawArcI uses also float for the startAngle and sweepAngle params
142 public void DrawArc (Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle)
144 GDIPlus.GdipDrawArcI (nativeObject, pen.nativeObject,
145 x, y, width, height, startAngle, sweepAngle);
149 public void DrawBezier (Pen pen, PointF pt1, PointF pt2, PointF pt3, PointF pt4)
151 GDIPlus.GdipDrawBezier (nativeObject, pen.nativeObject,
152 pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y);
156 public void DrawBezier (Pen pen, Point pt1, Point pt2, Point pt3, Point pt4)
158 GDIPlus.GdipDrawBezierI (nativeObject, pen.nativeObject,
159 pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y);
163 public void DrawBezier (Pen pen, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
165 GDIPlus.GdipDrawBezier (nativeObject, pen.nativeObject, x1, y1, x2, y2, x3, y3, x4, y4);
169 public void DrawBeziers (Pen pen, Point [] points)
171 int length = points.Length;
176 for (int i = 0; i < length; i += 3) {
177 Point p1 = points [i];
178 Point p2 = points [i + 1];
179 Point p3 = points [i + 2];
180 Point p4 = points [i + 3];
182 GDIPlus.GdipDrawBezier (nativeObject, pen.nativeObject,
183 p1.X, p1.Y, p2.X, p2.Y,
184 p3.X, p3.Y, p4.X, p4.Y);
189 public void DrawBeziers (Pen pen, PointF [] points)
191 int length = points.Length;
196 for (int i = 0; i < length; i += 3) {
197 PointF p1 = points [i];
198 PointF p2 = points [i + 1];
199 PointF p3 = points [i + 2];
200 PointF p4 = points [i + 3];
202 GDIPlus.GdipDrawBezier (nativeObject, pen.nativeObject,
203 p1.X, p1.Y, p2.X, p2.Y,
204 p3.X, p3.Y, p4.X, p4.Y);
209 public void DrawClosedCurve (Pen pen, PointF [] points)
211 GDIPlus.GdipDrawClosedCurve (nativeObject, pen.nativeObject, points, points.Length);
214 public void DrawClosedCurve (Pen pen, Point [] points)
216 GDIPlus.GdipDrawClosedCurveI (nativeObject, pen.nativeObject, points, points.Length);
219 public void DrawClosedCurve (Pen pen, Point [] points, float tension, FillMode fillmode)
221 GDIPlus.GdipDrawClosedCurve2I (nativeObject, pen.nativeObject, points, points.Length, tension);
224 public void DrawClosedCurve (Pen pen, PointF [] points, float tension, FillMode fillmode)
226 GDIPlus.GdipDrawClosedCurve2 (nativeObject, pen.nativeObject, points, points.Length, tension);
229 public void DrawCurve (Pen pen, Point [] points)
231 GDIPlus.GdipDrawCurveI (nativeObject, pen.nativeObject, points, points.Length);
234 public void DrawCurve (Pen pen, PointF [] points)
236 GDIPlus.GdipDrawCurve (nativeObject, pen.nativeObject, points, points.Length);
239 public void DrawCurve (Pen pen, PointF [] points, float tension)
241 GDIPlus.GdipDrawCurve2 (nativeObject, pen.nativeObject, points, points.Length, tension);
244 public void DrawCurve (Pen pen, Point [] points, float tension)
246 GDIPlus.GdipDrawCurve2I (nativeObject, pen.nativeObject, points, points.Length, tension);
251 public void DrawCurve (Pen pen, PointF [] points, int offset, int numberOfSegments)
253 GDIPlus.GdipDrawCurve3 (nativeObject, pen.nativeObject, points, points.Length,
254 offset, numberOfSegments, 0.5f);
257 public void DrawCurve (Pen pen, Point [] points, int offset, int numberOfSegments, float tension)
259 GDIPlus.GdipDrawCurve3I (nativeObject, pen.nativeObject, points, points.Length,
260 offset, numberOfSegments, tension);
264 public void DrawCurve (Pen pen, PointF [] points, int offset, int numberOfSegments, float tension)
266 GDIPlus.GdipDrawCurve3 (nativeObject, pen.nativeObject, points, points.Length,
267 offset, numberOfSegments, tension);
270 public void DrawEllipse (Pen pen, Rectangle rect)
272 DrawEllipse (pen, rect.X, rect.Y, rect.Width, rect.Height);
275 public void DrawEllipse (Pen pen, RectangleF rect)
277 DrawEllipse (pen, rect.X, rect.Y, rect.Width, rect.Height);
280 public void DrawEllipse (Pen pen, int x, int y, int width, int height)
282 GDIPlus.GdipDrawEllipseI (nativeObject, pen.nativeObject, x, y, width, height);
285 public void DrawEllipse (Pen pen, float x, float y, float width, float height)
287 GDIPlus.GdipDrawEllipse (nativeObject, pen.nativeObject, x, y, width, height);
291 public void DrawIcon (Icon icon, Rectangle targetRect)
293 throw new NotImplementedException ();
297 public void DrawIcon (Icon icon, int x, int y)
299 throw new NotImplementedException ();
303 public void DrawIconUnstretched (Icon icon, Rectangle targetRect)
305 throw new NotImplementedException ();
308 public void DrawImage (Image image, RectangleF rect)
310 GDIPlus.GdipDrawImageRect(nativeObject, image.NativeObject, rect.X, rect.Y,
311 rect.Width, rect.Height);
315 public void DrawImage (Image image, PointF point)
317 GDIPlus.GdipDrawImage (nativeObject, image.NativeObject, point.X, point.Y);
321 public void DrawImage (Image image, Point [] destPoints)
323 GDIPlus.GdipDrawImagePointsI (nativeObject, image.NativeObject, destPoints, destPoints.Length);
327 public void DrawImage (Image image, Point point)
329 DrawImage (image, point.X, point.Y);
333 public void DrawImage (Image image, Rectangle rect)
335 DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height);
339 public void DrawImage (Image image, PointF [] destPoints)
341 GDIPlus.GdipDrawImagePoints (nativeObject, image.NativeObject, destPoints, destPoints.Length);
345 public void DrawImage (Image image, int x, int y)
347 GDIPlus.GdipDrawImageI (nativeObject, image.NativeObject, x, y);
351 public void DrawImage (Image image, float x, float y)
353 GDIPlus.GdipDrawImage (nativeObject, image.NativeObject, x, y);
357 public void DrawImage (Image image, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit)
359 GDIPlus.GdipDrawImageRectRectI (nativeObject, image.NativeObject,
360 destRect.X, destRect.Y, destRect.Width, destRect.Height,
361 srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height,
362 srcUnit, IntPtr.Zero, null, IntPtr.Zero);
365 public void DrawImage (Image image, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit)
367 GDIPlus.GdipDrawImageRectRect (nativeObject, image.NativeObject,
368 destRect.X, destRect.Y, destRect.Width, destRect.Height,
369 srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height,
370 srcUnit, IntPtr.Zero, null, IntPtr.Zero);
374 public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit)
376 GDIPlus.GdipDrawImagePointsRectI (nativeObject, image.NativeObject,
377 destPoints, destPoints.Length , srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height,
378 srcUnit, IntPtr.Zero, null, IntPtr.Zero);
383 public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit)
386 GDIPlus.GdipDrawImagePointsRect (nativeObject, image.NativeObject,
387 destPoints, destPoints.Length , srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height,
388 srcUnit, IntPtr.Zero, null, IntPtr.Zero);
392 public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit,
393 ImageAttributes imageAttr)
395 GDIPlus.GdipDrawImagePointsRectI (nativeObject, image.NativeObject,
396 destPoints, destPoints.Length , srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height,
397 srcUnit, imageAttr.NativeObject , null, IntPtr.Zero);
400 public void DrawImage (Image image, float x, float y, float width, float height)
402 GDIPlus.GdipDrawImageRect(nativeObject, image.NativeObject, x, y,
407 public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit,
408 ImageAttributes imageAttr)
410 GDIPlus.GdipDrawImagePointsRect (nativeObject, image.NativeObject,
411 destPoints, destPoints.Length , srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height,
412 srcUnit, imageAttr.NativeObject, null, IntPtr.Zero);
416 public void DrawImage (Image image, int x, int y, Rectangle srcRect, GraphicsUnit srcUnit)
418 GDIPlus.GdipDrawImagePointRectI(nativeObject, image.NativeObject, x, y,
419 srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit);
422 public void DrawImage (Image image, int x, int y, int width, int height)
424 GDIPlus.GdipDrawImageRectI (nativeObject, image.nativeObject, x, y, width, height);
427 public void DrawImage (Image image, float x, float y, RectangleF srcRect, GraphicsUnit srcUnit)
429 GDIPlus.GdipDrawImagePointRect(nativeObject, image.nativeObject, x, y, srcRect.X, srcRect.Y,
430 srcRect.Width, srcRect.Height, srcUnit);
434 public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit,
435 ImageAttributes imageAttr, DrawImageAbort callback)
437 GDIPlus.GdipDrawImagePointsRect (nativeObject, image.NativeObject,
438 destPoints, destPoints.Length , srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height,
439 srcUnit, imageAttr.NativeObject, callback, IntPtr.Zero);
443 public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit,
444 ImageAttributes imageAttr, DrawImageAbort callback)
447 GDIPlus.GdipDrawImagePointsRectI (nativeObject, image.NativeObject,
448 destPoints, destPoints.Length , srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height,
449 srcUnit, imageAttr.NativeObject, callback, IntPtr.Zero);
453 public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit,
454 ImageAttributes imageAttr, DrawImageAbort callback, int callbackData)
456 GDIPlus.GdipDrawImagePointsRectI (nativeObject, image.NativeObject,
457 destPoints, destPoints.Length , srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height,
458 srcUnit, imageAttr.NativeObject, callback, (IntPtr) callbackData);
462 public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight,
463 GraphicsUnit srcUnit)
465 GDIPlus.GdipDrawImageRectRect (nativeObject, image.NativeObject,
466 destRect.X, destRect.Y, destRect.Width, destRect.Height,
467 srcX, srcY, srcWidth, srcHeight, srcUnit, IntPtr.Zero,
471 public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit,
472 ImageAttributes imageAttr, DrawImageAbort callback, int callbackData)
474 GDIPlus.GdipDrawImagePointsRect (nativeObject, image.NativeObject,
475 destPoints, destPoints.Length , srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height,
476 srcUnit, imageAttr.NativeObject, callback, (IntPtr) callbackData);
480 public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight,
481 GraphicsUnit srcUnit)
483 GDIPlus.GdipDrawImageRectRectI (nativeObject, image.NativeObject,
484 destRect.X, destRect.Y, destRect.Width, destRect.Height,
485 srcX, srcY, srcWidth, srcHeight, srcUnit, IntPtr.Zero,
490 public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight,
491 GraphicsUnit srcUnit, ImageAttributes imageAttrs)
493 GDIPlus.GdipDrawImageRectRect (nativeObject, image.NativeObject,
494 destRect.X, destRect.Y, destRect.Width, destRect.Height,
495 srcX, srcY, srcWidth, srcHeight, srcUnit, imageAttrs.NativeObject,
500 public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight,
501 GraphicsUnit srcUnit, ImageAttributes imageAttr)
503 GDIPlus.GdipDrawImageRectRectI (nativeObject, image.NativeObject,
504 destRect.X, destRect.Y, destRect.Width, destRect.Height,
505 srcX, srcY, srcWidth, srcHeight, srcUnit, imageAttr.NativeObject,
510 public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight,
511 GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
513 GDIPlus.GdipDrawImageRectRectI (nativeObject, image.NativeObject,
514 destRect.X, destRect.Y, destRect.Width, destRect.Height,
515 srcX, srcY, srcWidth, srcHeight, srcUnit, imageAttr.NativeObject,
516 callback, IntPtr.Zero);
519 public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight,
520 GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
522 GDIPlus.GdipDrawImageRectRect (nativeObject, image.NativeObject,
523 destRect.X, destRect.Y, destRect.Width, destRect.Height,
524 srcX, srcY, srcWidth, srcHeight, srcUnit, imageAttr.NativeObject,
525 callback, IntPtr.Zero);
529 public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight,
530 GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, IntPtr callbackData)
532 GDIPlus.GdipDrawImageRectRect (nativeObject, image.NativeObject,
533 destRect.X, destRect.Y, destRect.Width, destRect.Height,
534 srcX, srcY, srcWidth, srcHeight, srcUnit, imageAttr.NativeObject,
535 callback, callbackData);
539 public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight,
540 GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, IntPtr callbackData)
542 GDIPlus.GdipDrawImageRectRect (nativeObject, image.NativeObject,
543 destRect.X, destRect.Y, destRect.Width, destRect.Height,
544 srcX, srcY, srcWidth, srcHeight, srcUnit, imageAttr.NativeObject,
545 callback, callbackData);
548 public void DrawImageUnscaled (Image image, Point point)
550 DrawImage(image, point.X, point.Y);
553 public void DrawImageUnscaled (Image image, Rectangle rect)
555 DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height);
558 public void DrawImageUnscaled (Image image, int x, int y)
560 DrawImage(image, x, y);
563 public void DrawImageUnscaled (Image image, int x, int y, int width, int height)
565 DrawImage(image, x, y, width, height);
568 public void DrawLine (Pen pen, PointF pt1, PointF pt2)
570 GDIPlus.GdipDrawLine (
571 nativeObject, pen.nativeObject,
577 public void DrawLine (Pen pen, Point pt1, Point pt2)
579 GDIPlus.GdipDrawLineI (
580 nativeObject, pen.nativeObject,
585 public void DrawLine (Pen pen, int x1, int y1, int x2, int y2)
587 GDIPlus.GdipDrawLineI (nativeObject, pen.nativeObject, x1, y1, x2, y2);
590 public void DrawLine (Pen pen, float x1, float y1, float x2, float y2)
592 GDIPlus.GdipDrawLine (nativeObject, pen.nativeObject, x1, y1, x2, y2);
595 public void DrawLines (Pen pen, PointF [] points)
597 GDIPlus.GdipDrawLines (nativeObject, pen.nativeObject, points, points.Length);
600 public void DrawLines (Pen pen, Point [] points)
602 GDIPlus.GdipDrawLinesI (nativeObject, pen.nativeObject, points, points.Length);
605 public void DrawPath (Pen pen, GraphicsPath path)
607 GDIPlus.GdipDrawPath (nativeObject, pen.nativeObject, path.nativePath);
610 public void DrawPie (Pen pen, Rectangle rect, float startAngle, float sweepAngle)
612 DrawPie (pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
615 public void DrawPie (Pen pen, RectangleF rect, float startAngle, float sweepAngle)
617 DrawPie (pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
620 public void DrawPie (Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)
622 GDIPlus.GdipDrawPie (nativeObject, pen.nativeObject, x, y, width, height, startAngle, sweepAngle);
625 // Microsoft documentation states that the signature for this member should be
626 // public void DrawPie(Pen pen, int x, int y, int width, int height, int startAngle
627 // int sweepAngle. However, GdipDrawPieI uses also float for the startAngle and sweepAngle params
628 public void DrawPie (Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle)
630 GDIPlus.GdipDrawPieI (nativeObject, pen.nativeObject, x, y, width, height, startAngle, sweepAngle);
633 public void DrawPolygon (Pen pen, Point [] points)
635 GDIPlus.GdipDrawPolygonI (nativeObject, pen.nativeObject, points, points.Length);
638 public void DrawPolygon (Pen pen, PointF [] points)
640 GDIPlus.GdipDrawPolygon (nativeObject, pen.nativeObject, points, points.Length);
643 public void DrawRectangle (Pen pen, RectangleF rect)
645 DrawRectangle (pen, rect.Left, rect.Top, rect.Width, rect.Height);
648 public void DrawRectangle (Pen pen, Rectangle rect)
650 DrawRectangle (pen, rect.Left, rect.Top, rect.Width, rect.Height);
653 public void DrawRectangle (Pen pen, float x, float y, float width, float height)
655 GDIPlus.GdipDrawRectangle (nativeObject, pen.nativeObject, x, y, width, height);
658 public void DrawRectangle (Pen pen, int x, int y, int width, int height)
660 GDIPlus.GdipDrawRectangleI (nativeObject, pen.nativeObject, x, y, width, height);
663 public void DrawRectangles (Pen pen, RectangleF [] rects)
665 foreach (RectangleF rc in rects)
666 DrawRectangle (pen, rc.Left, rc.Top, rc.Width, rc.Height);
669 public void DrawRectangles (Pen pen, Rectangle [] rects)
671 foreach (RectangleF rc in rects)
672 DrawRectangle(pen, rc.Left, rc.Top, rc.Width, rc.Height);
676 public void DrawString (string s, Font font, Brush brush, RectangleF layoutRectangle)
678 GDIPlus.GdipDrawString (nativeObject, s, s.Length, font.NativeObject, ref layoutRectangle, IntPtr.Zero, brush.nativeObject);
681 public void DrawString (string s, Font font, Brush brush, PointF point)
683 RectangleF rc = new RectangleF (point.X, point.Y, 0, 0);
684 GDIPlus.GdipDrawString (nativeObject, s, s.Length, font.NativeObject, ref rc, IntPtr.Zero, brush.nativeObject);
687 public void DrawString (string s, Font font, Brush brush, PointF point, StringFormat format)
689 RectangleF rc = new RectangleF (point.X, point.Y, 0, 0);
690 GDIPlus.GdipDrawString (nativeObject, s, s.Length, font.NativeObject, ref rc, format.NativeObject, brush.nativeObject);
693 public void DrawString (string s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format)
695 GDIPlus.GdipDrawString (nativeObject, s, s.Length, font.NativeObject, ref layoutRectangle,
696 format.NativeObject, brush.nativeObject);
699 public void DrawString (string s, Font font, Brush brush, float x, float y)
701 RectangleF rc = new RectangleF (x, y, 0, 0);
703 GDIPlus.GdipDrawString (nativeObject, s, s.Length, font.NativeObject,
704 ref rc, IntPtr.Zero, brush.nativeObject);
707 public void DrawString (string s, Font font, Brush brush, float x, float y, StringFormat format)
709 RectangleF rc = new RectangleF (x, y, 0, 0);
711 GDIPlus.GdipDrawString (nativeObject, s, s.Length, font.NativeObject,
712 ref rc, format.NativeObject, brush.nativeObject);
716 public void EndContainer (GraphicsContainer container)
718 GDIPlus.GdipEndContainer(nativeObject, container.NativeObject);
722 public void EnumerateMetafile (Metafile metafile, Point [] destPoints, EnumerateMetafileProc callback)
724 throw new NotImplementedException ();
728 public void EnumerateMetafile (Metafile metafile, RectangleF destRect, EnumerateMetafileProc callback)
730 throw new NotImplementedException ();
734 public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, EnumerateMetafileProc callback)
736 throw new NotImplementedException ();
740 public void EnumerateMetafile (Metafile metafile, Rectangle destRect, EnumerateMetafileProc callback)
742 throw new NotImplementedException ();
746 public void EnumerateMetafile (Metafile metafile, Point destPoint, EnumerateMetafileProc callback)
748 throw new NotImplementedException ();
752 public void EnumerateMetafile (Metafile metafile, PointF destPoint, EnumerateMetafileProc callback)
754 throw new NotImplementedException ();
758 public void EnumerateMetafile (Metafile metafile, PointF destPoint, EnumerateMetafileProc callback, IntPtr callbackData)
760 throw new NotImplementedException ();
764 public void EnumerateMetafile (Metafile metafile, Rectangle destRect, EnumerateMetafileProc callback, IntPtr callbackData)
766 throw new NotImplementedException ();
770 public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, EnumerateMetafileProc callback, IntPtr callbackData)
772 throw new NotImplementedException ();
776 public void EnumerateMetafile (Metafile metafile, Point destPoint, EnumerateMetafileProc callback, IntPtr callbackData)
778 throw new NotImplementedException ();
782 public void EnumerateMetafile (Metafile metafile, Point [] destPoints, EnumerateMetafileProc callback, IntPtr callbackData)
784 throw new NotImplementedException ();
788 public void EnumerateMetafile (Metafile metafile, RectangleF destRect, EnumerateMetafileProc callback, IntPtr callbackData)
790 throw new NotImplementedException ();
794 public void EnumerateMetafile (Metafile metafile, PointF destPoint, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
796 throw new NotImplementedException ();
800 public void EnumerateMetafile (Metafile metafile, Point destPoint, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
802 throw new NotImplementedException ();
806 public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
808 throw new NotImplementedException ();
812 public void EnumerateMetafile (Metafile metafile, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
814 throw new NotImplementedException ();
818 public void EnumerateMetafile (Metafile metafile, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
820 throw new NotImplementedException ();
824 public void EnumerateMetafile (Metafile metafile, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
826 throw new NotImplementedException ();
830 public void EnumerateMetafile (Metafile metafile, RectangleF destRect, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
832 throw new NotImplementedException ();
836 public void EnumerateMetafile (Metafile metafile, Point destPoint, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
838 throw new NotImplementedException ();
842 public void EnumerateMetafile (Metafile metafile, PointF destPoint, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
844 throw new NotImplementedException ();
848 public void EnumerateMetafile (Metafile metafile, Point [] destPoints, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
850 throw new NotImplementedException ();
854 public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
856 throw new NotImplementedException ();
860 public void EnumerateMetafile (Metafile metafile, Rectangle destRect, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
862 throw new NotImplementedException ();
866 public void EnumerateMetafile (Metafile metafile, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
868 throw new NotImplementedException ();
872 public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
874 throw new NotImplementedException ();
878 public void EnumerateMetafile (Metafile metafile, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
880 throw new NotImplementedException ();
884 public void EnumerateMetafile (Metafile metafile, PointF destPoint, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
886 throw new NotImplementedException ();
890 public void EnumerateMetafile (Metafile metafile, Point destPoint, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
892 throw new NotImplementedException ();
896 public void EnumerateMetafile (Metafile metafile, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
898 throw new NotImplementedException ();
902 public void EnumerateMetafile (Metafile metafile, Point [] destPoints, Rectangle srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
904 throw new NotImplementedException ();
908 public void EnumerateMetafile (Metafile metafile, Rectangle destRect, Rectangle srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
910 throw new NotImplementedException ();
914 public void EnumerateMetafile (Metafile metafile, Point destPoint, Rectangle srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
916 throw new NotImplementedException ();
920 public void EnumerateMetafile (Metafile metafile, RectangleF destRect, RectangleF srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
922 throw new NotImplementedException ();
926 public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, RectangleF srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
928 throw new NotImplementedException ();
932 public void EnumerateMetafile (Metafile metafile, PointF destPoint, RectangleF srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
934 throw new NotImplementedException ();
937 public void ExcludeClip (Rectangle rect)
939 GDIPlus.GdipSetClipRectI (nativeObject, rect.X, rect.Y, rect.Width, rect.Height, CombineMode.Exclude);
943 public void ExcludeClip (Region region)
945 throw new NotImplementedException ();
949 public void FillClosedCurve (Brush brush, PointF [] points)
951 GDIPlus.GdipFillClosedCurve (nativeObject, brush.NativeObject, points, points.Length);
955 public void FillClosedCurve (Brush brush, Point [] points)
957 GDIPlus.GdipFillClosedCurveI (nativeObject, brush.NativeObject, points, points.Length);
961 public void FillClosedCurve (Brush brush, PointF [] points, FillMode fillmode)
963 FillClosedCurve (brush, points, fillmode, 0.5f);
966 public void FillClosedCurve (Brush brush, Point [] points, FillMode fillmode)
968 FillClosedCurve (brush, points, fillmode, 0.5f);
971 public void FillClosedCurve (Brush brush, PointF [] points, FillMode fillmode, float tension)
973 GDIPlus.GdipFillClosedCurve2 (nativeObject, brush.NativeObject, points, points.Length, tension, fillmode);
976 public void FillClosedCurve (Brush brush, Point [] points, FillMode fillmode, float tension)
978 GDIPlus.GdipFillClosedCurve2I (nativeObject, brush.NativeObject, points, points.Length, tension, fillmode);
981 public void FillEllipse (Brush brush, Rectangle rect)
983 FillEllipse (brush, rect.X, rect.Y, rect.Width, rect.Height);
986 public void FillEllipse (Brush brush, RectangleF rect)
988 FillEllipse (brush, rect.X, rect.Y, rect.Width, rect.Height);
991 public void FillEllipse (Brush brush, float x, float y, float width, float height)
993 GDIPlus.GdipFillEllipse (nativeObject, brush.nativeObject, x, y, width, height);
996 public void FillEllipse (Brush brush, int x, int y, int width, int height)
998 GDIPlus.GdipFillEllipseI (nativeObject, brush.nativeObject, x, y, width, height);
1001 public void FillPath (Brush brush, GraphicsPath path)
1003 GDIPlus.GdipFillPath (nativeObject, brush.NativeObject, path.NativeObject);
1006 public void FillPie (Brush brush, Rectangle rect, float startAngle, float sweepAngle)
1008 GDIPlus.GdipFillPie (nativeObject, brush.NativeObject, rect.X, rect.Y, rect.Width, rect.Height,
1009 startAngle, sweepAngle);
1012 public void FillPie (Brush brush, int x, int y, int width, int height, int startAngle, int sweepAngle)
1014 GDIPlus.GdipFillPieI (nativeObject, brush.NativeObject, x, y, width, height, startAngle, sweepAngle);
1017 public void FillPie (Brush brush, float x, float y, float width, float height, float startAngle, float sweepAngle)
1019 GDIPlus.GdipFillPie (nativeObject, brush.NativeObject, x, y, width, height, startAngle, sweepAngle);
1022 public void FillPolygon (Brush brush, PointF [] points)
1024 GDIPlus.GdipFillPolygon2 (nativeObject, brush.nativeObject, points, points.Length);
1027 public void FillPolygon (Brush brush, Point [] points)
1029 GDIPlus.GdipFillPolygon2I (nativeObject, brush.nativeObject, points, points.Length);
1032 public void FillPolygon (Brush brush, Point [] points, FillMode fillMode)
1034 GDIPlus.GdipFillPolygonI (nativeObject, brush.nativeObject, points, points.Length, fillMode);
1037 public void FillPolygon (Brush brush, PointF [] points, FillMode fillMode)
1039 GDIPlus.GdipFillPolygon (nativeObject, brush.nativeObject, points, points.Length, fillMode);
1042 public void FillRectangle (Brush brush, RectangleF rect)
1044 FillRectangle (brush, rect.Left, rect.Top, rect.Width, rect.Height);
1047 public void FillRectangle (Brush brush, Rectangle rect)
1049 FillRectangle (brush, rect.Left, rect.Top, rect.Width, rect.Height);
1052 public void FillRectangle (Brush brush, int x, int y, int width, int height)
1054 GDIPlus.GdipFillRectangle (nativeObject, brush.nativeObject, (float)x, (float)y, (float)width, (float)height);
1057 public void FillRectangle (Brush brush, float x, float y, float width, float height)
1059 GDIPlus.GdipFillRectangle (nativeObject, brush.nativeObject, x, y, width, height);
1062 public void FillRectangles (Brush brush, Rectangle [] rects)
1064 foreach (Rectangle rc in rects)
1065 FillRectangle(brush, rc);
1068 public void FillRectangles (Brush brush, RectangleF [] rects)
1070 foreach (RectangleF rc in rects)
1071 FillRectangle(brush, rc);
1075 public void FillRegion (Brush brush, Region region)
1077 Status status = GDIPlus.GdipFillRegion (nativeObject, brush.NativeObject, region.NativeObject);
1078 GDIPlus.CheckStatus (status);
1082 public void Flush ()
1084 Flush (FlushIntention.Flush);
1088 public void Flush (FlushIntention intention)
1090 Status status = GDIPlus.GdipFlush (nativeObject, intention);
1091 GDIPlus.CheckStatus (status);
1094 public static Graphics FromHdc (IntPtr hdc)
1097 if (GDIPlus.GdipCreateFromHDC (hdc, out graphics) != Status.Ok){
1098 Console.WriteLine ("Graphics.FromHdc: the HDC is an invalid handle");
1102 Graphics result = new Graphics ((IntPtr) graphics);
1107 public static Graphics FromHdc (IntPtr hdc, IntPtr hdevice)
1109 throw new NotImplementedException ();
1113 public static Graphics FromHdcInternal (IntPtr hdc)
1115 throw new NotImplementedException ();
1118 public static Graphics FromHwnd (IntPtr hwnd)
1122 GDIPlus.GdipCreateFromHWND (hwnd, out graphics);
1124 return new Graphics (graphics);
1128 public static Graphics FromHwndInternal (IntPtr hwnd)
1130 throw new NotImplementedException ();
1134 public static Graphics FromImage (Image image)
1136 if (image == null) throw new ArgumentException ();
1138 GDIPlus.GdipGetImageGraphicsContext (image.nativeObject, out graphics);
1139 Graphics result = new Graphics ((IntPtr) graphics);
1143 public static Graphics FromXDrawable (IntPtr drawable, IntPtr display)
1146 Status s = GDIPlus.GdipCreateFromXDrawable_linux (drawable, display, out graphics);
1147 GDIPlus.CheckStatus (s);
1148 return new Graphics (graphics);
1152 public static IntPtr GetHalftonePalette ()
1154 throw new NotImplementedException ();
1158 public IntPtr GetHdc ()
1161 GDIPlus.GdipGetDC (nativeObject, out hdc);
1162 return (IntPtr) hdc;
1166 public Color GetNearestColor (Color color)
1170 GDIPlus.GdipGetNearestColor (nativeObject, out argb);
1171 return Color.FromArgb (argb);
1175 public void IntersectClip (Region region)
1177 throw new NotImplementedException ();
1180 public void IntersectClip (RectangleF rect)
1182 GDIPlus.GdipSetClipRect (nativeObject, rect.X, rect.Y, rect.Width, rect.Height, CombineMode.Intersect);
1185 public void IntersectClip (Rectangle rect)
1187 GDIPlus.GdipSetClipRectI (nativeObject, rect.X, rect.Y, rect.Width, rect.Height, CombineMode.Intersect);
1190 public bool IsVisible (Point point)
1192 bool isVisible = false;
1194 GDIPlus.GdipIsVisiblePointI (nativeObject, point.X, point.Y, out isVisible);
1200 public bool IsVisible (RectangleF rect)
1202 bool isVisible = false;
1204 GDIPlus.GdipIsVisibleRect (nativeObject, rect.X, rect.Y, rect.Width, rect.Height, out isVisible);
1209 public bool IsVisible (PointF point)
1211 bool isVisible = false;
1213 GDIPlus.GdipIsVisiblePoint (nativeObject, point.X, point.Y, out isVisible);
1218 public bool IsVisible (Rectangle rect)
1220 bool isVisible = false;
1222 GDIPlus.GdipIsVisibleRectI (nativeObject, rect.X, rect.Y, rect.Width, rect.Height, out isVisible);
1227 public bool IsVisible (float x, float y)
1229 return IsVisible (new PointF (x, y));
1232 public bool IsVisible (int x, int y)
1234 return IsVisible (new Point (x, y));
1237 public bool IsVisible (float x, float y, float width, float height)
1239 return IsVisible (new RectangleF (x, y, width, height));
1243 public bool IsVisible (int x, int y, int width, int height)
1245 return IsVisible (new Rectangle (x, y, width, height));
1249 public Region [] MeasureCharacterRanges (string text, Font font, RectangleF layoutRect, StringFormat stringFormat)
1251 throw new NotImplementedException ();
1255 public SizeF MeasureString (string text, Font font)
1257 return MeasureString (text, font, new Size(0,0));
1261 public SizeF MeasureString (string text, Font font, SizeF layoutArea)
1263 int charactersFitted, linesFilled;
1264 RectangleF boundingBox = new RectangleF ();
1265 RectangleF rect = new RectangleF (0,0,layoutArea.Width, layoutArea.Height);
1267 GDIPlus.GdipMeasureString (nativeObject, text, text.Length, font.NativeObject,
1268 ref rect, IntPtr.Zero, out boundingBox, out charactersFitted, out linesFilled);
1270 return new SizeF(boundingBox.Width, boundingBox.Height);
1274 public SizeF MeasureString (string text, Font font, int width)
1276 throw new NotImplementedException ();
1280 public SizeF MeasureString (string text, Font font, SizeF layoutArea, StringFormat stringFormat)
1282 int charactersFitted, linesFilled;
1283 return MeasureString (text, font, layoutArea, stringFormat, out charactersFitted, out linesFilled);
1287 public SizeF MeasureString (string text, Font font, int width, StringFormat format)
1289 throw new NotImplementedException ();
1293 public SizeF MeasureString (string text, Font font, PointF origin, StringFormat stringFormat)
1295 RectangleF boundingBox = new RectangleF ();
1296 RectangleF rect = new RectangleF (origin.X, origin.Y, 0,0);
1297 int charactersFitted, linesFilled;
1299 GDIPlus.GdipMeasureString (nativeObject, text, text.Length, font.NativeObject,
1300 ref rect, stringFormat.NativeObject, out boundingBox, out charactersFitted, out linesFilled);
1302 return new SizeF(boundingBox.Width, boundingBox.Height);
1306 public SizeF MeasureString (string text, Font font, SizeF layoutArea, StringFormat stringFormat,
1307 out int charactersFitted, out int linesFilled)
1309 RectangleF boundingBox = new RectangleF ();
1310 RectangleF rect = new RectangleF (0,0,layoutArea.Width, layoutArea.Height);
1312 GDIPlus.GdipMeasureString (nativeObject, text, text.Length, font.NativeObject,
1313 ref rect, stringFormat.NativeObject, out boundingBox, out charactersFitted,
1316 return new SizeF(boundingBox.Width, boundingBox.Height);
1319 public void MultiplyTransform (Matrix matrix)
1321 MultiplyTransform (matrix, MatrixOrder.Prepend);
1324 public void MultiplyTransform (Matrix matrix, MatrixOrder order)
1326 GDIPlus.GdipMultiplyWorldTransform (nativeObject, matrix.nativeMatrix, order);
1329 public void ReleaseHdc (IntPtr hdc)
1331 GDIPlus.GdipReleaseDC (nativeObject, hdc);
1335 public void ReleaseHdcInternal (IntPtr hdc)
1337 throw new NotImplementedException ();
1341 public void ResetClip ()
1343 GDIPlus.GdipResetClip(nativeObject);
1346 public void ResetTransform ()
1348 GDIPlus.GdipResetWorldTransform (nativeObject);
1352 public void Restore (GraphicsState gstate)
1354 Transform = gstate.matrix.Clone();
1355 GDIPlus.GdipRestoreGraphics (nativeObject, gstate.nativeState);
1359 public void RotateTransform (float angle)
1361 RotateTransform(angle, MatrixOrder.Prepend);
1365 public void RotateTransform (float angle, MatrixOrder order)
1367 //transform.Rotate(angle, order);
1368 GDIPlus.GdipRotateWorldTransform (nativeObject, angle, order);
1372 public GraphicsState Save ()
1374 //return implementation.Save();
1375 GraphicsState state = new GraphicsState();
1376 state.matrix = Transform.Clone ();
1378 GDIPlus.GdipSaveGraphics (nativeObject, out saveState);
1379 state.nativeState = saveState;
1383 public void ScaleTransform (float sx, float sy)
1385 ScaleTransform (sx, sy, MatrixOrder.Prepend);
1388 public void ScaleTransform (float sx, float sy, MatrixOrder order)
1390 GDIPlus.GdipScaleWorldTransform (nativeObject, sx, sy, order);
1394 public void SetClip (RectangleF rect)
1396 SetClip (rect, CombineMode.Replace);
1400 public void SetClip (GraphicsPath path)
1402 SetClip (path, CombineMode.Replace);
1406 public void SetClip (Rectangle rect)
1408 SetClip (rect, CombineMode.Replace);
1412 public void SetClip (Graphics g)
1414 SetClip (g, CombineMode.Replace);
1418 public void SetClip (Graphics g, CombineMode combineMode)
1420 GDIPlus.GdipSetClipGraphics (nativeObject, g.NativeObject, combineMode);
1424 public void SetClip (Rectangle rect, CombineMode combineMode)
1426 GDIPlus.GdipSetClipRectI (nativeObject, rect.X, rect.Y, rect.Width, rect.Height, combineMode);
1430 public void SetClip (RectangleF rect, CombineMode combineMode)
1432 GDIPlus.GdipSetClipRect (nativeObject, rect.X, rect.Y, rect.Width, rect.Height, combineMode);
1436 public void SetClip (Region region, CombineMode combineMode)
1438 //GDIPlus.GdipSetClipRegion(nativeObject, region.NativeObject, combineMode); //TODO: Region not implemented yet
1442 public void SetClip (GraphicsPath path, CombineMode combineMode)
1444 GDIPlus.GdipSetClipPath (nativeObject, path.NativeObject, combineMode);
1448 public void TransformPoints (CoordinateSpace destSpace, CoordinateSpace srcSpace, PointF [] pts)
1450 IntPtr ptrPt = GDIPlus.FromPointToUnManagedMemory (pts);
1452 Status status = GDIPlus.GdipTransformPoints (nativeObject, destSpace, srcSpace, ptrPt, pts.Length);
1454 GDIPlus.FromUnManagedMemoryToPoint (ptrPt, pts);
1458 public void TransformPoints (CoordinateSpace destSpace, CoordinateSpace srcSpace, Point [] pts)
1460 IntPtr ptrPt = GDIPlus.FromPointToUnManagedMemoryI (pts);
1462 Status status = GDIPlus.GdipTransformPointsI (nativeObject, destSpace, srcSpace, ptrPt, pts.Length);
1464 GDIPlus.FromUnManagedMemoryToPointI (ptrPt, pts);
1468 public void TranslateClip (int dx, int dy)
1470 GDIPlus.GdipTranslateClipI (nativeObject, dx, dy);
1474 public void TranslateClip (float dx, float dy)
1476 GDIPlus.GdipTranslateClip (nativeObject, dx, dy);
1479 public void TranslateTransform (float dx, float dy)
1481 TranslateTransform (dx, dy, MatrixOrder.Prepend);
1485 public void TranslateTransform (float dx, float dy, MatrixOrder order)
1487 GDIPlus.GdipTranslateWorldTransform (nativeObject, dx, dy, order);
1490 public Region Clip {
1492 throw new NotImplementedException ();
1495 //throw new NotImplementedException ();
1499 public RectangleF ClipBounds {
1501 RectangleF rect = new RectangleF ();
1502 GDIPlus.GdipGetClipBounds (nativeObject, out rect);
1507 public CompositingMode CompositingMode {
1509 CompositingMode mode;
1510 GDIPlus.GdipGetCompositingMode (nativeObject, out mode);
1515 GDIPlus.GdipSetCompositingMode (nativeObject, value);
1520 public CompositingQuality CompositingQuality {
1522 CompositingQuality quality;
1524 GDIPlus.GdipGetCompositingQuality (nativeObject, out quality);
1528 GDIPlus.GdipSetCompositingQuality (nativeObject, value);
1536 GDIPlus.GdipGetDpiX (nativeObject, out x);
1545 GDIPlus.GdipGetDpiY (nativeObject, out y);
1550 public InterpolationMode InterpolationMode {
1552 InterpolationMode imode = InterpolationMode.Invalid;
1553 GDIPlus.GdipGetInterpolationMode (nativeObject, out imode);
1557 GDIPlus.GdipSetInterpolationMode (nativeObject, value);
1561 public bool IsClipEmpty {
1563 bool isEmpty = false;
1565 GDIPlus.GdipIsClipEmpty (nativeObject, out isEmpty);
1570 public bool IsVisibleClipEmpty {
1572 bool isEmpty = false;
1574 GDIPlus.GdipIsVisibleClipEmpty (nativeObject, out isEmpty);
1579 public float PageScale {
1583 GDIPlus.GdipGetPageScale (nativeObject, out scale);
1587 GDIPlus.GdipSetPageScale (nativeObject, value);
1591 public GraphicsUnit PageUnit {
1595 GDIPlus.GdipGetPageUnit (nativeObject, out unit);
1599 GDIPlus.GdipSetPageUnit (nativeObject, value);
1603 public PixelOffsetMode PixelOffsetMode {
1605 PixelOffsetMode pixelOffset = PixelOffsetMode.Invalid;
1607 GDIPlus.GdipGetPixelOffsetMode (nativeObject, out pixelOffset);
1612 GDIPlus.GdipSetPixelOffsetMode (nativeObject, value);
1616 public Point RenderingOrigin {
1619 GDIPlus.GdipGetRenderingOrigin (
1620 nativeObject, out x, out y);
1622 return new Point (x, y);
1626 GDIPlus.GdipSetRenderingOrigin (nativeObject, value.X, value.Y);
1630 public SmoothingMode SmoothingMode {
1632 SmoothingMode mode = SmoothingMode.Invalid;
1634 GDIPlus.GdipGetSmoothingMode (nativeObject, out mode);
1640 GDIPlus.GdipSetSmoothingMode (nativeObject, value);
1644 public int TextContrast {
1648 GDIPlus.GdipGetTextContrast (nativeObject, out contrast);
1653 GDIPlus.GdipSetTextContrast (nativeObject, value);
1657 public TextRenderingHint TextRenderingHint {
1659 TextRenderingHint hint;
1661 GDIPlus.GdipGetTextRenderingHint (nativeObject, out hint);
1666 GDIPlus.GdipSetTextRenderingHint (nativeObject, value);
1670 public Matrix Transform {
1672 Matrix matrix = new Matrix ();
1673 GDIPlus.GdipGetWorldTransform (nativeObject, matrix.nativeMatrix);
1678 GDIPlus.GdipSetWorldTransform (nativeObject, value.nativeMatrix);
1682 public RectangleF VisibleClipBounds {
1686 GDIPlus.GdipGetVisibleClipBounds (nativeObject, out rect);