6 * This file is part of the w32api package.
8 * THIS SOFTWARE IS NOT COPYRIGHTED
10 * This source code is offered for use in the public domain. You may
11 * use, modify or distribute it freely.
13 * This code is distributed in the hope that it will be useful but
14 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
15 * DISCLAIMED. This includes but is not limited to warranties of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 #ifndef _GDIPLUSGRAPHICS_H
20 #define _GDIPLUSGRAPHICS_H
23 class ImageAttributes
;
30 class Graphics
: public GdiplusBase
35 friend class CachedBitmap
;
38 Graphics(Image
*image
)
44 GpGraphics
*graphics
= NULL
;
45 status
= DllExports::GdipCreateFromHDC(hdc
, &graphics
);
46 SetGraphics(graphics
);
49 Graphics(HDC hdc
, HANDLE hdevice
)
53 Graphics(HWND hwnd
, BOOL icm
)
58 AddMetafileComment(const BYTE
*data
, UINT sizeData
)
60 return SetStatus(DllExports::GdipComment(nativeGraphics
, sizeData
, data
));
63 GraphicsContainer
BeginContainer(VOID
)
65 return GraphicsContainer();
69 BeginContainer(const RectF
&dstrect
, const RectF
&srcrect
, Unit unit
)
71 return GraphicsContainer();
75 BeginContainer(const Rect
&dstrect
, const Rect
&srcrect
, Unit unit
)
77 return GraphicsContainer();
81 Clear(const Color
&color
)
83 return SetStatus(DllExports::GdipGraphicsClear(nativeGraphics
, color
.GetValue()));
87 DrawArc(const Pen
*pen
, const Rect
&rect
, REAL startAngle
, REAL sweepAngle
)
89 return SetStatus(DllExports::GdipDrawArcI(
90 nativeGraphics
, pen
? pen
->nativePen
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
, startAngle
,
95 DrawArc(const Pen
*pen
, const RectF
&rect
, REAL startAngle
, REAL sweepAngle
)
97 return SetStatus(DllExports::GdipDrawArcI(
98 nativeGraphics
, pen
? pen
->nativePen
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
, startAngle
,
103 DrawArc(const Pen
*pen
, REAL x
, REAL y
, REAL width
, REAL height
, REAL startAngle
, REAL sweepAngle
)
105 return SetStatus(DllExports::GdipDrawArc(
106 nativeGraphics
, pen
? pen
->nativePen
: NULL
, x
, y
, width
, height
, startAngle
, sweepAngle
));
110 DrawArc(const Pen
*pen
, INT x
, INT y
, INT width
, INT height
, REAL startAngle
, REAL sweepAngle
)
112 return SetStatus(DllExports::GdipDrawArcI(
113 nativeGraphics
, pen
? pen
->nativePen
: NULL
, x
, y
, width
, height
, startAngle
, sweepAngle
));
117 DrawBezier(const Pen
*pen
, const Point
&pt1
, const Point
&pt2
, const Point
&pt3
, const Point
&pt4
)
119 return SetStatus(DllExports::GdipDrawBezierI(
120 nativeGraphics
, pen
? pen
->nativePen
: NULL
, pt1
.X
, pt1
.Y
, pt2
.X
, pt2
.Y
, pt3
.X
, pt3
.Y
, pt4
.X
, pt4
.Y
));
124 DrawBezier(const Pen
*pen
, const PointF
&pt1
, const PointF
&pt2
, const PointF
&pt3
, const PointF
&pt4
)
126 return SetStatus(DllExports::GdipDrawBezier(
127 nativeGraphics
, pen
? pen
->nativePen
: NULL
, pt1
.X
, pt1
.Y
, pt2
.X
, pt2
.Y
, pt3
.X
, pt3
.Y
, pt4
.X
, pt4
.Y
));
131 DrawBezier(const Pen
*pen
, REAL x1
, REAL y1
, REAL x2
, REAL y2
, REAL x3
, REAL y3
, REAL x4
, REAL y4
)
134 DllExports::GdipDrawBezier(nativeGraphics
, pen
? pen
->nativePen
: NULL
, x1
, y1
, x2
, y2
, x3
, y3
, x4
, y4
));
138 DrawBezier(const Pen
*pen
, INT x1
, INT y1
, INT x2
, INT y2
, INT x3
, INT y3
, INT x4
, INT y4
)
141 DllExports::GdipDrawBezierI(nativeGraphics
, pen
? pen
->nativePen
: NULL
, x1
, y1
, x2
, y2
, x3
, y3
, x4
, y4
));
145 DrawBeziers(const Pen
*pen
, const Point
*points
, INT count
)
147 return SetStatus(DllExports::GdipDrawBeziersI(nativeGraphics
, pen
? pen
->nativePen
: NULL
, points
, count
));
151 DrawBeziers(const Pen
*pen
, const PointF
*points
, INT count
)
153 return SetStatus(DllExports::GdipDrawBeziers(nativeGraphics
, pen
? pen
->nativePen
: NULL
, points
, count
));
157 DrawCachedBitmap(CachedBitmap
*cb
, INT x
, INT y
)
159 return NotImplemented
;
163 DrawClosedCurve(const Pen
*pen
, const Point
*points
, INT count
)
165 return SetStatus(DllExports::GdipDrawClosedCurveI(nativeGraphics
, pen
? pen
->nativePen
: NULL
, points
, count
));
169 DrawClosedCurve(const Pen
*pen
, const PointF
*points
, INT count
)
171 return SetStatus(DllExports::GdipDrawClosedCurve(nativeGraphics
, pen
? pen
->nativePen
: NULL
, points
, count
));
175 DrawClosedCurve(const Pen
*pen
, const PointF
*points
, INT count
, REAL tension
)
178 DllExports::GdipDrawClosedCurve2(nativeGraphics
, pen
? pen
->nativePen
: NULL
, points
, count
, tension
));
182 DrawClosedCurve(const Pen
*pen
, const Point
*points
, INT count
, REAL tension
)
185 DllExports::GdipDrawClosedCurve2I(nativeGraphics
, pen
? pen
->nativePen
: NULL
, points
, count
, tension
));
189 DrawCurve(const Pen
*pen
, const Point
*points
, INT count
)
191 return SetStatus(DllExports::GdipDrawCurveI(nativeGraphics
, pen
? pen
->nativePen
: NULL
, points
, count
));
195 DrawCurve(const Pen
*pen
, const PointF
*points
, INT count
)
197 return SetStatus(DllExports::GdipDrawCurve(nativeGraphics
, pen
? pen
->nativePen
: NULL
, points
, count
));
201 DrawCurve(const Pen
*pen
, const PointF
*points
, INT count
, REAL tension
)
204 DllExports::GdipDrawCurve2(nativeGraphics
, pen
? pen
->nativePen
: NULL
, points
, count
, tension
));
208 DrawCurve(const Pen
*pen
, const Point
*points
, INT count
, INT offset
, INT numberOfSegments
, REAL tension
)
210 return SetStatus(DllExports::GdipDrawCurve3I(
211 nativeGraphics
, pen
? pen
->nativePen
: NULL
, points
, count
, offset
, numberOfSegments
, tension
));
215 DrawCurve(const Pen
*pen
, const PointF
*points
, INT count
, INT offset
, INT numberOfSegments
, REAL tension
)
217 return SetStatus(DllExports::GdipDrawCurve3(
218 nativeGraphics
, pen
? pen
->nativePen
: NULL
, points
, count
, offset
, numberOfSegments
, tension
));
222 DrawCurve(const Pen
*pen
, const Point
*points
, INT count
, REAL tension
)
225 DllExports::GdipDrawCurve2I(nativeGraphics
, pen
? pen
->nativePen
: NULL
, points
, count
, tension
));
234 const PointF
*positions
,
236 const Matrix
*matrix
)
238 return NotImplemented
;
242 DrawEllipse(const Pen
*pen
, const Rect
&rect
)
244 return SetStatus(DllExports::GdipDrawEllipseI(
245 nativeGraphics
, pen
? pen
->nativePen
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
));
249 DrawEllipse(const Pen
*pen
, REAL x
, REAL y
, REAL width
, REAL height
)
251 return SetStatus(DllExports::GdipDrawEllipse(nativeGraphics
, pen
? pen
->nativePen
: NULL
, x
, y
, width
, height
));
255 DrawEllipse(const Pen
*pen
, const RectF
&rect
)
257 return SetStatus(DllExports::GdipDrawEllipse(
258 nativeGraphics
, pen
? pen
->nativePen
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
));
262 DrawEllipse(const Pen
*pen
, INT x
, INT y
, INT width
, INT height
)
265 DllExports::GdipDrawEllipseI(nativeGraphics
, pen
? pen
->nativePen
: NULL
, x
, y
, width
, height
));
269 DrawImage(Image
*image
, const Point
*destPoints
, INT count
)
271 return NotImplemented
;
275 DrawImage(Image
*image
, INT x
, INT y
)
277 return NotImplemented
;
281 DrawImage(Image
*image
, const Point
&point
)
283 return NotImplemented
;
287 DrawImage(Image
*image
, REAL x
, REAL y
)
289 return NotImplemented
;
293 DrawImage(Image
*image
, const PointF
&point
)
295 return NotImplemented
;
299 DrawImage(Image
*image
, const PointF
*destPoints
, INT count
)
301 return NotImplemented
;
305 DrawImage(Image
*image
, REAL x
, REAL y
, REAL srcx
, REAL srcy
, REAL srcwidth
, REAL srcheight
, Unit srcUnit
)
307 return NotImplemented
;
311 DrawImage(Image
*image
, const RectF
&rect
)
313 return NotImplemented
;
317 DrawImage(Image
*image
, INT x
, INT y
, INT width
, INT height
)
319 return NotImplemented
;
325 const PointF
*destPoints
,
332 ImageAttributes
*imageAttributes
,
333 DrawImageAbort callback
,
336 return NotImplemented
;
342 const Rect
&destRect
,
348 ImageAttributes
*imageAttributes
,
349 DrawImageAbort callback
,
352 return NotImplemented
;
358 const Point
*destPoints
,
365 ImageAttributes
*imageAttributes
,
366 DrawImageAbort callback
,
369 return NotImplemented
;
373 DrawImage(Image
*image
, REAL x
, REAL y
, REAL width
, REAL height
)
375 return NotImplemented
;
379 DrawImage(Image
*image
, const Rect
&rect
)
381 return NotImplemented
;
385 DrawImage(Image
*image
, INT x
, INT y
, INT srcx
, INT srcy
, INT srcwidth
, INT srcheight
, Unit srcUnit
)
387 return NotImplemented
;
393 const RectF
&destRect
,
399 ImageAttributes
*imageAttributes
,
400 DrawImageAbort callback
,
403 return NotImplemented
;
407 DrawLine(const Pen
*pen
, const Point
&pt1
, const Point
&pt2
)
410 DllExports::GdipDrawLineI(nativeGraphics
, pen
? pen
->nativePen
: NULL
, pt1
.X
, pt1
.Y
, pt2
.X
, pt2
.Y
));
414 DrawLine(const Pen
*pen
, const PointF
&pt1
, const Point
&pt2
)
417 DllExports::GdipDrawLine(nativeGraphics
, pen
? pen
->nativePen
: NULL
, pt1
.X
, pt1
.Y
, pt2
.X
, pt2
.Y
));
421 DrawLine(const Pen
*pen
, REAL x1
, REAL y1
, REAL x2
, REAL y2
)
423 return SetStatus(DllExports::GdipDrawLine(nativeGraphics
, pen
? pen
->nativePen
: NULL
, x1
, y1
, x2
, y2
));
427 DrawLine(const Pen
*pen
, INT x1
, INT y1
, INT x2
, INT y2
)
429 return SetStatus(DllExports::GdipDrawLine(nativeGraphics
, pen
? pen
->nativePen
: NULL
, x1
, y1
, x2
, y2
));
433 DrawLines(const Pen
*pen
, const Point
*points
, INT count
)
435 return SetStatus(DllExports::GdipDrawLinesI(nativeGraphics
, pen
? pen
->nativePen
: NULL
, points
, count
));
439 DrawLines(const Pen
*pen
, const PointF
*points
, INT count
)
441 return SetStatus(DllExports::GdipDrawLines(nativeGraphics
, pen
? pen
->nativePen
: NULL
, points
, count
));
445 DrawPath(const Pen
*pen
, const GraphicsPath
*path
)
447 return NotImplemented
;
451 DrawPie(const Pen
*pen
, const Rect
&rect
, REAL startAngle
, REAL sweepAngle
)
453 return SetStatus(DllExports::GdipDrawPieI(
454 nativeGraphics
, pen
? pen
->nativePen
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
, startAngle
,
459 DrawPie(const Pen
*pen
, INT x
, INT y
, INT width
, INT height
, REAL startAngle
, REAL sweepAngle
)
461 return SetStatus(DllExports::GdipDrawPieI(
462 nativeGraphics
, pen
? pen
->nativePen
: NULL
, x
, y
, width
, height
, startAngle
, sweepAngle
));
466 DrawPie(const Pen
*pen
, REAL x
, REAL y
, REAL width
, REAL height
, REAL startAngle
, REAL sweepAngle
)
468 return SetStatus(DllExports::GdipDrawPie(
469 nativeGraphics
, pen
? pen
->nativePen
: NULL
, x
, y
, width
, height
, startAngle
, sweepAngle
));
473 DrawPie(const Pen
*pen
, const RectF
&rect
, REAL startAngle
, REAL sweepAngle
)
475 return SetStatus(DllExports::GdipDrawPie(
476 nativeGraphics
, pen
? pen
->nativePen
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
, startAngle
,
481 DrawPolygon(const Pen
*pen
, const Point
*points
, INT count
)
483 return SetStatus(DllExports::GdipDrawPolygonI(nativeGraphics
, pen
? pen
->nativePen
: NULL
, points
, count
));
487 DrawPolygon(const Pen
*pen
, const PointF
*points
, INT count
)
489 return SetStatus(DllExports::GdipDrawPolygon(nativeGraphics
, pen
? pen
->nativePen
: NULL
, points
, count
));
493 DrawRectangle(const Pen
*pen
, const Rect
&rect
)
495 return SetStatus(DllExports::GdipDrawRectangleI(
496 nativeGraphics
, pen
? pen
->nativePen
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
));
500 DrawRectangle(const Pen
*pen
, INT x
, INT y
, INT width
, INT height
)
503 DllExports::GdipDrawRectangleI(nativeGraphics
, pen
? pen
->nativePen
: NULL
, x
, y
, width
, height
));
507 DrawRectangle(const Pen
*pen
, REAL x
, REAL y
, REAL width
, REAL height
)
510 DllExports::GdipDrawRectangle(nativeGraphics
, pen
? pen
->nativePen
: NULL
, x
, y
, width
, height
));
514 DrawRectangle(const Pen
*pen
, const RectF
&rect
)
516 return SetStatus(DllExports::GdipDrawRectangleI(
517 nativeGraphics
, pen
? pen
->nativePen
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
));
521 DrawRectangles(const Pen
*pen
, const Rect
*rects
, INT count
)
523 return SetStatus(DllExports::GdipDrawRectanglesI(nativeGraphics
, pen
? pen
->nativePen
: NULL
, rects
, count
));
527 DrawRectangles(const Pen
*pen
, const RectF
*rects
, INT count
)
529 return SetStatus(DllExports::GdipDrawRectangles(nativeGraphics
, pen
? pen
->nativePen
: NULL
, rects
, count
));
537 const RectF
&layoutRect
,
538 const StringFormat
*stringFormat
,
541 return NotImplemented
;
545 DrawString(const WCHAR
*string
, INT length
, const Font
*font
, const PointF
&origin
, const Brush
*brush
)
547 return NotImplemented
;
555 const PointF
&origin
,
556 const StringFormat
*stringFormat
,
559 return NotImplemented
;
563 EndContainer(GraphicsContainer state
)
565 return SetStatus(DllExports::GdipEndContainer(nativeGraphics
, state
));
570 const Metafile
*metafile
,
571 const Metafile
&destPoint
,
572 EnumerateMetafileProc callback
,
574 ImageAttributes
*imageAttributes
)
576 return NotImplemented
;
581 const Metafile
*metafile
,
582 const Point
*destPoints
,
584 EnumerateMetafileProc callback
,
586 ImageAttributes
*imageAttributes
)
588 return NotImplemented
;
593 const Metafile
*metafile
,
594 const Point
&destPoint
,
597 EnumerateMetafileProc callback
,
599 ImageAttributes
*imageAttributes
)
601 return NotImplemented
;
606 const Metafile
*metafile
,
607 const PointF
*destPoints
,
609 EnumerateMetafileProc callback
,
611 ImageAttributes
*imageAttributes
)
613 return NotImplemented
;
618 const Metafile
*metafile
,
619 const Rect
&destRect
,
620 EnumerateMetafileProc callback
,
622 ImageAttributes
*imageAttributes
)
624 return NotImplemented
;
629 const Metafile
*metafile
,
630 const RectF
&destRect
,
631 const RectF
&srcRect
,
633 EnumerateMetafileProc callback
,
635 ImageAttributes
*imageAttributes
)
637 return NotImplemented
;
642 const Metafile
*metafile
,
643 const RectF
&destRect
,
644 EnumerateMetafileProc callback
,
646 ImageAttributes
*imageAttributes
)
648 return NotImplemented
;
653 const Metafile
*metafile
,
654 const PointF
&destPoint
,
657 EnumerateMetafileProc callback
,
659 ImageAttributes
*imageAttributes
)
661 return NotImplemented
;
666 const Metafile
*metafile
,
667 const Point
*destPoints
,
671 EnumerateMetafileProc callback
,
673 ImageAttributes
*imageAttributes
)
675 return NotImplemented
;
680 const Metafile
*metafile
,
681 const Rect
&destRect
,
684 EnumerateMetafileProc callback
,
686 ImageAttributes
*imageAttributes
)
688 return NotImplemented
;
693 const Metafile
*metafile
,
694 const Point
*destPoints
,
696 const RectF
&srcRect
,
698 EnumerateMetafileProc callback
,
700 ImageAttributes
*imageAttributes
)
702 return NotImplemented
;
707 const Metafile
*metafile
,
708 const PointF
&destPoint
,
709 EnumerateMetafileProc callback
,
711 ImageAttributes
*imageAttributes
)
713 return NotImplemented
;
717 ExcludeClip(const Rect
&rect
)
719 return NotImplemented
;
723 ExcludeClip(const RectF
&rect
)
725 return NotImplemented
;
729 ExcludeClip(const Region
*region
)
731 return NotImplemented
;
735 FillClosedCurve(const Brush
*brush
, const Point
*points
, INT count
)
738 DllExports::GdipFillClosedCurveI(nativeGraphics
, brush
? brush
->nativeBrush
: NULL
, points
, count
));
742 FillClosedCurve(const Brush
*brush
, const Point
*points
, INT count
, FillMode fillMode
, REAL tension
)
744 return SetStatus(DllExports::GdipFillClosedCurve2I(
745 nativeGraphics
, brush
? brush
->nativeBrush
: NULL
, points
, count
, tension
, fillMode
));
749 FillClosedCurve(const Brush
*brush
, const PointF
*points
, INT count
)
752 DllExports::GdipFillClosedCurve(nativeGraphics
, brush
? brush
->nativeBrush
: NULL
, points
, count
));
756 FillClosedCurve(const Brush
*brush
, const PointF
*points
, INT count
, FillMode fillMode
, REAL tension
)
758 return SetStatus(DllExports::GdipFillClosedCurve2(
759 nativeGraphics
, brush
? brush
->nativeBrush
: NULL
, points
, count
, tension
, fillMode
));
763 FillEllipse(const Brush
*brush
, const Rect
&rect
)
765 return SetStatus(DllExports::GdipFillEllipseI(
766 nativeGraphics
, brush
? brush
->nativeBrush
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
));
770 FillEllipse(const Brush
*brush
, REAL x
, REAL y
, REAL width
, REAL height
)
773 DllExports::GdipFillEllipse(nativeGraphics
, brush
? brush
->nativeBrush
: NULL
, x
, y
, width
, height
));
777 FillEllipse(const Brush
*brush
, const RectF
&rect
)
779 return SetStatus(DllExports::GdipFillEllipse(
780 nativeGraphics
, brush
? brush
->nativeBrush
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
));
784 FillEllipse(const Brush
*brush
, INT x
, INT y
, INT width
, INT height
)
787 DllExports::GdipFillEllipseI(nativeGraphics
, brush
? brush
->nativeBrush
: NULL
, x
, y
, width
, height
));
791 FillPath(const Brush
*brush
, const GraphicsPath
*path
)
793 return NotImplemented
;
797 FillPie(const Brush
*brush
, const Rect
&rect
, REAL startAngle
, REAL sweepAngle
)
799 return SetStatus(DllExports::GdipFillPieI(
800 nativeGraphics
, brush
? brush
->nativeBrush
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
, startAngle
,
805 FillPie(const Brush
*brush
, INT x
, INT y
, INT width
, INT height
, REAL startAngle
, REAL sweepAngle
)
807 return SetStatus(DllExports::GdipFillPieI(
808 nativeGraphics
, brush
? brush
->nativeBrush
: NULL
, x
, y
, width
, height
, startAngle
, sweepAngle
));
812 FillPie(const Brush
*brush
, REAL x
, REAL y
, REAL width
, REAL height
, REAL startAngle
, REAL sweepAngle
)
814 return SetStatus(DllExports::GdipFillPie(
815 nativeGraphics
, brush
? brush
->nativeBrush
: NULL
, x
, y
, width
, height
, startAngle
, sweepAngle
));
819 FillPie(const Brush
*brush
, RectF
&rect
, REAL startAngle
, REAL sweepAngle
)
821 return SetStatus(DllExports::GdipFillPie(
822 nativeGraphics
, brush
? brush
->nativeBrush
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
, startAngle
,
827 FillPolygon(const Brush
*brush
, const Point
*points
, INT count
)
830 DllExports::GdipFillPolygon2I(nativeGraphics
, brush
? brush
->nativeBrush
: NULL
, points
, count
));
834 FillPolygon(const Brush
*brush
, const PointF
*points
, INT count
)
837 DllExports::GdipFillPolygon2(nativeGraphics
, brush
? brush
->nativeBrush
: NULL
, points
, count
));
841 FillPolygon(const Brush
*brush
, const Point
*points
, INT count
, FillMode fillMode
)
844 DllExports::GdipFillPolygonI(nativeGraphics
, brush
? brush
->nativeBrush
: NULL
, points
, count
, fillMode
));
848 FillPolygon(const Brush
*brush
, const PointF
*points
, INT count
, FillMode fillMode
)
851 DllExports::GdipFillPolygon(nativeGraphics
, brush
? brush
->nativeBrush
: NULL
, points
, count
, fillMode
));
855 FillRectangle(const Brush
*brush
, const Rect
&rect
)
857 return SetStatus(DllExports::GdipFillRectangleI(
858 nativeGraphics
, brush
? brush
->nativeBrush
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
));
862 FillRectangle(const Brush
*brush
, const RectF
&rect
)
864 return SetStatus(DllExports::GdipFillRectangle(
865 nativeGraphics
, brush
? brush
->nativeBrush
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
));
869 FillRectangle(const Brush
*brush
, REAL x
, REAL y
, REAL width
, REAL height
)
872 DllExports::GdipFillRectangle(nativeGraphics
, brush
? brush
->nativeBrush
: NULL
, x
, y
, width
, height
));
876 FillRectangle(const Brush
*brush
, INT x
, INT y
, INT width
, INT height
)
879 DllExports::GdipFillRectangleI(nativeGraphics
, brush
? brush
->nativeBrush
: NULL
, x
, y
, width
, height
));
883 FillRectangles(const Brush
*brush
, const Rect
*rects
, INT count
)
886 DllExports::GdipFillRectanglesI(nativeGraphics
, brush
? brush
->nativeBrush
: NULL
, rects
, count
));
890 FillRectangles(const Brush
*brush
, const RectF
*rects
, INT count
)
893 DllExports::GdipFillRectangles(nativeGraphics
, brush
? brush
->nativeBrush
: NULL
, rects
, count
));
897 FillRegion(const Brush
*brush
, const Region
*region
)
899 return NotImplemented
;
903 Flush(FlushIntention intention
)
914 FromHDC(HDC hdc
, HANDLE hDevice
)
920 FromHWND(HWND hWnd
, BOOL icm
)
926 FromImage(Image
*image
)
932 GetClip(Region
*region
) const
934 return NotImplemented
;
938 GetClipBounds(Rect
*rect
) const
940 return SetStatus(DllExports::GdipGetClipBoundsI(nativeGraphics
, rect
));
944 GetClipBounds(RectF
*rect
) const
946 return SetStatus(DllExports::GdipGetClipBounds(nativeGraphics
, rect
));
949 CompositingMode
GetCompositingMode(VOID
)
951 CompositingMode compositingMode
;
952 SetStatus(DllExports::GdipGetCompositingMode(nativeGraphics
, &compositingMode
));
953 return compositingMode
;
956 CompositingQuality
GetCompositingQuality(VOID
)
958 CompositingQuality compositingQuality
;
959 SetStatus(DllExports::GdipGetCompositingQuality(nativeGraphics
, &compositingQuality
));
960 return compositingQuality
;
966 SetStatus(DllExports::GdipGetDpiX(nativeGraphics
, &dpi
));
973 SetStatus(DllExports::GdipGetDpiY(nativeGraphics
, &dpi
));
977 static HPALETTE
GetHalftonePalette(VOID
)
987 InterpolationMode
GetInterpolationMode(VOID
)
989 InterpolationMode interpolationMode
;
990 SetStatus(DllExports::GdipGetInterpolationMode(nativeGraphics
, &interpolationMode
));
991 return interpolationMode
;
994 Status
GetLastStatus(VOID
)
1000 GetNearestColor(Color
*color
) const
1002 return NotImplemented
;
1005 REAL
GetPageScale(VOID
)
1008 SetStatus(DllExports::GdipGetPageScale(nativeGraphics
, &scale
));
1012 Unit
GetPageUnit(VOID
)
1015 SetStatus(DllExports::GdipGetPageUnit(nativeGraphics
, &unit
));
1019 PixelOffsetMode
GetPixelOffsetMode(VOID
)
1021 PixelOffsetMode pixelOffsetMode
;
1022 SetStatus(DllExports::GdipGetPixelOffsetMode(nativeGraphics
, &pixelOffsetMode
));
1023 return pixelOffsetMode
;
1027 GetRenderingOrigin(INT
*x
, INT
*y
)
1029 return NotImplemented
; // FIXME: not available: SetStatus(DllExports::GdipGetRenderingOrigin(nativeGraphics, x,
1033 SmoothingMode
GetSmoothingMode(VOID
) const
1035 SmoothingMode smoothingMode
;
1036 SetStatus(DllExports::GdipGetSmoothingMode(nativeGraphics
, &smoothingMode
));
1037 return smoothingMode
;
1040 UINT
GetTextContrast(VOID
) const
1043 SetStatus(DllExports::GdipGetTextContrast(nativeGraphics
, &contrast
));
1047 TextRenderingHint
GetTextRenderingHint(VOID
) const
1049 TextRenderingHint mode
;
1050 SetStatus(DllExports::GdipGetTextRenderingHint(nativeGraphics
, &mode
));
1055 GetTransform(Matrix
*matrix
)
1057 return NotImplemented
;
1061 GetVisibleClipBounds(Rect
*rect
) const
1063 return SetStatus(DllExports::GdipGetVisibleClipBoundsI(nativeGraphics
, rect
));
1067 GetVisibleClipBounds(RectF
*rect
) const
1069 return SetStatus(DllExports::GdipGetVisibleClipBounds(nativeGraphics
, rect
));
1073 IntersectClip(const Rect
&rect
)
1075 return NotImplemented
;
1079 IntersectClip(const Region
*region
)
1081 return NotImplemented
;
1085 IntersectClip(const RectF
&rect
)
1087 return NotImplemented
;
1090 BOOL
IsClipEmpty(VOID
) const
1093 SetStatus(DllExports::GdipIsClipEmpty(nativeGraphics
, &result
));
1098 IsVisible(const Point
&point
) const
1101 SetStatus(DllExports::GdipIsVisiblePointI(nativeGraphics
, point
.X
, point
.Y
, &result
));
1106 IsVisible(const Rect
&rect
) const
1109 SetStatus(DllExports::GdipIsVisibleRectI(nativeGraphics
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
, &result
));
1114 IsVisible(REAL x
, REAL y
) const
1117 SetStatus(DllExports::GdipIsVisiblePoint(nativeGraphics
, x
, y
, &result
));
1122 IsVisible(const RectF
&rect
) const
1125 SetStatus(DllExports::GdipIsVisibleRect(nativeGraphics
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
, &result
));
1130 IsVisible(INT x
, INT y
, INT width
, INT height
) const
1133 SetStatus(DllExports::GdipIsVisibleRectI(nativeGraphics
, x
, y
, width
, height
, &result
));
1138 IsVisible(INT x
, INT y
) const
1141 SetStatus(DllExports::GdipIsVisiblePointI(nativeGraphics
, x
, y
, &result
));
1146 IsVisible(const PointF
&point
) const
1149 SetStatus(DllExports::GdipIsVisiblePoint(nativeGraphics
, point
.X
, point
.Y
, &result
));
1154 IsVisible(REAL x
, REAL y
, REAL width
, REAL height
) const
1157 SetStatus(DllExports::GdipIsVisibleRect(nativeGraphics
, x
, y
, width
, height
, &result
));
1161 BOOL
IsVisibleClipEmpty(VOID
) const
1163 return FALSE
; /* FIXME: not available:
1165 SetStatus(DllExports::GdipIsVisibleClipEmpty(nativeGraphics, &result));
1170 MeasureCharacterRanges(
1171 const WCHAR
*string
,
1174 const RectF
&layoutRect
,
1175 const StringFormat
*stringFormat
,
1177 Region
*regions
) const
1179 return NotImplemented
;
1183 MeasureDriverString(
1187 const PointF
*positions
,
1189 const Matrix
*matrix
,
1190 RectF
*boundingBox
) const
1192 return NotImplemented
;
1196 MeasureString(const WCHAR
*string
, INT length
, const Font
*font
, const RectF
&layoutRect
, RectF
*boundingBox
) const
1198 return NotImplemented
;
1203 const WCHAR
*string
,
1206 const PointF
&origin
,
1207 const StringFormat
*stringFormat
,
1208 RectF
*boundingBox
) const
1210 return NotImplemented
;
1215 const WCHAR
*string
,
1218 const RectF
&layoutRect
,
1219 const StringFormat
*stringFormat
,
1221 INT
*codepointsFitted
,
1222 INT
*linesFilled
) const
1224 return NotImplemented
;
1229 const WCHAR
*string
,
1232 const SizeF
&layoutRectSize
,
1233 const StringFormat
*stringFormat
,
1235 INT
*codepointsFitted
,
1236 INT
*linesFilled
) const
1238 return NotImplemented
;
1242 MeasureString(const WCHAR
*string
, INT length
, const Font
*font
, const PointF
&origin
, RectF
*boundingBox
) const
1244 return NotImplemented
;
1248 MultiplyTransform(Matrix
*matrix
, MatrixOrder order
)
1250 return NotImplemented
;
1258 Status
ResetClip(VOID
)
1260 return SetStatus(DllExports::GdipResetClip(nativeGraphics
));
1263 Status
ResetTransform(VOID
)
1265 return SetStatus(DllExports::GdipResetWorldTransform(nativeGraphics
));
1269 Restore(GraphicsState gstate
)
1271 return NotImplemented
;
1275 RotateTransform(REAL angle
, MatrixOrder order
)
1277 return SetStatus(DllExports::GdipRotateWorldTransform(nativeGraphics
, angle
, order
));
1280 GraphicsState
Save(VOID
)
1286 ScaleTransform(REAL sx
, REAL sy
, MatrixOrder order
)
1288 return SetStatus(DllExports::GdipScaleWorldTransform(nativeGraphics
, sx
, sy
, order
));
1292 SetClip(const Graphics
*g
, CombineMode combineMode
)
1294 return SetStatus(DllExports::GdipSetClipGraphics(nativeGraphics
, g
? g
->nativeGraphics
: NULL
, combineMode
));
1298 SetClip(const GraphicsPath
*path
, CombineMode combineMode
)
1300 return NotImplemented
;
1304 SetClip(const Region
*region
, CombineMode combineMode
)
1306 return NotImplemented
;
1310 SetClip(const Rect
&rect
, CombineMode combineMode
)
1313 DllExports::GdipSetClipRectI(nativeGraphics
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
, combineMode
));
1317 SetClip(HRGN hRgn
, CombineMode combineMode
)
1319 return SetStatus(DllExports::GdipSetClipHrgn(nativeGraphics
, hRgn
, combineMode
));
1323 SetClip(const RectF
&rect
, CombineMode combineMode
)
1326 DllExports::GdipSetClipRect(nativeGraphics
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
, combineMode
));
1330 SetCompositingMode(CompositingMode compositingMode
)
1332 return SetStatus(DllExports::GdipSetCompositingMode(nativeGraphics
, compositingMode
));
1336 SetCompositingQuality(CompositingQuality compositingQuality
)
1338 return SetStatus(DllExports::GdipSetCompositingQuality(nativeGraphics
, compositingQuality
));
1342 SetInterpolationMode(InterpolationMode interpolationMode
)
1344 return SetStatus(DllExports::GdipSetInterpolationMode(nativeGraphics
, interpolationMode
));
1348 SetPageScale(REAL scale
)
1350 return SetStatus(DllExports::GdipSetPageScale(nativeGraphics
, scale
));
1354 SetPageUnit(Unit unit
)
1356 return SetStatus(DllExports::GdipSetPageUnit(nativeGraphics
, unit
));
1360 SetPixelOffsetMode(PixelOffsetMode pixelOffsetMode
)
1362 return SetStatus(DllExports::GdipSetPixelOffsetMode(nativeGraphics
, pixelOffsetMode
));
1366 SetRenderingOrigin(INT x
, INT y
)
1368 return SetStatus(DllExports::GdipSetRenderingOrigin(nativeGraphics
, x
, y
));
1372 SetSmoothingMode(SmoothingMode smoothingMode
)
1374 return SetStatus(DllExports::GdipSetSmoothingMode(nativeGraphics
, smoothingMode
));
1378 SetTextContrast(UINT contrast
)
1380 return SetStatus(DllExports::GdipSetTextContrast(nativeGraphics
, contrast
));
1384 SetTextRenderingHint(TextRenderingHint newMode
)
1386 return SetStatus(DllExports::GdipSetTextRenderingHint(nativeGraphics
, newMode
));
1390 SetTransform(const Matrix
*matrix
)
1392 return NotImplemented
;
1396 TransformPoints(CoordinateSpace destSpace
, CoordinateSpace srcSpace
, Point
*pts
, INT count
)
1398 return SetStatus(DllExports::GdipTransformPointsI(nativeGraphics
, destSpace
, srcSpace
, pts
, count
));
1402 TranslateClip(INT dx
, INT dy
)
1404 return SetStatus(DllExports::GdipTranslateClipI(nativeGraphics
, dx
, dy
));
1408 TranslateClip(REAL dx
, REAL dy
)
1410 return SetStatus(DllExports::GdipTranslateClip(nativeGraphics
, dx
, dy
));
1414 TranslateTransform(REAL dx
, REAL dy
, MatrixOrder order
)
1416 return SetStatus(DllExports::GdipTranslateWorldTransform(nativeGraphics
, dx
, dy
, order
));
1421 SetStatus(Status status
) const
1425 this->status
= status
;
1430 SetGraphics(GpGraphics
*graphics
)
1432 nativeGraphics
= graphics
;
1436 GpGraphics
*nativeGraphics
;
1437 mutable Status status
;
1440 friend inline GpGraphics
*&
1441 getNat(const Graphics
*graph
)
1443 return const_cast<Graphics
*>(graph
)->nativeGraphics
;
1447 #endif /* _GDIPLUSGRAPHICS_H */