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);
240 public void DrawCurve (Pen pen, PointF [] points, float tension)
242 GDIPlus.GdipDrawCurve2 (nativeObject, pen.nativeObject, points, points.Length, tension);
246 public void DrawCurve (Pen pen, Point [] points, float tension)
248 GDIPlus.GdipDrawCurve2I (nativeObject, pen.nativeObject, points, points.Length, tension);
253 public void DrawCurve (Pen pen, PointF [] points, int offset, int numberOfSegments)
255 GDIPlus.GdipDrawCurve3 (nativeObject, pen.nativeObject, points, points.Length,
256 offset, numberOfSegments, 0.5f);
259 public void DrawCurve (Pen pen, Point [] points, int offset, int numberOfSegments, float tension)
261 GDIPlus.GdipDrawCurve3I (nativeObject, pen.nativeObject, points, points.Length,
262 offset, numberOfSegments, tension);
266 public void DrawCurve (Pen pen, PointF [] points, int offset, int numberOfSegments, float tension)
268 GDIPlus.GdipDrawCurve3 (nativeObject, pen.nativeObject, points, points.Length,
269 offset, numberOfSegments, tension);
272 public void DrawEllipse (Pen pen, Rectangle rect)
274 DrawEllipse (pen, rect.X, rect.Y, rect.Width, rect.Height);
277 public void DrawEllipse (Pen pen, RectangleF rect)
279 DrawEllipse (pen, rect.X, rect.Y, rect.Width, rect.Height);
282 public void DrawEllipse (Pen pen, int x, int y, int width, int height)
284 GDIPlus.GdipDrawEllipseI (nativeObject, pen.nativeObject, x, y, width, height);
287 public void DrawEllipse (Pen pen, float x, float y, float width, float height)
289 GDIPlus.GdipDrawEllipse (nativeObject, pen.nativeObject, x, y, width, height);
293 public void DrawIcon (Icon icon, Rectangle targetRect)
295 throw new NotImplementedException ();
299 public void DrawIcon (Icon icon, int x, int y)
301 throw new NotImplementedException ();
305 public void DrawIconUnstretched (Icon icon, Rectangle targetRect)
307 throw new NotImplementedException ();
310 public void DrawImage (Image image, RectangleF rect)
312 GDIPlus.GdipDrawImageRect(nativeObject, image.NativeObject, rect.X, rect.Y,
313 rect.Width, rect.Height);
317 public void DrawImage (Image image, PointF point)
319 GDIPlus.GdipDrawImage (nativeObject, image.NativeObject, point.X, point.Y);
323 public void DrawImage (Image image, Point [] destPoints)
325 GDIPlus.GdipDrawImagePointsI (nativeObject, image.NativeObject, destPoints, destPoints.Length);
329 public void DrawImage (Image image, Point point)
331 DrawImage (image, point.X, point.Y);
335 public void DrawImage (Image image, Rectangle rect)
337 DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height);
341 public void DrawImage (Image image, PointF [] destPoints)
343 GDIPlus.GdipDrawImagePoints (nativeObject, image.NativeObject, destPoints, destPoints.Length);
347 public void DrawImage (Image image, int x, int y)
349 GDIPlus.GdipDrawImageI (nativeObject, image.NativeObject, x, y);
353 public void DrawImage (Image image, float x, float y)
355 GDIPlus.GdipDrawImage (nativeObject, image.NativeObject, x, y);
359 public void DrawImage (Image image, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit)
361 GDIPlus.GdipDrawImageRectRectI (nativeObject, image.NativeObject,
362 destRect.X, destRect.Y, destRect.Width, destRect.Height,
363 srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height,
364 srcUnit, IntPtr.Zero, null, IntPtr.Zero);
367 public void DrawImage (Image image, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit)
369 GDIPlus.GdipDrawImageRectRect (nativeObject, image.NativeObject,
370 destRect.X, destRect.Y, destRect.Width, destRect.Height,
371 srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height,
372 srcUnit, IntPtr.Zero, null, IntPtr.Zero);
376 public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit)
378 GDIPlus.GdipDrawImagePointsRectI (nativeObject, image.NativeObject,
379 destPoints, destPoints.Length , srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height,
380 srcUnit, IntPtr.Zero, null, IntPtr.Zero);
385 public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit)
388 GDIPlus.GdipDrawImagePointsRect (nativeObject, image.NativeObject,
389 destPoints, destPoints.Length , srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height,
390 srcUnit, IntPtr.Zero, null, IntPtr.Zero);
394 public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit,
395 ImageAttributes imageAttr)
397 GDIPlus.GdipDrawImagePointsRectI (nativeObject, image.NativeObject,
398 destPoints, destPoints.Length , srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height,
399 srcUnit, imageAttr.NativeObject , null, IntPtr.Zero);
402 public void DrawImage (Image image, float x, float y, float width, float height)
404 GDIPlus.GdipDrawImageRect(nativeObject, image.NativeObject, x, y,
409 public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit,
410 ImageAttributes imageAttr)
412 GDIPlus.GdipDrawImagePointsRect (nativeObject, image.NativeObject,
413 destPoints, destPoints.Length , srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height,
414 srcUnit, imageAttr.NativeObject, null, IntPtr.Zero);
418 public void DrawImage (Image image, int x, int y, Rectangle srcRect, GraphicsUnit srcUnit)
420 GDIPlus.GdipDrawImagePointRectI(nativeObject, image.NativeObject, x, y,
421 srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit);
424 public void DrawImage (Image image, int x, int y, int width, int height)
426 GDIPlus.GdipDrawImageRectI (nativeObject, image.nativeObject, x, y, width, height);
429 public void DrawImage (Image image, float x, float y, RectangleF srcRect, GraphicsUnit srcUnit)
431 GDIPlus.GdipDrawImagePointRect(nativeObject, image.nativeObject, x, y, srcRect.X, srcRect.Y,
432 srcRect.Width, srcRect.Height, srcUnit);
436 public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit,
437 ImageAttributes imageAttr, DrawImageAbort callback)
439 GDIPlus.GdipDrawImagePointsRect (nativeObject, image.NativeObject,
440 destPoints, destPoints.Length , srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height,
441 srcUnit, imageAttr.NativeObject, callback, IntPtr.Zero);
445 public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit,
446 ImageAttributes imageAttr, DrawImageAbort callback)
449 GDIPlus.GdipDrawImagePointsRectI (nativeObject, image.NativeObject,
450 destPoints, destPoints.Length , srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height,
451 srcUnit, imageAttr.NativeObject, callback, IntPtr.Zero);
455 public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit,
456 ImageAttributes imageAttr, DrawImageAbort callback, int callbackData)
458 GDIPlus.GdipDrawImagePointsRectI (nativeObject, image.NativeObject,
459 destPoints, destPoints.Length , srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height,
460 srcUnit, imageAttr.NativeObject, callback, (IntPtr) callbackData);
464 public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight,
465 GraphicsUnit srcUnit)
467 GDIPlus.GdipDrawImageRectRect (nativeObject, image.NativeObject,
468 destRect.X, destRect.Y, destRect.Width, destRect.Height,
469 srcX, srcY, srcWidth, srcHeight, srcUnit, IntPtr.Zero,
473 public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit,
474 ImageAttributes imageAttr, DrawImageAbort callback, int callbackData)
476 GDIPlus.GdipDrawImagePointsRect (nativeObject, image.NativeObject,
477 destPoints, destPoints.Length , srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height,
478 srcUnit, imageAttr.NativeObject, callback, (IntPtr) callbackData);
482 public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight,
483 GraphicsUnit srcUnit)
485 GDIPlus.GdipDrawImageRectRectI (nativeObject, image.NativeObject,
486 destRect.X, destRect.Y, destRect.Width, destRect.Height,
487 srcX, srcY, srcWidth, srcHeight, srcUnit, IntPtr.Zero,
492 public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight,
493 GraphicsUnit srcUnit, ImageAttributes imageAttrs)
495 GDIPlus.GdipDrawImageRectRect (nativeObject, image.NativeObject,
496 destRect.X, destRect.Y, destRect.Width, destRect.Height,
497 srcX, srcY, srcWidth, srcHeight, srcUnit, imageAttrs.NativeObject,
502 public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight,
503 GraphicsUnit srcUnit, ImageAttributes imageAttr)
505 GDIPlus.GdipDrawImageRectRectI (nativeObject, image.NativeObject,
506 destRect.X, destRect.Y, destRect.Width, destRect.Height,
507 srcX, srcY, srcWidth, srcHeight, srcUnit, imageAttr.NativeObject,
512 public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight,
513 GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
515 GDIPlus.GdipDrawImageRectRectI (nativeObject, image.NativeObject,
516 destRect.X, destRect.Y, destRect.Width, destRect.Height,
517 srcX, srcY, srcWidth, srcHeight, srcUnit, imageAttr.NativeObject,
518 callback, IntPtr.Zero);
521 public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight,
522 GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
524 GDIPlus.GdipDrawImageRectRect (nativeObject, image.NativeObject,
525 destRect.X, destRect.Y, destRect.Width, destRect.Height,
526 srcX, srcY, srcWidth, srcHeight, srcUnit, imageAttr.NativeObject,
527 callback, IntPtr.Zero);
531 public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight,
532 GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, IntPtr callbackData)
534 GDIPlus.GdipDrawImageRectRect (nativeObject, image.NativeObject,
535 destRect.X, destRect.Y, destRect.Width, destRect.Height,
536 srcX, srcY, srcWidth, srcHeight, srcUnit, imageAttr.NativeObject,
537 callback, callbackData);
541 public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight,
542 GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, IntPtr callbackData)
544 GDIPlus.GdipDrawImageRectRect (nativeObject, image.NativeObject,
545 destRect.X, destRect.Y, destRect.Width, destRect.Height,
546 srcX, srcY, srcWidth, srcHeight, srcUnit, imageAttr.NativeObject,
547 callback, callbackData);
550 public void DrawImageUnscaled (Image image, Point point)
552 DrawImage(image, point.X, point.Y);
555 public void DrawImageUnscaled (Image image, Rectangle rect)
557 DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height);
560 public void DrawImageUnscaled (Image image, int x, int y)
562 DrawImage(image, x, y);
565 public void DrawImageUnscaled (Image image, int x, int y, int width, int height)
567 DrawImage(image, x, y, width, height);
570 public void DrawLine (Pen pen, PointF pt1, PointF pt2)
572 GDIPlus.GdipDrawLine (
573 nativeObject, pen.nativeObject,
579 public void DrawLine (Pen pen, Point pt1, Point pt2)
581 GDIPlus.GdipDrawLineI (
582 nativeObject, pen.nativeObject,
587 public void DrawLine (Pen pen, int x1, int y1, int x2, int y2)
589 GDIPlus.GdipDrawLineI (nativeObject, pen.nativeObject, x1, y1, x2, y2);
592 public void DrawLine (Pen pen, float x1, float y1, float x2, float y2)
594 GDIPlus.GdipDrawLine (nativeObject, pen.nativeObject, x1, y1, x2, y2);
597 public void DrawLines (Pen pen, PointF [] points)
599 GDIPlus.GdipDrawLines (nativeObject, pen.nativeObject, points, points.Length);
602 public void DrawLines (Pen pen, Point [] points)
604 GDIPlus.GdipDrawLinesI (nativeObject, pen.nativeObject, points, points.Length);
607 public void DrawPath (Pen pen, GraphicsPath path)
609 GDIPlus.GdipDrawPath (nativeObject, pen.nativeObject, path.nativePath);
612 public void DrawPie (Pen pen, Rectangle rect, float startAngle, float sweepAngle)
614 DrawPie (pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
617 public void DrawPie (Pen pen, RectangleF rect, float startAngle, float sweepAngle)
619 DrawPie (pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
622 public void DrawPie (Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)
624 GDIPlus.GdipDrawPie (nativeObject, pen.nativeObject, x, y, width, height, startAngle, sweepAngle);
627 // Microsoft documentation states that the signature for this member should be
628 // public void DrawPie(Pen pen, int x, int y, int width, int height, int startAngle
629 // int sweepAngle. However, GdipDrawPieI uses also float for the startAngle and sweepAngle params
630 public void DrawPie (Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle)
632 GDIPlus.GdipDrawPieI (nativeObject, pen.nativeObject, x, y, width, height, startAngle, sweepAngle);
635 public void DrawPolygon (Pen pen, Point [] points)
637 GDIPlus.GdipDrawPolygonI (nativeObject, pen.nativeObject, points, points.Length);
640 public void DrawPolygon (Pen pen, PointF [] points)
642 GDIPlus.GdipDrawPolygon (nativeObject, pen.nativeObject, points, points.Length);
645 public void DrawRectangle (Pen pen, RectangleF rect)
647 DrawRectangle (pen, rect.Left, rect.Top, rect.Width, rect.Height);
650 public void DrawRectangle (Pen pen, Rectangle rect)
652 DrawRectangle (pen, rect.Left, rect.Top, rect.Width, rect.Height);
655 public void DrawRectangle (Pen pen, float x, float y, float width, float height)
657 GDIPlus.GdipDrawRectangle (nativeObject, pen.nativeObject, x, y, width, height);
660 public void DrawRectangle (Pen pen, int x, int y, int width, int height)
662 GDIPlus.GdipDrawRectangleI (nativeObject, pen.nativeObject, x, y, width, height);
665 public void DrawRectangles (Pen pen, RectangleF [] rects)
667 foreach (RectangleF rc in rects)
668 DrawRectangle (pen, rc.Left, rc.Top, rc.Width, rc.Height);
671 public void DrawRectangles (Pen pen, Rectangle [] rects)
673 foreach (RectangleF rc in rects)
674 DrawRectangle(pen, rc.Left, rc.Top, rc.Width, rc.Height);
678 public void DrawString (string s, Font font, Brush brush, RectangleF layoutRectangle)
680 GDIPlus.GdipDrawString (nativeObject, s, s.Length, font.NativeObject, ref layoutRectangle, IntPtr.Zero, brush.nativeObject);
683 public void DrawString (string s, Font font, Brush brush, PointF point)
685 RectangleF rc = new RectangleF (point.X, point.Y, 0, 0);
686 GDIPlus.GdipDrawString (nativeObject, s, s.Length, font.NativeObject, ref rc, IntPtr.Zero, brush.nativeObject);
689 public void DrawString (string s, Font font, Brush brush, PointF point, StringFormat format)
691 RectangleF rc = new RectangleF (point.X, point.Y, 0, 0);
692 GDIPlus.GdipDrawString (nativeObject, s, s.Length, font.NativeObject, ref rc, format.NativeObject, brush.nativeObject);
695 public void DrawString (string s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format)
697 GDIPlus.GdipDrawString (nativeObject, s, s.Length, font.NativeObject, ref layoutRectangle,
698 format.NativeObject, brush.nativeObject);
701 public void DrawString (string s, Font font, Brush brush, float x, float y)
703 RectangleF rc = new RectangleF (x, y, 0, 0);
705 GDIPlus.GdipDrawString (nativeObject, s, s.Length, font.NativeObject,
706 ref rc, IntPtr.Zero, brush.nativeObject);
709 public void DrawString (string s, Font font, Brush brush, float x, float y, StringFormat format)
711 RectangleF rc = new RectangleF (x, y, 0, 0);
713 GDIPlus.GdipDrawString (nativeObject, s, s.Length, font.NativeObject,
714 ref rc, format.NativeObject, brush.nativeObject);
718 public void EndContainer (GraphicsContainer container)
720 GDIPlus.GdipEndContainer(nativeObject, container.NativeObject);
724 public void EnumerateMetafile (Metafile metafile, Point [] destPoints, EnumerateMetafileProc callback)
726 throw new NotImplementedException ();
730 public void EnumerateMetafile (Metafile metafile, RectangleF destRect, EnumerateMetafileProc callback)
732 throw new NotImplementedException ();
736 public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, EnumerateMetafileProc callback)
738 throw new NotImplementedException ();
742 public void EnumerateMetafile (Metafile metafile, Rectangle destRect, EnumerateMetafileProc callback)
744 throw new NotImplementedException ();
748 public void EnumerateMetafile (Metafile metafile, Point destPoint, EnumerateMetafileProc callback)
750 throw new NotImplementedException ();
754 public void EnumerateMetafile (Metafile metafile, PointF destPoint, EnumerateMetafileProc callback)
756 throw new NotImplementedException ();
760 public void EnumerateMetafile (Metafile metafile, PointF destPoint, EnumerateMetafileProc callback, IntPtr callbackData)
762 throw new NotImplementedException ();
766 public void EnumerateMetafile (Metafile metafile, Rectangle destRect, EnumerateMetafileProc callback, IntPtr callbackData)
768 throw new NotImplementedException ();
772 public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, EnumerateMetafileProc callback, IntPtr callbackData)
774 throw new NotImplementedException ();
778 public void EnumerateMetafile (Metafile metafile, Point destPoint, EnumerateMetafileProc callback, IntPtr callbackData)
780 throw new NotImplementedException ();
784 public void EnumerateMetafile (Metafile metafile, Point [] destPoints, EnumerateMetafileProc callback, IntPtr callbackData)
786 throw new NotImplementedException ();
790 public void EnumerateMetafile (Metafile metafile, RectangleF destRect, EnumerateMetafileProc callback, IntPtr callbackData)
792 throw new NotImplementedException ();
796 public void EnumerateMetafile (Metafile metafile, PointF destPoint, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
798 throw new NotImplementedException ();
802 public void EnumerateMetafile (Metafile metafile, Point destPoint, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
804 throw new NotImplementedException ();
808 public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
810 throw new NotImplementedException ();
814 public void EnumerateMetafile (Metafile metafile, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
816 throw new NotImplementedException ();
820 public void EnumerateMetafile (Metafile metafile, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
822 throw new NotImplementedException ();
826 public void EnumerateMetafile (Metafile metafile, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
828 throw new NotImplementedException ();
832 public void EnumerateMetafile (Metafile metafile, RectangleF destRect, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
834 throw new NotImplementedException ();
838 public void EnumerateMetafile (Metafile metafile, Point destPoint, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
840 throw new NotImplementedException ();
844 public void EnumerateMetafile (Metafile metafile, PointF destPoint, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
846 throw new NotImplementedException ();
850 public void EnumerateMetafile (Metafile metafile, Point [] destPoints, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
852 throw new NotImplementedException ();
856 public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
858 throw new NotImplementedException ();
862 public void EnumerateMetafile (Metafile metafile, Rectangle destRect, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
864 throw new NotImplementedException ();
868 public void EnumerateMetafile (Metafile metafile, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
870 throw new NotImplementedException ();
874 public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
876 throw new NotImplementedException ();
880 public void EnumerateMetafile (Metafile metafile, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
882 throw new NotImplementedException ();
886 public void EnumerateMetafile (Metafile metafile, PointF destPoint, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
888 throw new NotImplementedException ();
892 public void EnumerateMetafile (Metafile metafile, Point destPoint, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
894 throw new NotImplementedException ();
898 public void EnumerateMetafile (Metafile metafile, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
900 throw new NotImplementedException ();
904 public void EnumerateMetafile (Metafile metafile, Point [] destPoints, Rectangle srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
906 throw new NotImplementedException ();
910 public void EnumerateMetafile (Metafile metafile, Rectangle destRect, Rectangle srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
912 throw new NotImplementedException ();
916 public void EnumerateMetafile (Metafile metafile, Point destPoint, Rectangle srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
918 throw new NotImplementedException ();
922 public void EnumerateMetafile (Metafile metafile, RectangleF destRect, RectangleF srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
924 throw new NotImplementedException ();
928 public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, RectangleF srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
930 throw new NotImplementedException ();
934 public void EnumerateMetafile (Metafile metafile, PointF destPoint, RectangleF srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
936 throw new NotImplementedException ();
939 public void ExcludeClip (Rectangle rect)
941 GDIPlus.GdipSetClipRectI (nativeObject, rect.X, rect.Y, rect.Width, rect.Height, CombineMode.Exclude);
945 public void ExcludeClip (Region region)
947 throw new NotImplementedException ();
951 public void FillClosedCurve (Brush brush, PointF [] points)
953 GDIPlus.GdipFillClosedCurve (nativeObject, brush.NativeObject, points, points.Length);
957 public void FillClosedCurve (Brush brush, Point [] points)
959 GDIPlus.GdipFillClosedCurveI (nativeObject, brush.NativeObject, points, points.Length);
963 public void FillClosedCurve (Brush brush, PointF [] points, FillMode fillmode)
965 FillClosedCurve (brush, points, fillmode, 0.5f);
968 public void FillClosedCurve (Brush brush, Point [] points, FillMode fillmode)
970 FillClosedCurve (brush, points, fillmode, 0.5f);
973 public void FillClosedCurve (Brush brush, PointF [] points, FillMode fillmode, float tension)
975 GDIPlus.GdipFillClosedCurve2 (nativeObject, brush.NativeObject, points, points.Length, tension, fillmode);
978 public void FillClosedCurve (Brush brush, Point [] points, FillMode fillmode, float tension)
980 GDIPlus.GdipFillClosedCurve2I (nativeObject, brush.NativeObject, points, points.Length, tension, fillmode);
983 public void FillEllipse (Brush brush, Rectangle rect)
985 FillEllipse (brush, rect.X, rect.Y, rect.Width, rect.Height);
988 public void FillEllipse (Brush brush, RectangleF rect)
990 FillEllipse (brush, rect.X, rect.Y, rect.Width, rect.Height);
993 public void FillEllipse (Brush brush, float x, float y, float width, float height)
995 GDIPlus.GdipFillEllipse (nativeObject, brush.nativeObject, x, y, width, height);
998 public void FillEllipse (Brush brush, int x, int y, int width, int height)
1000 GDIPlus.GdipFillEllipseI (nativeObject, brush.nativeObject, x, y, width, height);
1003 public void FillPath (Brush brush, GraphicsPath path)
1005 GDIPlus.GdipFillPath (nativeObject, brush.NativeObject, path.NativeObject);
1008 public void FillPie (Brush brush, Rectangle rect, float startAngle, float sweepAngle)
1010 GDIPlus.GdipFillPie (nativeObject, brush.NativeObject, rect.X, rect.Y, rect.Width, rect.Height,
1011 startAngle, sweepAngle);
1014 public void FillPie (Brush brush, int x, int y, int width, int height, int startAngle, int sweepAngle)
1016 GDIPlus.GdipFillPieI (nativeObject, brush.NativeObject, x, y, width, height, startAngle, sweepAngle);
1019 public void FillPie (Brush brush, float x, float y, float width, float height, float startAngle, float sweepAngle)
1021 GDIPlus.GdipFillPie (nativeObject, brush.NativeObject, x, y, width, height, startAngle, sweepAngle);
1024 public void FillPolygon (Brush brush, PointF [] points)
1026 GDIPlus.GdipFillPolygon2 (nativeObject, brush.nativeObject, points, points.Length);
1029 public void FillPolygon (Brush brush, Point [] points)
1031 GDIPlus.GdipFillPolygon2I (nativeObject, brush.nativeObject, points, points.Length);
1034 public void FillPolygon (Brush brush, Point [] points, FillMode fillMode)
1036 GDIPlus.GdipFillPolygonI (nativeObject, brush.nativeObject, points, points.Length, fillMode);
1039 public void FillPolygon (Brush brush, PointF [] points, FillMode fillMode)
1041 GDIPlus.GdipFillPolygon (nativeObject, brush.nativeObject, points, points.Length, fillMode);
1044 public void FillRectangle (Brush brush, RectangleF rect)
1046 FillRectangle (brush, rect.Left, rect.Top, rect.Width, rect.Height);
1049 public void FillRectangle (Brush brush, Rectangle rect)
1051 FillRectangle (brush, rect.Left, rect.Top, rect.Width, rect.Height);
1054 public void FillRectangle (Brush brush, int x, int y, int width, int height)
1056 GDIPlus.GdipFillRectangle (nativeObject, brush.nativeObject, (float)x, (float)y, (float)width, (float)height);
1059 public void FillRectangle (Brush brush, float x, float y, float width, float height)
1061 GDIPlus.GdipFillRectangle (nativeObject, brush.nativeObject, x, y, width, height);
1064 public void FillRectangles (Brush brush, Rectangle [] rects)
1066 foreach (Rectangle rc in rects)
1067 FillRectangle(brush, rc);
1070 public void FillRectangles (Brush brush, RectangleF [] rects)
1072 foreach (RectangleF rc in rects)
1073 FillRectangle(brush, rc);
1077 public void FillRegion (Brush brush, Region region)
1079 throw new NotImplementedException ();
1083 public void Flush ()
1085 Flush (FlushIntention.Flush);
1089 public void Flush (FlushIntention intention)
1091 throw new NotImplementedException ();
1095 public static Graphics FromHdc (IntPtr hdc)
1098 if (GDIPlus.GdipCreateFromHDC (hdc, out graphics) != Status.Ok){
1099 Console.WriteLine ("Graphics.FromHdc: the HDC is an invalid handle");
1103 Graphics result = new Graphics ((IntPtr) graphics);
1108 public static Graphics FromHdc (IntPtr hdc, IntPtr hdevice)
1110 throw new NotImplementedException ();
1114 public static Graphics FromHdcInternal (IntPtr hdc)
1116 throw new NotImplementedException ();
1119 public static Graphics FromHwnd (IntPtr hwnd)
1123 GDIPlus.GdipCreateFromHWND (hwnd, out graphics);
1125 return new Graphics (graphics);
1129 public static Graphics FromHwndInternal (IntPtr hwnd)
1131 throw new NotImplementedException ();
1135 public static Graphics FromImage (Image image)
1137 if (image == null) throw new ArgumentException ();
1139 GDIPlus.GdipGetImageGraphicsContext (image.nativeObject, out graphics);
1140 Graphics result = new Graphics ((IntPtr) graphics);
1145 public static IntPtr GetHalftonePalette ()
1147 throw new NotImplementedException ();
1151 public IntPtr GetHdc ()
1154 GDIPlus.GdipGetDC (nativeObject, out hdc);
1155 return (IntPtr) hdc;
1159 public Color GetNearestColor (Color color)
1163 GDIPlus.GdipGetNearestColor (nativeObject, out argb);
1164 return Color.FromArgb (argb);
1168 public void IntersectClip (Region region)
1170 throw new NotImplementedException ();
1173 public void IntersectClip (RectangleF rect)
1175 GDIPlus.GdipSetClipRect (nativeObject, rect.X, rect.Y, rect.Width, rect.Height, CombineMode.Intersect);
1178 public void IntersectClip (Rectangle rect)
1180 GDIPlus.GdipSetClipRectI (nativeObject, rect.X, rect.Y, rect.Width, rect.Height, CombineMode.Intersect);
1183 public bool IsVisible (Point point)
1185 bool isVisible = false;
1187 GDIPlus.GdipIsVisiblePointI (nativeObject, point.X, point.Y, out isVisible);
1193 public bool IsVisible (RectangleF rect)
1195 bool isVisible = false;
1197 GDIPlus.GdipIsVisibleRect (nativeObject, rect.X, rect.Y, rect.Width, rect.Height, out isVisible);
1202 public bool IsVisible (PointF point)
1204 bool isVisible = false;
1206 GDIPlus.GdipIsVisiblePoint (nativeObject, point.X, point.Y, out isVisible);
1211 public bool IsVisible (Rectangle rect)
1213 bool isVisible = false;
1215 GDIPlus.GdipIsVisibleRectI (nativeObject, rect.X, rect.Y, rect.Width, rect.Height, out isVisible);
1220 public bool IsVisible (float x, float y)
1222 return IsVisible (new PointF (x, y));
1225 public bool IsVisible (int x, int y)
1227 return IsVisible (new Point (x, y));
1230 public bool IsVisible (float x, float y, float width, float height)
1232 return IsVisible (new RectangleF (x, y, width, height));
1236 public bool IsVisible (int x, int y, int width, int height)
1238 return IsVisible (new Rectangle (x, y, width, height));
1242 public Region [] MeasureCharacterRanges (string text, Font font, RectangleF layoutRect, StringFormat stringFormat)
1244 throw new NotImplementedException ();
1248 public SizeF MeasureString (string text, Font font)
1250 return MeasureString (text, font, new Size(0,0));
1254 public SizeF MeasureString (string text, Font font, SizeF layoutArea)
1256 int charactersFitted, linesFilled;
1257 RectangleF boundingBox = new RectangleF ();
1258 RectangleF rect = new RectangleF (0,0,layoutArea.Width, layoutArea.Height);
1260 GDIPlus.GdipMeasureString (nativeObject, text, text.Length, font.NativeObject,
1261 ref rect, IntPtr.Zero, out boundingBox, out charactersFitted, out linesFilled);
1263 return new SizeF(boundingBox.Width, boundingBox.Height);
1267 public SizeF MeasureString (string text, Font font, int width)
1269 throw new NotImplementedException ();
1273 public SizeF MeasureString (string text, Font font, SizeF layoutArea, StringFormat stringFormat)
1275 int charactersFitted, linesFilled;
1276 return MeasureString (text, font, layoutArea, stringFormat, out charactersFitted, out linesFilled);
1280 public SizeF MeasureString (string text, Font font, int width, StringFormat format)
1282 throw new NotImplementedException ();
1286 public SizeF MeasureString (string text, Font font, PointF origin, StringFormat stringFormat)
1288 RectangleF boundingBox = new RectangleF ();
1289 RectangleF rect = new RectangleF (origin.X, origin.Y, 0,0);
1290 int charactersFitted, linesFilled;
1292 GDIPlus.GdipMeasureString (nativeObject, text, text.Length, font.NativeObject,
1293 ref rect, stringFormat.NativeObject, out boundingBox, out charactersFitted, out linesFilled);
1295 return new SizeF(boundingBox.Width, boundingBox.Height);
1299 public SizeF MeasureString (string text, Font font, SizeF layoutArea, StringFormat stringFormat,
1300 out int charactersFitted, out int linesFilled)
1302 RectangleF boundingBox = new RectangleF ();
1303 RectangleF rect = new RectangleF (0,0,layoutArea.Width, layoutArea.Height);
1305 GDIPlus.GdipMeasureString (nativeObject, text, text.Length, font.NativeObject,
1306 ref rect, stringFormat.NativeObject, out boundingBox, out charactersFitted,
1309 return new SizeF(boundingBox.Width, boundingBox.Height);
1312 public void MultiplyTransform (Matrix matrix)
1314 MultiplyTransform (matrix, MatrixOrder.Prepend);
1317 public void MultiplyTransform (Matrix matrix, MatrixOrder order)
1319 GDIPlus.GdipMultiplyWorldTransform (nativeObject, matrix.nativeMatrix, order);
1322 public void ReleaseHdc (IntPtr hdc)
1324 GDIPlus.GdipReleaseDC (nativeObject, hdc);
1328 public void ReleaseHdcInternal (IntPtr hdc)
1330 throw new NotImplementedException ();
1334 public void ResetClip ()
1336 GDIPlus.GdipResetClip(nativeObject);
1339 public void ResetTransform ()
1341 GDIPlus.GdipResetWorldTransform (nativeObject);
1345 public void Restore (GraphicsState gstate)
1347 Transform = gstate.matrix.Clone();
1348 GDIPlus.GdipRestoreGraphics (nativeObject, gstate.nativeState);
1352 public void RotateTransform (float angle)
1354 RotateTransform(angle, MatrixOrder.Prepend);
1358 public void RotateTransform (float angle, MatrixOrder order)
1360 //transform.Rotate(angle, order);
1361 GDIPlus.GdipRotateWorldTransform (nativeObject, angle, order);
1365 public GraphicsState Save ()
1367 //return implementation.Save();
1368 GraphicsState state = new GraphicsState();
1369 state.matrix = Transform.Clone ();
1371 GDIPlus.GdipSaveGraphics (nativeObject, out saveState);
1372 state.nativeState = saveState;
1376 public void ScaleTransform (float sx, float sy)
1378 ScaleTransform (sx, sy, MatrixOrder.Prepend);
1381 public void ScaleTransform (float sx, float sy, MatrixOrder order)
1383 GDIPlus.GdipScaleWorldTransform (nativeObject, sx, sy, order);
1387 public void SetClip (RectangleF rect)
1389 SetClip (rect, CombineMode.Replace);
1393 public void SetClip (GraphicsPath path)
1395 SetClip (path, CombineMode.Replace);
1399 public void SetClip (Rectangle rect)
1401 SetClip (rect, CombineMode.Replace);
1405 public void SetClip (Graphics g)
1407 SetClip (g, CombineMode.Replace);
1411 public void SetClip (Graphics g, CombineMode combineMode)
1413 GDIPlus.GdipSetClipGraphics (nativeObject, g.NativeObject, combineMode);
1417 public void SetClip (Rectangle rect, CombineMode combineMode)
1419 GDIPlus.GdipSetClipRectI (nativeObject, rect.X, rect.Y, rect.Width, rect.Height, combineMode);
1423 public void SetClip (RectangleF rect, CombineMode combineMode)
1425 GDIPlus.GdipSetClipRect (nativeObject, rect.X, rect.Y, rect.Width, rect.Height, combineMode);
1429 public void SetClip (Region region, CombineMode combineMode)
1431 //GDIPlus.GdipSetClipRegion(nativeObject, region.NativeObject, combineMode); //TODO: Region not implemented yet
1435 public void SetClip (GraphicsPath path, CombineMode combineMode)
1437 GDIPlus.GdipSetClipPath (nativeObject, path.NativeObject, combineMode);
1441 public void TransformPoints (CoordinateSpace destSpace, CoordinateSpace srcSpace, PointF [] pts)
1443 IntPtr ptrPt = GDIPlus.FromPointToUnManagedMemory (pts);
1445 Status status = GDIPlus.GdipTransformPoints (nativeObject, destSpace, srcSpace, ptrPt, pts.Length);
1447 GDIPlus.FromUnManagedMemoryToPoint (ptrPt, pts);
1451 public void TransformPoints (CoordinateSpace destSpace, CoordinateSpace srcSpace, Point [] pts)
1453 IntPtr ptrPt = GDIPlus.FromPointToUnManagedMemoryI (pts);
1455 Status status = GDIPlus.GdipTransformPointsI (nativeObject, destSpace, srcSpace, ptrPt, pts.Length);
1457 GDIPlus.FromUnManagedMemoryToPointI (ptrPt, pts);
1461 public void TranslateClip (int dx, int dy)
1463 GDIPlus.GdipTranslateClipI (nativeObject, dx, dy);
1467 public void TranslateClip (float dx, float dy)
1469 GDIPlus.GdipTranslateClip (nativeObject, dx, dy);
1472 public void TranslateTransform (float dx, float dy)
1474 TranslateTransform (dx, dy, MatrixOrder.Prepend);
1478 public void TranslateTransform (float dx, float dy, MatrixOrder order)
1480 GDIPlus.GdipTranslateWorldTransform (nativeObject, dx, dy, order);
1483 public Region Clip {
1485 throw new NotImplementedException ();
1488 //throw new NotImplementedException ();
1492 public RectangleF ClipBounds {
1494 RectangleF rect = new RectangleF ();
1495 GDIPlus.GdipGetClipBounds (nativeObject, out rect);
1500 public CompositingMode CompositingMode {
1502 CompositingMode mode;
1503 GDIPlus.GdipGetCompositingMode (nativeObject, out mode);
1508 GDIPlus.GdipSetCompositingMode (nativeObject, value);
1513 public CompositingQuality CompositingQuality {
1515 CompositingQuality quality;
1517 GDIPlus.GdipGetCompositingQuality (nativeObject, out quality);
1521 GDIPlus.GdipSetCompositingQuality (nativeObject, value);
1529 GDIPlus.GdipGetDpiX (nativeObject, out x);
1538 GDIPlus.GdipGetDpiY (nativeObject, out y);
1543 public InterpolationMode InterpolationMode {
1545 InterpolationMode imode = InterpolationMode.Invalid;
1546 GDIPlus.GdipGetInterpolationMode (nativeObject, out imode);
1550 GDIPlus.GdipSetInterpolationMode (nativeObject, value);
1554 public bool IsClipEmpty {
1556 bool isEmpty = false;
1558 GDIPlus.GdipIsClipEmpty (nativeObject, out isEmpty);
1563 public bool IsVisibleClipEmpty {
1565 bool isEmpty = false;
1567 GDIPlus.GdipIsVisibleClipEmpty (nativeObject, out isEmpty);
1572 public float PageScale {
1576 GDIPlus.GdipGetPageScale (nativeObject, out scale);
1580 GDIPlus.GdipSetPageScale (nativeObject, value);
1584 public GraphicsUnit PageUnit {
1588 GDIPlus.GdipGetPageUnit (nativeObject, out unit);
1592 GDIPlus.GdipSetPageUnit (nativeObject, value);
1596 public PixelOffsetMode PixelOffsetMode {
1598 PixelOffsetMode pixelOffset = PixelOffsetMode.Invalid;
1600 GDIPlus.GdipGetPixelOffsetMode (nativeObject, out pixelOffset);
1605 GDIPlus.GdipSetPixelOffsetMode (nativeObject, value);
1609 public Point RenderingOrigin {
1612 GDIPlus.GdipGetRenderingOrigin (
1613 nativeObject, out x, out y);
1615 return new Point (x, y);
1619 GDIPlus.GdipSetRenderingOrigin (nativeObject, value.X, value.Y);
1623 public SmoothingMode SmoothingMode {
1625 SmoothingMode mode = SmoothingMode.Invalid;
1627 GDIPlus.GdipGetSmoothingMode (nativeObject, out mode);
1633 GDIPlus.GdipSetSmoothingMode (nativeObject, value);
1637 public int TextContrast {
1641 GDIPlus.GdipGetTextContrast (nativeObject, out contrast);
1646 GDIPlus.GdipSetTextContrast (nativeObject, value);
1650 public TextRenderingHint TextRenderingHint {
1652 TextRenderingHint hint;
1654 GDIPlus.GdipGetTextRenderingHint (nativeObject, out hint);
1659 GDIPlus.GdipSetTextRenderingHint (nativeObject, value);
1663 public Matrix Transform {
1665 Matrix matrix = new Matrix ();
1666 GDIPlus.GdipGetWorldTransform (nativeObject, matrix.nativeMatrix);
1671 GDIPlus.GdipSetWorldTransform (nativeObject, value.nativeMatrix);
1675 public RectangleF VisibleClipBounds {
1679 GDIPlus.GdipGetVisibleClipBounds (nativeObject, out rect);