2 * @file gdiplusgraphics.h
3 * @copy 2012 MinGW.org project
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
24 #ifndef __GDIPLUS_GRAPHICS_H
25 #define __GDIPLUS_GRAPHICS_H
26 #pragma GCC system_header
34 #error "A C++ compiler is required to include gdiplusgraphics.h."
37 class Graphics: public GdiplusBase
40 friend class CachedBitmap;
42 friend class GraphicsPath;
43 friend class Metafile;
47 static Graphics* FromHDC(HDC hdc)
49 return new Graphics(hdc);
51 static Graphics* FromHDC(HDC hdc, HANDLE hdevice)
53 return new Graphics(hdc, hdevice);
55 static Graphics* FromHWND(HWND hwnd, BOOL icm = FALSE)
57 return new Graphics(hwnd, icm);
59 static Graphics* FromImage(Image *image)
61 return new Graphics(image);
63 static HPALETTE GetHalftonePalette()
65 return DllExports::GdipCreateHalftonePalette();
68 Graphics(Image *image): nativeGraphics(NULL), lastStatus(Ok)
70 lastStatus = DllExports::GdipGetImageGraphicsContext(
71 image ? image->nativeImage : NULL,
74 Graphics(HDC hdc): nativeGraphics(NULL), lastStatus(Ok)
76 lastStatus = DllExports::GdipCreateFromHDC(
77 hdc, &nativeGraphics);
79 Graphics(HDC hdc, HANDLE hdevice): nativeGraphics(NULL), lastStatus(Ok)
81 lastStatus = DllExports::GdipCreateFromHDC2(
82 hdc, hdevice, &nativeGraphics);
84 Graphics(HWND hwnd, BOOL icm = FALSE):
85 nativeGraphics(NULL), lastStatus(Ok)
88 lastStatus = DllExports::GdipCreateFromHWNDICM(
89 hwnd, &nativeGraphics);
91 lastStatus = DllExports::GdipCreateFromHWND(
92 hwnd, &nativeGraphics);
97 DllExports::GdipDeleteGraphics(nativeGraphics);
100 Status AddMetafileComment(const BYTE *data, UINT sizeData)
102 return updateStatus(DllExports::GdipComment(
103 nativeGraphics, sizeData, data));
105 GraphicsContainer BeginContainer()
107 GraphicsContainer result = 0;
108 updateStatus(DllExports::GdipBeginContainer2(
109 nativeGraphics, &result));
112 GraphicsContainer BeginContainer(const RectF& dstrect,
113 const RectF& srcrect, Unit unit)
115 GraphicsContainer result = 0;
116 updateStatus(DllExports::GdipBeginContainer(
117 nativeGraphics, &dstrect, &srcrect, unit,
121 GraphicsContainer BeginContainer(const Rect& dstrect,
122 const Rect& srcrect, Unit unit)
124 GraphicsContainer result = 0;
125 updateStatus(DllExports::GdipBeginContainerI(
126 nativeGraphics, &dstrect, &srcrect, unit,
130 Status Clear(const Color& color)
132 return updateStatus(DllExports::GdipGraphicsClear(
133 nativeGraphics, color.GetValue()));
135 Status DrawArc(const Pen *pen, REAL x, REAL y, REAL width, REAL height,
136 REAL startAngle, REAL sweepAngle)
138 return updateStatus(DllExports::GdipDrawArc(
139 nativeGraphics, pen ? pen->nativePen : NULL,
140 x, y, width, height, startAngle, sweepAngle));
142 Status DrawArc(const Pen *pen, INT x, INT y, INT width, INT height,
143 REAL startAngle, REAL sweepAngle)
145 return updateStatus(DllExports::GdipDrawArcI(
146 nativeGraphics, pen ? pen->nativePen : NULL,
147 x, y, width, height, startAngle, sweepAngle));
149 Status DrawArc(const Pen *pen, const RectF& rect,
150 REAL startAngle, REAL sweepAngle)
152 return updateStatus(DllExports::GdipDrawArc(
153 nativeGraphics, pen ? pen->nativePen : NULL,
154 rect.X, rect.Y, rect.Width, rect.Height,
155 startAngle, sweepAngle));
157 Status DrawArc(const Pen *pen, const Rect& rect,
158 REAL startAngle, REAL sweepAngle)
160 return updateStatus(DllExports::GdipDrawArcI(
161 nativeGraphics, pen ? pen->nativePen : NULL,
162 rect.X, rect.Y, rect.Width, rect.Height,
163 startAngle, sweepAngle));
165 Status DrawBezier(const Pen *pen,
166 REAL x1, REAL y1, REAL x2, REAL y2,
167 REAL x3, REAL y3, REAL x4, REAL y4)
169 return updateStatus(DllExports::GdipDrawBezier(
170 nativeGraphics, pen ? pen->nativePen : NULL,
171 x1, y1, x2, y2, x3, y3, x4, y4));
173 Status DrawBezier(const Pen *pen,
174 INT x1, INT y1, INT x2, INT y2,
175 INT x3, INT y3, INT x4, INT y4)
177 return updateStatus(DllExports::GdipDrawBezierI(
178 nativeGraphics, pen ? pen->nativePen : NULL,
179 x1, y1, x2, y2, x3, y3, x4, y4));
181 Status DrawBezier(const Pen *pen,
182 const PointF& pt1, const PointF& pt2,
183 const PointF& pt3, const PointF& pt4)
185 return updateStatus(DllExports::GdipDrawBezier(
186 nativeGraphics, pen ? pen->nativePen : NULL,
187 pt1.X, pt1.Y, pt2.X, pt2.Y,
188 pt3.X, pt3.Y, pt4.X, pt4.Y));
190 Status DrawBezier(const Pen *pen,
191 const Point& pt1, const Point& pt2,
192 const Point& pt3, const Point& pt4)
194 return updateStatus(DllExports::GdipDrawBezierI(
195 nativeGraphics, pen ? pen->nativePen : NULL,
196 pt1.X, pt1.Y, pt2.X, pt2.Y,
197 pt3.X, pt3.Y, pt4.X, pt4.Y));
199 Status DrawBeziers(const Pen *pen, const PointF *points, INT count)
201 return updateStatus(DllExports::GdipDrawBeziers(
202 nativeGraphics, pen ? pen->nativePen : NULL,
205 Status DrawBeziers(const Pen *pen, const Point *points, INT count)
207 return updateStatus(DllExports::GdipDrawBeziersI(
208 nativeGraphics, pen ? pen->nativePen : NULL,
211 Status DrawCachedBitmap(CachedBitmap *cb, INT x, INT y)
213 return updateStatus(DllExports::GdipDrawCachedBitmap(
215 cb ? cb->nativeCachedBitmap : NULL,
218 Status DrawClosedCurve(const Pen *pen, const PointF *points, INT count)
220 return updateStatus(DllExports::GdipDrawClosedCurve(
221 nativeGraphics, pen ? pen->nativePen : NULL,
224 Status DrawClosedCurve(const Pen *pen, const Point *points, INT count)
226 return updateStatus(DllExports::GdipDrawClosedCurveI(
227 nativeGraphics, pen ? pen->nativePen : NULL,
230 Status DrawClosedCurve(const Pen *pen, const PointF *points, INT count,
233 return updateStatus(DllExports::GdipDrawClosedCurve2(
234 nativeGraphics, pen ? pen->nativePen : NULL,
235 points, count, tension));
237 Status DrawClosedCurve(const Pen *pen, const Point *points, INT count,
240 return updateStatus(DllExports::GdipDrawClosedCurve2I(
241 nativeGraphics, pen ? pen->nativePen : NULL,
242 points, count, tension));
244 Status DrawCurve(const Pen *pen, const PointF *points, INT count)
246 return updateStatus(DllExports::GdipDrawCurve(
247 nativeGraphics, pen ? pen->nativePen : NULL,
250 Status DrawCurve(const Pen *pen, const Point *points, INT count)
252 return updateStatus(DllExports::GdipDrawCurveI(
253 nativeGraphics, pen ? pen->nativePen : NULL,
256 Status DrawCurve(const Pen *pen, const PointF *points, INT count,
259 return updateStatus(DllExports::GdipDrawCurve2(
260 nativeGraphics, pen ? pen->nativePen : NULL,
261 points, count, tension));
263 Status DrawCurve(const Pen *pen, const Point *points, INT count,
266 return updateStatus(DllExports::GdipDrawCurve2I(
267 nativeGraphics, pen ? pen->nativePen : NULL,
268 points, count, tension));
270 Status DrawCurve(const Pen *pen, const PointF *points, INT count,
271 INT offset, INT numberOfSegments, REAL tension)
273 return updateStatus(DllExports::GdipDrawCurve3(
274 nativeGraphics, pen ? pen->nativePen : NULL,
275 points, count, offset,
276 numberOfSegments, tension));
278 Status DrawCurve(const Pen *pen, const Point *points, INT count,
279 INT offset, INT numberOfSegments, REAL tension)
281 return updateStatus(DllExports::GdipDrawCurve3I(
282 nativeGraphics, pen ? pen->nativePen : NULL,
283 points, count, offset,
284 numberOfSegments, tension));
286 Status DrawDriverString(const UINT16 *text, INT length,
287 const Font *font, const Brush *brush,
288 const PointF *positions, INT flags,
289 const Matrix *matrix)
291 return updateStatus(DllExports::GdipDrawDriverString(
292 nativeGraphics, text, length,
293 font ? font->nativeFont : NULL,
294 brush ? brush->nativeBrush : NULL,
296 matrix ? matrix->nativeMatrix : NULL));
298 Status DrawEllipse(const Pen *pen,
299 REAL x, REAL y, REAL width, REAL height)
301 return updateStatus(DllExports::GdipDrawEllipse(
302 nativeGraphics, pen ? pen->nativePen : NULL,
303 x, y, width, height));
305 Status DrawEllipse(const Pen *pen, INT x, INT y, INT width, INT height)
307 return updateStatus(DllExports::GdipDrawEllipseI(
308 nativeGraphics, pen ? pen->nativePen : NULL,
309 x, y, width, height));
311 Status DrawEllipse(const Pen *pen, const RectF& rect)
313 return updateStatus(DllExports::GdipDrawEllipse(
314 nativeGraphics, pen ? pen->nativePen : NULL,
315 rect.X, rect.Y, rect.Width, rect.Height));
317 Status DrawEllipse(const Pen *pen, const Rect& rect)
319 return updateStatus(DllExports::GdipDrawEllipseI(
320 nativeGraphics, pen ? pen->nativePen : NULL,
321 rect.X, rect.Y, rect.Width, rect.Height));
323 Status DrawImage(Image *image, REAL x, REAL y)
325 return updateStatus(DllExports::GdipDrawImage(
327 image ? image->nativeImage : NULL,
330 Status DrawImage(Image *image, INT x, INT y)
332 return updateStatus(DllExports::GdipDrawImageI(
334 image ? image->nativeImage : NULL,
337 Status DrawImage(Image *image, const PointF& point)
339 return updateStatus(DllExports::GdipDrawImage(
341 image ? image->nativeImage : NULL,
344 Status DrawImage(Image *image, const Point& point)
346 return updateStatus(DllExports::GdipDrawImageI(
348 image ? image->nativeImage : NULL,
351 Status DrawImage(Image *image, REAL x, REAL y, REAL width, REAL height)
353 return updateStatus(DllExports::GdipDrawImageRect(
355 image ? image->nativeImage : NULL,
356 x, y, width, height));
358 Status DrawImage(Image *image, INT x, INT y, INT width, INT height)
360 return updateStatus(DllExports::GdipDrawImageRectI(
362 image ? image->nativeImage : NULL,
363 x, y, width, height));
365 Status DrawImage(Image *image, const RectF& rect)
367 return updateStatus(DllExports::GdipDrawImageRect(
369 image ? image->nativeImage : NULL,
370 rect.X, rect.Y, rect.Width, rect.Height));
372 Status DrawImage(Image *image, const Rect& rect)
374 return updateStatus(DllExports::GdipDrawImageRectI(
376 image ? image->nativeImage : NULL,
377 rect.X, rect.Y, rect.Width, rect.Height));
379 Status DrawImage(Image *image, const PointF *destPoints, INT count)
381 return updateStatus(DllExports::GdipDrawImagePoints(
383 image ? image->nativeImage : NULL,
386 Status DrawImage(Image *image, const Point *destPoints, INT count)
388 return updateStatus(DllExports::GdipDrawImagePointsI(
390 image ? image->nativeImage : NULL,
393 Status DrawImage(Image *image, REAL x, REAL y, REAL srcx, REAL srcy,
394 REAL srcwidth, REAL srcheight, Unit srcUnit)
396 return updateStatus(DllExports::GdipDrawImagePointRect(
398 image ? image->nativeImage : NULL,
399 x, y, srcx, srcy, srcwidth, srcheight,
402 Status DrawImage(Image *image, INT x, INT y, INT srcx, INT srcy,
403 INT srcwidth, INT srcheight, Unit srcUnit)
405 return updateStatus(DllExports::GdipDrawImagePointRectI(
407 image ? image->nativeImage : NULL,
408 x, y, srcx, srcy, srcwidth, srcheight,
411 Status DrawImage(Image *image, const RectF& destRect,
412 REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight,
414 const ImageAttributes *imageAttributes = NULL,
415 DrawImageAbort callback = NULL,
416 VOID *callbackData = NULL)
418 return updateStatus(DllExports::GdipDrawImageRectRect(
420 image ? image->nativeImage : NULL,
421 destRect.X, destRect.Y,
422 destRect.Width, destRect.Height,
423 srcx, srcy, srcwidth, srcheight, srcUnit,
424 imageAttributes ? imageAttributes->nativeImageAttributes : NULL,
425 callback, callbackData));
427 Status DrawImage(Image *image, const Rect& destRect,
428 INT srcx, INT srcy, INT srcwidth, INT srcheight,
430 const ImageAttributes *imageAttributes = NULL,
431 DrawImageAbort callback = NULL,
432 VOID *callbackData = NULL)
434 return updateStatus(DllExports::GdipDrawImageRectRectI(
436 image ? image->nativeImage : NULL,
437 destRect.X, destRect.Y,
438 destRect.Width, destRect.Height,
439 srcx, srcy, srcwidth, srcheight, srcUnit,
440 imageAttributes ? imageAttributes->nativeImageAttributes : NULL,
441 callback, callbackData));
443 Status DrawImage(Image *image, const RectF& destRect,
444 const RectF& sourceRect, Unit srcUnit,
445 const ImageAttributes *imageAttributes = NULL)
447 return updateStatus(DllExports::GdipDrawImageRectRectI(
449 image ? image->nativeImage : NULL,
450 destRect.X, destRect.Y,
451 destRect.Width, destRect.Height,
452 sourceRect.X, sourceRect.Y,
453 sourceRect.Width, sourceRect.Height, srcUnit,
454 imageAttributes ? imageAttributes->nativeImageAttributes : NULL,
457 Status DrawImage(Image *image, const PointF *destPoints, INT count,
458 REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight,
460 const ImageAttributes *imageAttributes = NULL,
461 DrawImageAbort callback = NULL,
462 VOID *callbackData = NULL)
464 return updateStatus(DllExports::GdipDrawImagePointsRect(
466 image ? image->nativeImage : NULL,
468 srcx, srcy, srcwidth, srcheight, srcUnit,
469 imageAttributes ? imageAttributes->nativeImageAttributes : NULL,
470 callback, callbackData));
472 Status DrawImage(Image *image, const Point *destPoints, INT count,
473 INT srcx, INT srcy, INT srcwidth, INT srcheight,
475 const ImageAttributes *imageAttributes = NULL,
476 DrawImageAbort callback = NULL,
477 VOID *callbackData = NULL)
479 return updateStatus(DllExports::GdipDrawImagePointsRectI(
481 image ? image->nativeImage : NULL,
483 srcx, srcy, srcwidth, srcheight, srcUnit,
484 imageAttributes ? imageAttributes->nativeImageAttributes : NULL,
485 callback, callbackData));
487 // TODO: [GDI+ 1.1] Graphics::DrawImage(..Effect..)
488 //Status DrawImage(Image *image, RectF *sourceRect, Matrix *matrix,
489 // Effect *effect, ImageAttributes *imageAttributes,
492 // return updateStatus(DllExports::GdipDrawImageFX(
494 // image ? image->nativeImage : NULL,
496 // matrix ? matrix->nativeMatrix : NULL,
497 // effect ? effect->nativeEffect : NULL,
498 // imageAttributes ? imageAttributes->nativeImageAttributes : NULL,
501 Status DrawLine(const Pen *pen, REAL x1, REAL y1, REAL x2, REAL y2)
503 return updateStatus(DllExports::GdipDrawLine(
504 nativeGraphics, pen ? pen->nativePen : NULL,
507 Status DrawLine(const Pen *pen, INT x1, INT y1, INT x2, INT y2)
509 return updateStatus(DllExports::GdipDrawLineI(
510 nativeGraphics, pen ? pen->nativePen : NULL,
513 Status DrawLine(const Pen *pen, const PointF& pt1, const PointF& pt2)
515 return updateStatus(DllExports::GdipDrawLine(
516 nativeGraphics, pen ? pen->nativePen : NULL,
517 pt1.X, pt1.Y, pt2.X, pt2.Y));
519 Status DrawLine(const Pen *pen, const Point& pt1, const Point& pt2)
521 return updateStatus(DllExports::GdipDrawLineI(
522 nativeGraphics, pen ? pen->nativePen : NULL,
523 pt1.X, pt1.Y, pt2.X, pt2.Y));
525 Status DrawLines(const Pen *pen, const PointF *points, INT count)
527 return updateStatus(DllExports::GdipDrawLines(
528 nativeGraphics, pen ? pen->nativePen : NULL,
531 Status DrawLines(const Pen *pen, const Point *points, INT count)
533 return updateStatus(DllExports::GdipDrawLinesI(
534 nativeGraphics, pen ? pen->nativePen : NULL,
537 Status DrawPath(const Pen *pen, const GraphicsPath *path)
539 return updateStatus(DllExports::GdipDrawPath(
540 nativeGraphics, pen ? pen->nativePen : NULL,
541 path ? path->nativePath : NULL));
543 Status DrawPie(const Pen *pen, REAL x, REAL y, REAL width, REAL height,
544 REAL startAngle, REAL sweepAngle)
546 return updateStatus(DllExports::GdipDrawPie(
547 nativeGraphics, pen ? pen->nativePen : NULL,
548 x, y, width, height, startAngle, sweepAngle));
550 Status DrawPie(const Pen *pen, INT x, INT y, INT width, INT height,
551 REAL startAngle, REAL sweepAngle)
553 return updateStatus(DllExports::GdipDrawPieI(
554 nativeGraphics, pen ? pen->nativePen : NULL,
555 x, y, width, height, startAngle, sweepAngle));
557 Status DrawPie(const Pen *pen, const RectF& rect,
558 REAL startAngle, REAL sweepAngle)
560 return updateStatus(DllExports::GdipDrawPie(
561 nativeGraphics, pen ? pen->nativePen : NULL,
562 rect.X, rect.Y, rect.Width, rect.Height,
563 startAngle, sweepAngle));
565 Status DrawPie(const Pen *pen, const Rect& rect,
566 REAL startAngle, REAL sweepAngle)
568 return updateStatus(DllExports::GdipDrawPieI(
569 nativeGraphics, pen ? pen->nativePen : NULL,
570 rect.X, rect.Y, rect.Width, rect.Height,
571 startAngle, sweepAngle));
573 Status DrawPolygon(const Pen *pen, const PointF *points, INT count)
575 return updateStatus(DllExports::GdipDrawPolygon(
576 nativeGraphics, pen ? pen->nativePen : NULL,
579 Status DrawPolygon(const Pen *pen, const Point *points, INT count)
581 return updateStatus(DllExports::GdipDrawPolygonI(
582 nativeGraphics, pen ? pen->nativePen : NULL,
585 Status DrawRectangle(const Pen *pen,
586 REAL x, REAL y, REAL width, REAL height)
588 return updateStatus(DllExports::GdipDrawRectangle(
589 nativeGraphics, pen ? pen->nativePen : NULL,
590 x, y, width, height));
592 Status DrawRectangle(const Pen *pen,
593 INT x, INT y, INT width, INT height)
595 return updateStatus(DllExports::GdipDrawRectangleI(
596 nativeGraphics, pen ? pen->nativePen : NULL,
597 x, y, width, height));
599 Status DrawRectangle(const Pen *pen, const RectF& rect)
601 return updateStatus(DllExports::GdipDrawRectangle(
602 nativeGraphics, pen ? pen->nativePen : NULL,
603 rect.X, rect.Y, rect.Width, rect.Height));
605 Status DrawRectangle(const Pen *pen, const Rect& rect)
607 return updateStatus(DllExports::GdipDrawRectangleI(
608 nativeGraphics, pen ? pen->nativePen : NULL,
609 rect.X, rect.Y, rect.Width, rect.Height));
611 Status DrawRectangles(const Pen *pen, const RectF *rects, INT count)
613 return updateStatus(DllExports::GdipDrawRectangles(
614 nativeGraphics, pen ? pen->nativePen : NULL,
617 Status DrawRectangles(const Pen *pen, const Rect *rects, INT count)
619 return updateStatus(DllExports::GdipDrawRectanglesI(
620 nativeGraphics, pen ? pen->nativePen : NULL,
623 Status DrawString(const WCHAR *string, INT length, const Font *font,
624 const PointF& origin, const Brush *brush)
626 RectF layoutRect(origin.X, origin.Y, 0.0f, 0.0f);
627 return updateStatus(DllExports::GdipDrawString(
628 nativeGraphics, string, length,
629 font ? font->nativeFont : NULL,
631 brush ? brush->nativeBrush : NULL));
633 Status DrawString(const WCHAR *string, INT length,
634 const Font *font, const PointF& origin,
635 const StringFormat *stringFormat, const Brush *brush)
637 RectF layoutRect(origin.X, origin.Y, 0.0f, 0.0f);
638 return updateStatus(DllExports::GdipDrawString(
639 nativeGraphics, string, length,
640 font ? font->nativeFont : NULL,
642 stringFormat ? stringFormat->nativeStringFormat : NULL,
643 brush ? brush->nativeBrush : NULL));
645 Status DrawString(const WCHAR *string, INT length,
646 const Font *font, const RectF& layoutRect,
647 const StringFormat *stringFormat, const Brush *brush)
649 return updateStatus(DllExports::GdipDrawString(
650 nativeGraphics, string, length,
651 font ? font->nativeFont : NULL,
653 stringFormat ? stringFormat->nativeStringFormat : NULL,
654 brush ? brush->nativeBrush : NULL));
656 Status EndContainer(GraphicsContainer state)
658 return updateStatus(DllExports::GdipEndContainer(
659 nativeGraphics, state));
661 Status EnumerateMetafile(const Metafile *metafile,
662 const PointF& destPoint,
663 EnumerateMetafileProc callback,
664 VOID *callbackData = NULL,
665 ImageAttributes *imageAttributes = NULL)
667 return updateStatus(DllExports::GdipEnumerateMetafileDestPoint(
669 metafile ? ((GpMetafile*) metafile->nativeImage) : NULL,
670 destPoint, callback, callbackData,
671 imageAttributes ? imageAttributes->nativeImageAttributes : NULL));
673 Status EnumerateMetafile(const Metafile *metafile,
674 const Point& destPoint,
675 EnumerateMetafileProc callback,
676 VOID *callbackData = NULL,
677 ImageAttributes *imageAttributes = NULL)
679 return updateStatus(DllExports::GdipEnumerateMetafileDestPointI(
681 metafile ? ((GpMetafile*) metafile->nativeImage) : NULL,
682 destPoint, callback, callbackData,
683 imageAttributes ? imageAttributes->nativeImageAttributes : NULL));
685 Status EnumerateMetafile(const Metafile *metafile,
686 const RectF& destRect,
687 EnumerateMetafileProc callback,
688 VOID *callbackData = NULL,
689 ImageAttributes *imageAttributes = NULL)
691 return updateStatus(DllExports::GdipEnumerateMetafileDestRect(
693 metafile ? ((GpMetafile*) metafile->nativeImage) : NULL,
694 destRect, callback, callbackData,
695 imageAttributes ? imageAttributes->nativeImageAttributes : NULL));
697 Status EnumerateMetafile(const Metafile *metafile,
698 const Rect& destRect,
699 EnumerateMetafileProc callback,
700 VOID *callbackData = NULL,
701 ImageAttributes *imageAttributes = NULL)
703 return updateStatus(DllExports::GdipEnumerateMetafileDestRectI(
705 metafile ? ((GpMetafile*) metafile->nativeImage) : NULL,
706 destRect, callback, callbackData,
707 imageAttributes ? imageAttributes->nativeImageAttributes : NULL));
709 Status EnumerateMetafile(const Metafile *metafile,
710 const PointF *destPoints, INT count,
711 EnumerateMetafileProc callback,
712 VOID *callbackData = NULL,
713 ImageAttributes *imageAttributes = NULL)
715 return updateStatus(DllExports::GdipEnumerateMetafileDestPoints(
717 metafile ? ((GpMetafile*) metafile->nativeImage) : NULL,
718 destPoints, count, callback, callbackData,
719 imageAttributes ? imageAttributes->nativeImageAttributes : NULL));
721 Status EnumerateMetafile(const Metafile *metafile,
722 const Point *destPoints, INT count,
723 EnumerateMetafileProc callback,
724 VOID *callbackData = NULL,
725 ImageAttributes *imageAttributes = NULL)
727 return updateStatus(DllExports::GdipEnumerateMetafileDestPointsI(
729 metafile ? ((GpMetafile*) metafile->nativeImage) : NULL,
730 destPoints, count, callback, callbackData,
731 imageAttributes ? imageAttributes->nativeImageAttributes : NULL));
733 Status EnumerateMetafile(const Metafile *metafile,
734 const PointF& destPoint,
735 const RectF& srcRect, Unit srcUnit,
736 EnumerateMetafileProc callback,
737 VOID *callbackData = NULL,
738 ImageAttributes *imageAttributes = NULL)
740 return updateStatus(DllExports::GdipEnumerateMetafileSrcRectDestPoint(
742 metafile ? ((GpMetafile*) metafile->nativeImage) : NULL,
743 destPoint, srcRect, srcUnit,
744 callback, callbackData,
745 imageAttributes ? imageAttributes->nativeImageAttributes : NULL));
747 Status EnumerateMetafile(const Metafile *metafile,
748 const Point& destPoint,
749 const Rect& srcRect, Unit srcUnit,
750 EnumerateMetafileProc callback,
751 VOID *callbackData = NULL,
752 ImageAttributes *imageAttributes = NULL)
754 return updateStatus(DllExports::GdipEnumerateMetafileSrcRectDestPointI(
756 metafile ? ((GpMetafile*) metafile->nativeImage) : NULL,
757 destPoint, srcRect, srcUnit,
758 callback, callbackData,
759 imageAttributes ? imageAttributes->nativeImageAttributes : NULL));
761 Status EnumerateMetafile(const Metafile *metafile,
762 const RectF& destRect,
763 const RectF& srcRect, Unit srcUnit,
764 EnumerateMetafileProc callback,
765 VOID *callbackData = NULL,
766 ImageAttributes *imageAttributes = NULL)
768 return updateStatus(DllExports::GdipEnumerateMetafileSrcRectDestRect(
770 metafile ? ((GpMetafile*) metafile->nativeImage) : NULL,
771 destRect, srcRect, srcUnit,
772 callback, callbackData,
773 imageAttributes ? imageAttributes->nativeImageAttributes : NULL));
775 Status EnumerateMetafile(const Metafile *metafile,
776 const Rect& destRect,
777 const Rect& srcRect, Unit srcUnit,
778 EnumerateMetafileProc callback,
779 VOID *callbackData = NULL,
780 ImageAttributes *imageAttributes = NULL)
782 return updateStatus(DllExports::GdipEnumerateMetafileSrcRectDestRectI(
784 metafile ? ((GpMetafile*) metafile->nativeImage) : NULL,
785 destRect, srcRect, srcUnit,
786 callback, callbackData,
787 imageAttributes ? imageAttributes->nativeImageAttributes : NULL));
789 Status EnumerateMetafile(const Metafile *metafile,
790 const PointF* destPoints, INT count,
791 const RectF& srcRect, Unit srcUnit,
792 EnumerateMetafileProc callback,
793 VOID *callbackData = NULL,
794 ImageAttributes *imageAttributes = NULL)
796 return updateStatus(DllExports::GdipEnumerateMetafileSrcRectDestPoints(
798 metafile ? ((GpMetafile*) metafile->nativeImage) : NULL,
799 destPoints, count, srcRect, srcUnit,
800 callback, callbackData,
801 imageAttributes ? imageAttributes->nativeImageAttributes : NULL));
803 Status EnumerateMetafile(const Metafile *metafile,
804 const Point* destPoints, INT count,
805 const Rect& srcRect, Unit srcUnit,
806 EnumerateMetafileProc callback,
807 VOID *callbackData = NULL,
808 ImageAttributes *imageAttributes = NULL)
810 return updateStatus(DllExports::GdipEnumerateMetafileSrcRectDestPointsI(
812 metafile ? ((GpMetafile*) metafile->nativeImage) : NULL,
813 destPoints, count, srcRect, srcUnit,
814 callback, callbackData,
815 imageAttributes ? imageAttributes->nativeImageAttributes : NULL));
817 Status ExcludeClip(const RectF& rect)
819 return updateStatus(DllExports::GdipSetClipRect(
821 rect.X, rect.Y, rect.Width, rect.Height,
822 CombineModeExclude));
824 Status ExcludeClip(const Rect& rect)
826 return updateStatus(DllExports::GdipSetClipRectI(
828 rect.X, rect.Y, rect.Width, rect.Height,
829 CombineModeExclude));
831 Status ExcludeClip(const Region *region)
833 return updateStatus(DllExports::GdipSetClipRegion(
835 region ? region->nativeRegion : NULL,
836 CombineModeExclude));
838 Status FillClosedCurve(const Brush *brush,
839 const PointF *points, INT count)
841 return updateStatus(DllExports::GdipFillClosedCurve(
843 brush ? brush->nativeBrush : NULL,
846 Status FillClosedCurve(const Brush *brush,
847 const Point *points, INT count)
849 return updateStatus(DllExports::GdipFillClosedCurveI(
851 brush ? brush->nativeBrush : NULL,
854 Status FillClosedCurve(const Brush *brush,
855 const PointF *points, INT count,
856 FillMode fillMode, REAL tension = 0.5f)
858 return updateStatus(DllExports::GdipFillClosedCurve2(
860 brush ? brush->nativeBrush : NULL,
861 points, count, tension, fillMode));
863 Status FillClosedCurve(const Brush *brush,
864 const Point *points, INT count,
865 FillMode fillMode, REAL tension = 0.5f)
867 return updateStatus(DllExports::GdipFillClosedCurve2I(
869 brush ? brush->nativeBrush : NULL,
870 points, count, tension, fillMode));
872 Status FillEllipse(const Brush *brush,
873 REAL x, REAL y, REAL width, REAL height)
875 return updateStatus(DllExports::GdipFillEllipse(
877 brush ? brush->nativeBrush : NULL,
878 x, y, width, height));
880 Status FillEllipse(const Brush *brush,
881 INT x, INT y, INT width, INT height)
883 return updateStatus(DllExports::GdipFillEllipseI(
885 brush ? brush->nativeBrush : NULL,
886 x, y, width, height));
888 Status FillEllipse(const Brush *brush, const RectF& rect)
890 return updateStatus(DllExports::GdipFillEllipse(
892 brush ? brush->nativeBrush : NULL,
893 rect.X, rect.Y, rect.Width, rect.Height));
895 Status FillEllipse(const Brush *brush, const Rect& rect)
897 return updateStatus(DllExports::GdipFillEllipseI(
899 brush ? brush->nativeBrush : NULL,
900 rect.X, rect.Y, rect.Width, rect.Height));
902 Status FillPath(const Brush *brush, const GraphicsPath *path)
904 return updateStatus(DllExports::GdipFillPath(
906 brush ? brush->nativeBrush : NULL,
907 path ? path->nativePath : NULL));
909 Status FillPie(const Brush *brush,
910 REAL x, REAL y, REAL width, REAL height,
911 REAL startAngle, REAL sweepAngle)
913 return updateStatus(DllExports::GdipFillPie(
915 brush ? brush->nativeBrush : NULL,
916 x, y, width, height, startAngle, sweepAngle));
918 Status FillPie(const Brush *brush, INT x, INT y, INT width, INT height,
919 REAL startAngle, REAL sweepAngle)
921 return updateStatus(DllExports::GdipFillPieI(
923 brush ? brush->nativeBrush : NULL,
924 x, y, width, height, startAngle, sweepAngle));
926 Status FillPie(const Brush *brush, const RectF& rect,
927 REAL startAngle, REAL sweepAngle)
929 return updateStatus(DllExports::GdipFillPie(
931 brush ? brush->nativeBrush : NULL,
932 rect.X, rect.Y, rect.Width, rect.Height,
933 startAngle, sweepAngle));
935 Status FillPie(const Brush *brush, const Rect& rect,
936 REAL startAngle, REAL sweepAngle)
938 return updateStatus(DllExports::GdipFillPieI(
940 brush ? brush->nativeBrush : NULL,
941 rect.X, rect.Y, rect.Width, rect.Height,
942 startAngle, sweepAngle));
944 Status FillPolygon(const Brush *brush, const PointF *points, INT count)
946 return updateStatus(DllExports::GdipFillPolygon(
948 brush ? brush->nativeBrush : NULL,
949 points, count, FillModeAlternate));
951 Status FillPolygon(const Brush *brush, const Point *points, INT count)
953 return updateStatus(DllExports::GdipFillPolygonI(
955 brush ? brush->nativeBrush : NULL,
956 points, count, FillModeAlternate));
958 Status FillPolygon(const Brush *brush, const PointF *points, INT count,
961 return updateStatus(DllExports::GdipFillPolygon(
963 brush ? brush->nativeBrush : NULL,
964 points, count, fillMode));
966 Status FillPolygon(const Brush *brush, const Point *points, INT count,
969 return updateStatus(DllExports::GdipFillPolygonI(
971 brush ? brush->nativeBrush : NULL,
972 points, count, fillMode));
974 Status FillRectangle(const Brush *brush,
975 REAL x, REAL y, REAL width, REAL height)
977 return updateStatus(DllExports::GdipFillRectangle(
979 brush ? brush->nativeBrush : NULL,
980 x, y, width, height));
982 Status FillRectangle(const Brush *brush,
983 INT x, INT y, INT width, INT height)
985 return updateStatus(DllExports::GdipFillRectangleI(
987 brush ? brush->nativeBrush : NULL,
988 x, y, width, height));
990 Status FillRectangle(const Brush *brush, const RectF& rect)
992 return updateStatus(DllExports::GdipFillRectangle(
994 brush ? brush->nativeBrush : NULL,
995 rect.X, rect.Y, rect.Width, rect.Height));
997 Status FillRectangle(const Brush *brush, const Rect& rect)
999 return updateStatus(DllExports::GdipFillRectangleI(
1001 brush ? brush->nativeBrush : NULL,
1002 rect.X, rect.Y, rect.Width, rect.Height));
1004 Status FillRectangles(const Brush *brush, const RectF *rects, INT count)
1006 return updateStatus(DllExports::GdipFillRectangles(
1008 brush ? brush->nativeBrush : NULL,
1011 Status FillRectangles(const Brush *brush, const Rect *rects, INT count)
1013 return updateStatus(DllExports::GdipFillRectanglesI(
1015 brush ? brush->nativeBrush : NULL,
1018 Status FillRegion(const Brush *brush, const Region *region)
1020 return updateStatus(DllExports::GdipFillRegion(
1022 brush ? brush->nativeBrush : NULL,
1023 region ? region->nativeRegion : NULL));
1025 VOID Flush(FlushIntention intention = FlushIntentionFlush)
1027 updateStatus(DllExports::GdipFlush(nativeGraphics, intention));
1029 Status GetClip(Region *region) const
1031 return updateStatus(DllExports::GdipGetClip(
1033 region ? region->nativeRegion : NULL));
1035 Status GetClipBounds(RectF *rect) const
1037 return updateStatus(DllExports::GdipGetClipBounds(
1038 nativeGraphics, rect));
1040 Status GetClipBounds(Rect *rect) const
1042 return updateStatus(DllExports::GdipGetClipBoundsI(
1043 nativeGraphics, rect));
1045 CompositingMode GetCompositingMode() const
1047 CompositingMode result = CompositingModeSourceOver;
1048 updateStatus(DllExports::GdipGetCompositingMode(
1049 nativeGraphics, &result));
1052 CompositingQuality GetCompositingQuality() const
1054 CompositingQuality result = CompositingQualityDefault;
1055 updateStatus(DllExports::GdipGetCompositingQuality(
1056 nativeGraphics, &result));
1059 REAL GetDpiX() const
1062 updateStatus(DllExports::GdipGetDpiX(nativeGraphics, &result));
1065 REAL GetDpiY() const
1068 updateStatus(DllExports::GdipGetDpiY(nativeGraphics, &result));
1074 updateStatus(DllExports::GdipGetDC(nativeGraphics, &result));
1077 InterpolationMode GetInterpolationMode() const
1079 InterpolationMode result = InterpolationModeDefault;
1080 updateStatus(DllExports::GdipGetInterpolationMode(
1081 nativeGraphics, &result));
1084 Status GetLastStatus() const
1086 Status result = lastStatus;
1090 Status GetNearestColor(Color *color) const
1092 return updateStatus(DllExports::GdipGetNearestColor(
1093 nativeGraphics, color ? &color->Value : NULL));
1095 REAL GetPageScale() const
1098 updateStatus(DllExports::GdipGetPageScale(
1099 nativeGraphics, &result));
1102 Unit GetPageUnit() const
1104 Unit result = UnitWorld;
1105 updateStatus(DllExports::GdipGetPageUnit(
1106 nativeGraphics, &result));
1109 PixelOffsetMode GetPixelOffsetMode() const
1111 PixelOffsetMode result = PixelOffsetModeDefault;
1112 updateStatus(DllExports::GdipGetPixelOffsetMode(
1113 nativeGraphics, &result));
1116 Status GetRenderingOrigin(INT *x, INT *y) const
1118 return updateStatus(DllExports::GdipGetRenderingOrigin(
1119 nativeGraphics, x, y));
1121 SmoothingMode GetSmoothingMode() const
1123 SmoothingMode result = SmoothingModeDefault;
1124 updateStatus(DllExports::GdipGetSmoothingMode(
1125 nativeGraphics, &result));
1128 UINT GetTextContrast() const
1131 updateStatus(DllExports::GdipGetTextContrast(
1132 nativeGraphics, &result));
1135 TextRenderingHint GetTextRenderingHint() const
1137 TextRenderingHint result = TextRenderingHintSystemDefault;
1138 updateStatus(DllExports::GdipGetTextRenderingHint(
1139 nativeGraphics, &result));
1142 Status GetTransform(Matrix *matrix) const
1144 return updateStatus(DllExports::GdipGetWorldTransform(
1146 matrix ? matrix->nativeMatrix : NULL));
1148 Status GetVisibleClipBounds(RectF *rect) const
1150 return updateStatus(DllExports::GdipGetVisibleClipBounds(
1151 nativeGraphics, rect));
1153 Status GetVisibleClipBounds(Rect *rect) const
1155 return updateStatus(DllExports::GdipGetVisibleClipBoundsI(
1156 nativeGraphics, rect));
1158 Status IntersectClip(const RectF& rect)
1160 return updateStatus(DllExports::GdipSetClipRect(
1162 rect.X, rect.Y, rect.Width, rect.Height,
1163 CombineModeIntersect));
1165 Status IntersectClip(const Rect& rect)
1167 return updateStatus(DllExports::GdipSetClipRectI(
1169 rect.X, rect.Y, rect.Width, rect.Height,
1170 CombineModeIntersect));
1172 Status IntersectClip(const Region *region)
1174 return updateStatus(DllExports::GdipSetClipRegion(
1176 region ? region->nativeRegion : NULL,
1177 CombineModeIntersect));
1179 BOOL IsClipEmpty() const
1181 BOOL result = FALSE;
1182 updateStatus(DllExports::GdipIsClipEmpty(
1183 nativeGraphics, &result));
1186 BOOL IsVisible(REAL x, REAL y) const
1188 BOOL result = FALSE;
1189 updateStatus(DllExports::GdipIsVisiblePoint(
1190 nativeGraphics, x, y, &result));
1193 BOOL IsVisible(INT x, INT y) const
1195 BOOL result = FALSE;
1196 updateStatus(DllExports::GdipIsVisiblePointI(
1197 nativeGraphics, x, y, &result));
1200 BOOL IsVisible(const PointF& point) const
1202 BOOL result = FALSE;
1203 updateStatus(DllExports::GdipIsVisiblePoint(
1204 nativeGraphics, point.X, point.Y, &result));
1207 BOOL IsVisible(const Point& point) const
1209 BOOL result = FALSE;
1210 updateStatus(DllExports::GdipIsVisiblePointI(
1211 nativeGraphics, point.X, point.Y, &result));
1214 BOOL IsVisible(REAL x, REAL y, REAL width, REAL height) const
1216 BOOL result = FALSE;
1217 updateStatus(DllExports::GdipIsVisibleRect(
1218 nativeGraphics, x, y, width, height, &result));
1221 BOOL IsVisible(INT x, INT y, INT width, INT height) const
1223 BOOL result = FALSE;
1224 updateStatus(DllExports::GdipIsVisibleRectI(
1225 nativeGraphics, x, y, width, height, &result));
1228 BOOL IsVisible(const RectF& rect) const
1230 BOOL result = FALSE;
1231 updateStatus(DllExports::GdipIsVisibleRect(
1232 nativeGraphics, rect.X, rect.Y,
1233 rect.Width, rect.Height, &result));
1236 BOOL IsVisible(const Rect& rect) const
1238 BOOL result = FALSE;
1239 updateStatus(DllExports::GdipIsVisibleRectI(
1240 nativeGraphics, rect.X, rect.Y,
1241 rect.Width, rect.Height, &result));
1244 BOOL IsVisibleClipEmpty() const
1246 BOOL result = FALSE;
1247 updateStatus(DllExports::GdipIsVisibleClipEmpty(
1248 nativeGraphics, &result));
1251 Status MeasureCharacterRanges(const WCHAR *string, INT length,
1252 const Font *font, const RectF& layoutRect,
1253 const StringFormat *stringFormat,
1254 INT regionCount, Region *regions) const
1256 if (regionCount <= 0 || !regions)
1257 return lastStatus = InvalidParameter;
1259 GpRegion **nativeRegionArray = (GpRegion**)
1260 DllExports::GdipAlloc(regionCount * sizeof(GpRegion*));
1261 if (!nativeRegionArray)
1262 return lastStatus = OutOfMemory;
1263 for (int i = 0; i < regionCount; ++i) {
1264 nativeRegionArray[i] = regions[i].nativeRegion;
1266 Status status = updateStatus(DllExports::GdipMeasureCharacterRanges(
1267 nativeGraphics, string, length,
1268 font ? font->nativeFont : NULL,
1270 stringFormat ? stringFormat->nativeStringFormat : NULL,
1271 regionCount, nativeRegionArray));
1272 DllExports::GdipFree(nativeRegionArray);
1275 Status MeasureDriverString(const UINT16 *text, INT length,
1276 const Font *font, const PointF *positions, INT flags,
1277 const Matrix *matrix, RectF *boundingBox) const
1279 return updateStatus(DllExports::GdipMeasureDriverString(
1280 nativeGraphics, text, length,
1281 font ? font->nativeFont : NULL,
1283 matrix ? matrix->nativeMatrix : NULL,
1286 Status MeasureString(const WCHAR *string, INT length,
1287 const Font *font, const RectF& layoutRect,
1288 RectF *boundingBox) const
1290 return updateStatus(DllExports::GdipMeasureString(
1291 nativeGraphics, string, length,
1292 font ? font->nativeFont : NULL,
1293 &layoutRect, NULL, boundingBox, NULL, NULL));
1295 Status MeasureString(const WCHAR *string, INT length,
1296 const Font *font, const RectF& layoutRect,
1297 const StringFormat *stringFormat, RectF *boundingBox,
1298 INT *codepointsFitted = NULL,
1299 INT *linesFitted = NULL) const
1301 return updateStatus(DllExports::GdipMeasureString(
1302 nativeGraphics, string, length,
1303 font ? font->nativeFont : NULL,
1305 stringFormat ? stringFormat->nativeStringFormat : NULL,
1306 boundingBox, codepointsFitted, linesFitted));
1308 Status MeasureString(const WCHAR *string, INT length,
1309 const Font *font, const SizeF& layoutRectSize,
1310 const StringFormat *stringFormat, SizeF *size,
1311 INT *codepointsFitted = NULL,
1312 INT *linesFitted = NULL) const
1314 if (!size) return lastStatus = InvalidParameter;
1315 RectF layoutRect(PointF(0.0f, 0.0f), layoutRectSize);
1317 Status status = updateStatus(DllExports::GdipMeasureString(
1318 nativeGraphics, string, length,
1319 font ? font->nativeFont : NULL,
1321 stringFormat ? stringFormat->nativeStringFormat : NULL,
1322 &boundingBox, codepointsFitted, linesFitted));
1323 boundingBox.GetSize(size);
1326 Status MeasureString(const WCHAR *string, INT length,
1327 const Font *font, const PointF& origin,
1328 RectF *boundingBox) const
1330 RectF layoutRect(origin, SizeF(0.0f, 0.0f));
1331 return updateStatus(DllExports::GdipMeasureString(
1332 nativeGraphics, string, length,
1333 font ? font->nativeFont : NULL,
1334 &layoutRect, NULL, boundingBox, NULL, NULL));
1336 Status MeasureString(const WCHAR *string, INT length,
1337 const Font *font, const PointF& origin,
1338 const StringFormat *stringFormat,
1339 RectF *boundingBox) const
1341 RectF layoutRect(origin, SizeF(0.0f, 0.0f));
1342 return updateStatus(DllExports::GdipMeasureString(
1343 nativeGraphics, string, length,
1344 font ? font->nativeFont : NULL,
1346 stringFormat ? stringFormat->nativeStringFormat : NULL,
1347 boundingBox, NULL, NULL));
1349 Status MultiplyTransform(const Matrix *matrix,
1350 MatrixOrder order = MatrixOrderPrepend)
1352 return updateStatus(DllExports::GdipMultiplyWorldTransform(
1354 matrix ? matrix->nativeMatrix : NULL, order));
1356 VOID ReleaseHDC(HDC hdc)
1358 updateStatus(DllExports::GdipReleaseDC(nativeGraphics, hdc));
1362 return updateStatus(DllExports::GdipResetClip(nativeGraphics));
1364 Status ResetTransform()
1366 return updateStatus(DllExports::GdipResetWorldTransform(
1369 Status Restore(GraphicsState state)
1371 return updateStatus(DllExports::GdipRestoreGraphics(
1372 nativeGraphics, state));
1374 Status RotateTransform(REAL angle,
1375 MatrixOrder order = MatrixOrderPrepend)
1377 return updateStatus(DllExports::GdipRotateWorldTransform(
1378 nativeGraphics, angle, order));
1380 GraphicsState Save() const
1382 GraphicsState result = 0;
1383 updateStatus(DllExports::GdipSaveGraphics(
1384 nativeGraphics, &result));
1387 Status ScaleTransform(REAL sx, REAL sy,
1388 MatrixOrder order = MatrixOrderPrepend)
1390 return updateStatus(DllExports::GdipScaleWorldTransform(
1391 nativeGraphics, sx, sy, order));
1395 updateStatus(NotImplemented);
1397 Status SetClip(const Graphics *g,
1398 CombineMode combineMode = CombineModeReplace)
1400 return updateStatus(DllExports::GdipSetClipGraphics(
1401 nativeGraphics, g ? g->nativeGraphics : NULL,
1404 Status SetClip(const RectF& rect,
1405 CombineMode combineMode = CombineModeReplace)
1407 return updateStatus(DllExports::GdipSetClipRect(
1409 rect.X, rect.Y, rect.Width, rect.Height,
1412 Status SetClip(const Rect& rect,
1413 CombineMode combineMode = CombineModeReplace)
1415 return updateStatus(DllExports::GdipSetClipRectI(
1417 rect.X, rect.Y, rect.Width, rect.Height,
1420 Status SetClip(const GraphicsPath *path,
1421 CombineMode combineMode = CombineModeReplace)
1423 return updateStatus(DllExports::GdipSetClipPath(
1425 path ? path->nativePath : NULL,
1428 Status SetClip(const Region *region,
1429 CombineMode combineMode = CombineModeReplace)
1431 return updateStatus(DllExports::GdipSetClipRegion(
1433 region ? region->nativeRegion : NULL,
1436 Status SetClip(HRGN hRgn, CombineMode combineMode = CombineModeReplace)
1438 return updateStatus(DllExports::GdipSetClipHrgn(
1439 nativeGraphics, hRgn, combineMode));
1441 Status SetCompositingMode(CompositingMode compositingMode)
1443 return updateStatus(DllExports::GdipSetCompositingMode(
1444 nativeGraphics, compositingMode));
1446 Status SetCompositingQuality(CompositingQuality compositingQuality)
1448 return updateStatus(DllExports::GdipSetCompositingQuality(
1449 nativeGraphics, compositingQuality));
1451 Status SetInterpolationMode(InterpolationMode interpolationMode)
1453 return updateStatus(DllExports::GdipSetInterpolationMode(
1454 nativeGraphics, interpolationMode));
1456 Status SetPageScale(REAL scale)
1458 return updateStatus(DllExports::GdipSetPageScale(
1459 nativeGraphics, scale));
1461 Status SetPageUnit(Unit unit)
1463 return updateStatus(DllExports::GdipSetPageUnit(
1464 nativeGraphics, unit));
1466 Status SetPixelOffsetMode(PixelOffsetMode pixelOffsetMode)
1468 return updateStatus(DllExports::GdipSetPixelOffsetMode(
1469 nativeGraphics, pixelOffsetMode));
1471 Status SetRenderingOrigin(INT x, INT y)
1473 return updateStatus(DllExports::GdipSetRenderingOrigin(
1474 nativeGraphics, x, y));
1476 Status SetSmoothingMode(SmoothingMode smoothingMode)
1478 return updateStatus(DllExports::GdipSetSmoothingMode(
1479 nativeGraphics, smoothingMode));
1481 Status SetTextContrast(UINT contrast)
1483 return updateStatus(DllExports::GdipSetTextContrast(
1484 nativeGraphics, contrast));
1486 Status SetTextRenderingHint(TextRenderingHint textRenderingHint)
1488 return updateStatus(DllExports::GdipSetTextRenderingHint(
1489 nativeGraphics, textRenderingHint));
1491 Status SetTransform(const Matrix *matrix)
1493 return updateStatus(DllExports::GdipSetWorldTransform(
1495 matrix ? matrix->nativeMatrix : NULL));
1497 Status TransformPoints(CoordinateSpace destSpace,
1498 CoordinateSpace srcSpace,
1499 PointF *pts, INT count) const
1501 return updateStatus(DllExports::GdipTransformPoints(
1502 nativeGraphics, destSpace, srcSpace,
1505 Status TransformPoints(CoordinateSpace destSpace,
1506 CoordinateSpace srcSpace,
1507 Point *pts, INT count) const
1509 return updateStatus(DllExports::GdipTransformPointsI(
1510 nativeGraphics, destSpace, srcSpace,
1513 Status TranslateClip(REAL dx, REAL dy)
1515 return updateStatus(DllExports::GdipTranslateClip(
1516 nativeGraphics, dx, dy));
1518 Status TranslateClip(INT dx, INT dy)
1520 return updateStatus(DllExports::GdipTranslateClipI(
1521 nativeGraphics, dx, dy));
1523 Status TranslateTransform(REAL dx, REAL dy,
1524 MatrixOrder order = MatrixOrderPrepend)
1526 return updateStatus(DllExports::GdipTranslateWorldTransform(
1527 nativeGraphics, dx, dy, order));
1531 Graphics(const Graphics&);
1532 Graphics& operator=(const Graphics&);
1534 Status updateStatus(Status newStatus) const
1536 if (newStatus != Ok) lastStatus = newStatus;
1540 GpGraphics *nativeGraphics;
1541 mutable Status lastStatus;
1544 #endif /* __GDIPLUS_GRAPHICS_H */