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
)
57 Status
AddMetafileComment(const BYTE
*data
, UINT sizeData
)
59 return SetStatus(DllExports::GdipComment(graphics
, sizeData
, data
));
62 GraphicsContainer
BeginContainer(VOID
)
64 return GraphicsContainer();
67 GraphicsContainer
BeginContainer(const RectF
&dstrect
, const RectF
&srcrect
, Unit unit
)
69 return GraphicsContainer();
72 GraphicsContainer
BeginContainer(const Rect
&dstrect
, const Rect
&srcrect
, Unit unit
)
74 return GraphicsContainer();
77 Status
Clear(const Color
&color
)
79 return SetStatus(DllExports::GdipGraphicsClear(graphics
, color
.GetValue()));
82 Status
DrawArc(const Pen
*pen
, const Rect
&rect
, REAL startAngle
, REAL sweepAngle
)
84 return SetStatus(DllExports::GdipDrawArcI(graphics
, pen
? pen
->pen
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
, startAngle
, sweepAngle
));
87 Status
DrawArc(const Pen
*pen
, const RectF
&rect
, REAL startAngle
, REAL sweepAngle
)
89 return SetStatus(DllExports::GdipDrawArcI(graphics
, pen
? pen
->pen
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
, startAngle
, sweepAngle
));
92 Status
DrawArc(const Pen
*pen
, REAL x
, REAL y
, REAL width
, REAL height
, REAL startAngle
, REAL sweepAngle
)
94 return SetStatus(DllExports::GdipDrawArc(graphics
, pen
? pen
->pen
: NULL
, x
, y
, width
, height
, startAngle
, sweepAngle
));
97 Status
DrawArc(const Pen
*pen
, INT x
, INT y
, INT width
, INT height
, REAL startAngle
, REAL sweepAngle
)
99 return SetStatus(DllExports::GdipDrawArcI(graphics
, pen
? pen
->pen
: NULL
, x
, y
, width
, height
, startAngle
, sweepAngle
));
102 Status
DrawBezier(const Pen
*pen
, const Point
&pt1
, const Point
&pt2
, const Point
&pt3
, const Point
&pt4
)
104 return SetStatus(DllExports::GdipDrawBezierI(graphics
, pen
? pen
->pen
: NULL
, pt1
.X
, pt1
.Y
, pt2
.X
, pt2
.Y
, pt3
.X
, pt3
.Y
, pt4
.X
, pt4
.Y
));
107 Status
DrawBezier(const Pen
*pen
, const PointF
&pt1
, const PointF
&pt2
, const PointF
&pt3
, const PointF
&pt4
)
109 return SetStatus(DllExports::GdipDrawBezier(graphics
, pen
? pen
->pen
: NULL
, pt1
.X
, pt1
.Y
, pt2
.X
, pt2
.Y
, pt3
.X
, pt3
.Y
, pt4
.X
, pt4
.Y
));
112 Status
DrawBezier(const Pen
*pen
, REAL x1
, REAL y1
, REAL x2
, REAL y2
, REAL x3
, REAL y3
, REAL x4
, REAL y4
)
114 return SetStatus(DllExports::GdipDrawBezier(graphics
, pen
? pen
->pen
: NULL
, x1
, y1
, x2
, y2
, x3
, y3
, x4
, y4
));
117 Status
DrawBezier(const Pen
*pen
, INT x1
, INT y1
, INT x2
, INT y2
, INT x3
, INT y3
, INT x4
, INT y4
)
119 return SetStatus(DllExports::GdipDrawBezierI(graphics
, pen
? pen
->pen
: NULL
, x1
, y1
, x2
, y2
, x3
, y3
, x4
, y4
));
122 Status
DrawBeziers(const Pen
*pen
, const Point
*points
, INT count
)
124 return SetStatus(DllExports::GdipDrawBeziersI(graphics
, pen
? pen
->pen
: NULL
, points
, count
));
127 Status
DrawBeziers(const Pen
*pen
, const PointF
*points
, INT count
)
129 return SetStatus(DllExports::GdipDrawBeziers(graphics
, pen
? pen
->pen
: NULL
, points
, count
));
132 Status
DrawCachedBitmap(CachedBitmap
*cb
, INT x
, INT y
)
134 return NotImplemented
;
137 Status
DrawClosedCurve(const Pen
*pen
, const Point
*points
, INT count
)
139 return SetStatus(DllExports::GdipDrawClosedCurveI(graphics
, pen
? pen
->pen
: NULL
, points
, count
));
142 Status
DrawClosedCurve(const Pen
*pen
, const PointF
*points
, INT count
)
144 return SetStatus(DllExports::GdipDrawClosedCurve(graphics
, pen
? pen
->pen
: NULL
, points
, count
));
147 Status
DrawClosedCurve(const Pen
*pen
, const PointF
*points
, INT count
, REAL tension
)
149 return SetStatus(DllExports::GdipDrawClosedCurve2(graphics
, pen
? pen
->pen
: NULL
, points
, count
, tension
));
152 Status
DrawClosedCurve(const Pen
*pen
, const Point
*points
, INT count
, REAL tension
)
154 return SetStatus(DllExports::GdipDrawClosedCurve2I(graphics
, pen
? pen
->pen
: NULL
, points
, count
, tension
));
157 Status
DrawCurve(const Pen
*pen
, const Point
*points
, INT count
)
159 return SetStatus(DllExports::GdipDrawCurveI(graphics
, pen
? pen
->pen
: NULL
, points
, count
));
162 Status
DrawCurve(const Pen
*pen
, const PointF
*points
, INT count
)
164 return SetStatus(DllExports::GdipDrawCurve(graphics
, pen
? pen
->pen
: NULL
, points
, count
));
167 Status
DrawCurve(const Pen
*pen
, const PointF
*points
, INT count
, REAL tension
)
169 return SetStatus(DllExports::GdipDrawCurve2(graphics
, pen
? pen
->pen
: NULL
, points
, count
, tension
));
172 Status
DrawCurve(const Pen
*pen
, const Point
*points
, INT count
, INT offset
, INT numberOfSegments
, REAL tension
)
174 return SetStatus(DllExports::GdipDrawCurve3I(graphics
, pen
? pen
->pen
: NULL
, points
, count
, offset
, numberOfSegments
, tension
));
177 Status
DrawCurve(const Pen
*pen
, const PointF
*points
, INT count
, INT offset
, INT numberOfSegments
, REAL tension
)
179 return SetStatus(DllExports::GdipDrawCurve3(graphics
, pen
? pen
->pen
: NULL
, points
, count
, offset
, numberOfSegments
, tension
));
182 Status
DrawCurve(const Pen
*pen
, const Point
*points
, INT count
, REAL tension
)
184 return SetStatus(DllExports::GdipDrawCurve2I(graphics
, pen
? pen
->pen
: NULL
, points
, count
, tension
));
187 Status
DrawDriverString(const UINT16
*text
, INT length
, const Font
*font
, const Brush
*brush
, const PointF
*positions
, INT flags
, const Matrix
*matrix
)
189 return NotImplemented
;
192 Status
DrawEllipse(const Pen
*pen
, const Rect
&rect
)
194 return SetStatus(DllExports::GdipDrawEllipseI(graphics
, pen
? pen
->pen
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
));
197 Status
DrawEllipse(const Pen
*pen
, REAL x
, REAL y
, REAL width
, REAL height
)
199 return SetStatus(DllExports::GdipDrawEllipse(graphics
, pen
? pen
->pen
: NULL
, x
, y
, width
, height
));
202 Status
DrawEllipse(const Pen
*pen
, const RectF
&rect
)
204 return SetStatus(DllExports::GdipDrawEllipse(graphics
, pen
? pen
->pen
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
));
207 Status
DrawEllipse(const Pen
*pen
, INT x
, INT y
, INT width
, INT height
)
209 return SetStatus(DllExports::GdipDrawEllipseI(graphics
, pen
? pen
->pen
: NULL
, x
, y
, width
, height
));
212 Status
DrawImage(Image
*image
, const Point
*destPoints
, INT count
)
214 return NotImplemented
;
217 Status
DrawImage(Image
*image
, INT x
, INT y
)
219 return NotImplemented
;
222 Status
DrawImage(Image
*image
, const Point
&point
)
224 return NotImplemented
;
227 Status
DrawImage(Image
*image
, REAL x
, REAL y
)
229 return NotImplemented
;
232 Status
DrawImage(Image
*image
, const PointF
&point
)
234 return NotImplemented
;
237 Status
DrawImage(Image
*image
, const PointF
*destPoints
, INT count
)
239 return NotImplemented
;
242 Status
DrawImage(Image
*image
, REAL x
, REAL y
, REAL srcx
, REAL srcy
, REAL srcwidth
, REAL srcheight
, Unit srcUnit
)
244 return NotImplemented
;
247 Status
DrawImage(Image
*image
, const RectF
&rect
)
249 return NotImplemented
;
252 Status
DrawImage(Image
*image
, INT x
, INT y
, INT width
, INT height
)
254 return NotImplemented
;
257 Status
DrawImage(Image
*image
, const PointF
*destPoints
, INT count
, REAL srcx
, REAL srcy
, REAL srcwidth
, REAL srcheight
, Unit srcUnit
, ImageAttributes
*imageAttributes
, DrawImageAbort callback
, VOID
*callbackData
)
259 return NotImplemented
;
262 Status
DrawImage(Image
*image
, const Rect
&destRect
, INT srcx
, INT srcy
, INT srcwidth
, INT srcheight
, Unit srcUnit
, ImageAttributes
*imageAttributes
, DrawImageAbort callback
, VOID
*callbackData
)
264 return NotImplemented
;
267 Status
DrawImage(Image
*image
, const Point
*destPoints
, INT count
, INT srcx
, INT srcy
, INT srcwidth
, INT srcheight
, Unit srcUnit
, ImageAttributes
*imageAttributes
, DrawImageAbort callback
, VOID
*callbackData
)
269 return NotImplemented
;
272 Status
DrawImage(Image
*image
, REAL x
, REAL y
, REAL width
, REAL height
)
274 return NotImplemented
;
277 Status
DrawImage(Image
*image
, const Rect
&rect
)
279 return NotImplemented
;
282 Status
DrawImage(Image
*image
, INT x
, INT y
, INT srcx
, INT srcy
, INT srcwidth
, INT srcheight
, Unit srcUnit
)
284 return NotImplemented
;
287 Status
DrawImage(Image
*image
, const RectF
&destRect
, REAL srcx
, REAL srcy
, REAL srcwidth
, REAL srcheight
, Unit srcUnit
, ImageAttributes
*imageAttributes
, DrawImageAbort callback
, VOID
*callbackData
)
289 return NotImplemented
;
292 Status
DrawLine(const Pen
*pen
, const Point
&pt1
, const Point
&pt2
)
294 return SetStatus(DllExports::GdipDrawLineI(graphics
, pen
? pen
->pen
: NULL
, pt1
.X
, pt1
.Y
, pt2
.X
, pt2
.Y
));
297 Status
DrawLine(const Pen
*pen
, const PointF
&pt1
, const Point
&pt2
)
299 return SetStatus(DllExports::GdipDrawLine(graphics
, pen
? pen
->pen
: NULL
, pt1
.X
, pt1
.Y
, pt2
.X
, pt2
.Y
));
302 Status
DrawLine(const Pen
*pen
, REAL x1
, REAL y1
, REAL x2
, REAL y2
)
304 return SetStatus(DllExports::GdipDrawLine(graphics
, pen
? pen
->pen
: NULL
, x1
, y1
, x2
, y2
));
307 Status
DrawLine(const Pen
*pen
, INT x1
, INT y1
, INT x2
, INT y2
)
309 return SetStatus(DllExports::GdipDrawLine(graphics
, pen
? pen
->pen
: NULL
, x1
, y1
, x2
, y2
));
312 Status
DrawLines(const Pen
*pen
, const Point
*points
, INT count
)
314 return SetStatus(DllExports::GdipDrawLinesI(graphics
, pen
? pen
->pen
: NULL
, points
, count
));
317 Status
DrawLines(const Pen
*pen
, const PointF
*points
, INT count
)
319 return SetStatus(DllExports::GdipDrawLines(graphics
, pen
? pen
->pen
: NULL
, points
, count
));
322 Status
DrawPath(const Pen
*pen
, const GraphicsPath
*path
)
324 return NotImplemented
;
327 Status
DrawPie(const Pen
*pen
, const Rect
&rect
, REAL startAngle
, REAL sweepAngle
)
329 return SetStatus(DllExports::GdipDrawPieI(graphics
, pen
? pen
->pen
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
, startAngle
, sweepAngle
));
332 Status
DrawPie(const Pen
*pen
, INT x
, INT y
, INT width
, INT height
, REAL startAngle
, REAL sweepAngle
)
334 return SetStatus(DllExports::GdipDrawPieI(graphics
, pen
? pen
->pen
: NULL
, x
, y
, width
, height
, startAngle
, sweepAngle
));
337 Status
DrawPie(const Pen
*pen
, REAL x
, REAL y
, REAL width
, REAL height
, REAL startAngle
, REAL sweepAngle
)
339 return SetStatus(DllExports::GdipDrawPie(graphics
, pen
? pen
->pen
: NULL
, x
, y
, width
, height
, startAngle
, sweepAngle
));
342 Status
DrawPie(const Pen
*pen
, const RectF
&rect
, REAL startAngle
, REAL sweepAngle
)
344 return SetStatus(DllExports::GdipDrawPie(graphics
, pen
? pen
->pen
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
, startAngle
, sweepAngle
));
347 Status
DrawPolygon(const Pen
*pen
, const Point
*points
, INT count
)
349 return SetStatus(DllExports::GdipDrawPolygonI(graphics
, pen
? pen
->pen
: NULL
, points
, count
));
352 Status
DrawPolygon(const Pen
*pen
, const PointF
*points
, INT count
)
354 return SetStatus(DllExports::GdipDrawPolygon(graphics
, pen
? pen
->pen
: NULL
, points
, count
));
357 Status
DrawRectangle(const Pen
*pen
, const Rect
&rect
)
359 return SetStatus(DllExports::GdipDrawRectangleI(graphics
, pen
? pen
->pen
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
));
362 Status
DrawRectangle(const Pen
*pen
, INT x
, INT y
, INT width
, INT height
)
364 return SetStatus(DllExports::GdipDrawRectangleI(graphics
, pen
? pen
->pen
: NULL
, x
, y
, width
, height
));
367 Status
DrawRectangle(const Pen
*pen
, REAL x
, REAL y
, REAL width
, REAL height
)
369 return SetStatus(DllExports::GdipDrawRectangle(graphics
, pen
? pen
->pen
: NULL
, x
, y
, width
, height
));
372 Status
DrawRectangle(const Pen
*pen
, const RectF
&rect
)
374 return SetStatus(DllExports::GdipDrawRectangleI(graphics
, pen
? pen
->pen
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
));
377 Status
DrawRectangles(const Pen
*pen
, const Rect
*rects
, INT count
)
379 return SetStatus(DllExports::GdipDrawRectanglesI(graphics
, pen
? pen
->pen
: NULL
, rects
, count
));
382 Status
DrawRectangles(const Pen
*pen
, const RectF
*rects
, INT count
)
384 return SetStatus(DllExports::GdipDrawRectangles(graphics
, pen
? pen
->pen
: NULL
, rects
, count
));
387 Status
DrawString(const WCHAR
*string
, INT length
, const Font
*font
, const RectF
&layoutRect
, const StringFormat
*stringFormat
, const Brush
*brush
)
389 return NotImplemented
;
392 Status
DrawString(const WCHAR
*string
, INT length
, const Font
*font
, const PointF
&origin
, const Brush
*brush
)
394 return NotImplemented
;
397 Status
DrawString(const WCHAR
*string
, INT length
, const Font
*font
, const PointF
&origin
, const StringFormat
*stringFormat
, const Brush
*brush
)
399 return NotImplemented
;
402 Status
EndContainer(GraphicsContainer state
)
404 return SetStatus(DllExports::GdipEndContainer(graphics
, state
));
407 Status
EnumerateMetafile(const Metafile
*metafile
, const Metafile
&destPoint
, EnumerateMetafileProc callback
, VOID
*callbackData
, ImageAttributes
*imageAttributes
)
409 return NotImplemented
;
412 Status
EnumerateMetafile(const Metafile
*metafile
, const Point
*destPoints
, INT count
, EnumerateMetafileProc callback
, VOID
*callbackData
, ImageAttributes
*imageAttributes
)
414 return NotImplemented
;
417 Status
EnumerateMetafile(const Metafile
*metafile
, const Point
&destPoint
, const Rect
&srcRect
, Unit srcUnit
, EnumerateMetafileProc callback
, VOID
*callbackData
, ImageAttributes
*imageAttributes
)
419 return NotImplemented
;
422 Status
EnumerateMetafile(const Metafile
*metafile
, const PointF
*destPoints
, INT count
, EnumerateMetafileProc callback
, VOID
*callbackData
, ImageAttributes
*imageAttributes
)
424 return NotImplemented
;
427 Status
EnumerateMetafile(const Metafile
*metafile
, const Rect
&destRect
, EnumerateMetafileProc callback
, VOID
*callbackData
, ImageAttributes
*imageAttributes
)
429 return NotImplemented
;
432 Status
EnumerateMetafile(const Metafile
*metafile
, const RectF
&destRect
, const RectF
&srcRect
, Unit srcUnit
, EnumerateMetafileProc callback
, VOID
*callbackData
, ImageAttributes
*imageAttributes
)
434 return NotImplemented
;
437 Status
EnumerateMetafile(const Metafile
*metafile
, const RectF
&destRect
, EnumerateMetafileProc callback
, VOID
*callbackData
, ImageAttributes
*imageAttributes
)
439 return NotImplemented
;
442 Status
EnumerateMetafile(const Metafile
*metafile
, const PointF
&destPoint
, const Rect
&srcRect
, Unit srcUnit
, EnumerateMetafileProc callback
, VOID
*callbackData
, ImageAttributes
*imageAttributes
)
444 return NotImplemented
;
447 Status
EnumerateMetafile(const Metafile
*metafile
, const Point
*destPoints
, INT count
, const Rect
&srcRect
, Unit srcUnit
, EnumerateMetafileProc callback
, VOID
*callbackData
, ImageAttributes
*imageAttributes
)
449 return NotImplemented
;
452 Status
EnumerateMetafile(const Metafile
*metafile
, const Rect
&destRect
, const Rect
&srcRect
, Unit srcUnit
, EnumerateMetafileProc callback
, VOID
*callbackData
, ImageAttributes
*imageAttributes
)
454 return NotImplemented
;
457 Status
EnumerateMetafile(const Metafile
*metafile
, const Point
*destPoints
, INT count
, const RectF
&srcRect
, Unit srcUnit
, EnumerateMetafileProc callback
, VOID
*callbackData
, ImageAttributes
*imageAttributes
)
459 return NotImplemented
;
462 Status
EnumerateMetafile(const Metafile
*metafile
, const PointF
&destPoint
, EnumerateMetafileProc callback
, VOID
*callbackData
, ImageAttributes
*imageAttributes
)
464 return NotImplemented
;
467 Status
ExcludeClip(const Rect
& rect
)
469 return NotImplemented
;
472 Status
ExcludeClip(const RectF
&rect
)
474 return NotImplemented
;
477 Status
ExcludeClip(const Region
*region
)
479 return NotImplemented
;
482 Status
FillClosedCurve(const Brush
*brush
, const Point
*points
, INT count
)
484 return SetStatus(DllExports::GdipFillClosedCurveI(graphics
, brush
? brush
->brush
: NULL
, points
, count
));
487 Status
FillClosedCurve(const Brush
*brush
, const Point
*points
, INT count
, FillMode fillMode
, REAL tension
)
489 return SetStatus(DllExports::GdipFillClosedCurve2I(graphics
, brush
? brush
->brush
: NULL
, points
, count
, tension
, fillMode
));
492 Status
FillClosedCurve(const Brush
*brush
, const PointF
*points
, INT count
)
494 return SetStatus(DllExports::GdipFillClosedCurve(graphics
, brush
? brush
->brush
: NULL
, points
, count
));
497 Status
FillClosedCurve(const Brush
*brush
, const PointF
*points
, INT count
, FillMode fillMode
, REAL tension
)
499 return SetStatus(DllExports::GdipFillClosedCurve2(graphics
, brush
? brush
->brush
: NULL
, points
, count
, tension
, fillMode
));
502 Status
FillEllipse(const Brush
*brush
, const Rect
&rect
)
504 return SetStatus(DllExports::GdipFillEllipseI(graphics
, brush
? brush
->brush
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
));
507 Status
FillEllipse(const Brush
*brush
, REAL x
, REAL y
, REAL width
, REAL height
)
509 return SetStatus(DllExports::GdipFillEllipse(graphics
, brush
? brush
->brush
: NULL
, x
, y
, width
, height
));
512 Status
FillEllipse(const Brush
*brush
, const RectF
&rect
)
514 return SetStatus(DllExports::GdipFillEllipse(graphics
, brush
? brush
->brush
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
));
517 Status
FillEllipse(const Brush
*brush
, INT x
, INT y
, INT width
, INT height
)
519 return SetStatus(DllExports::GdipFillEllipseI(graphics
, brush
? brush
->brush
: NULL
, x
, y
, width
, height
));
522 Status
FillPath(const Brush
*brush
, const GraphicsPath
*path
)
524 return NotImplemented
;
527 Status
FillPie(const Brush
*brush
, const Rect
&rect
, REAL startAngle
, REAL sweepAngle
)
529 return SetStatus(DllExports::GdipFillPieI(graphics
, brush
? brush
->brush
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
, startAngle
, sweepAngle
));
532 Status
FillPie(const Brush
*brush
, INT x
, INT y
, INT width
, INT height
, REAL startAngle
, REAL sweepAngle
)
534 return SetStatus(DllExports::GdipFillPieI(graphics
, brush
? brush
->brush
: NULL
, x
, y
, width
, height
, startAngle
, sweepAngle
));
537 Status
FillPie(const Brush
*brush
, REAL x
, REAL y
, REAL width
, REAL height
, REAL startAngle
, REAL sweepAngle
)
539 return SetStatus(DllExports::GdipFillPie(graphics
, brush
? brush
->brush
: NULL
, x
, y
, width
, height
, startAngle
, sweepAngle
));
542 Status
FillPie(const Brush
*brush
, RectF
&rect
, REAL startAngle
, REAL sweepAngle
)
544 return SetStatus(DllExports::GdipFillPie(graphics
, brush
? brush
->brush
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
, startAngle
, sweepAngle
));
547 Status
FillPolygon(const Brush
*brush
, const Point
*points
, INT count
)
549 return SetStatus(DllExports::GdipFillPolygon2I(graphics
, brush
? brush
->brush
: NULL
, points
, count
));
552 Status
FillPolygon(const Brush
*brush
, const PointF
*points
, INT count
)
554 return SetStatus(DllExports::GdipFillPolygon2(graphics
, brush
? brush
->brush
: NULL
, points
, count
));
557 Status
FillPolygon(const Brush
*brush
, const Point
*points
, INT count
, FillMode fillMode
)
559 return SetStatus(DllExports::GdipFillPolygonI(graphics
, brush
? brush
->brush
: NULL
, points
, count
, fillMode
));
562 Status
FillPolygon(const Brush
*brush
, const PointF
*points
, INT count
, FillMode fillMode
)
564 return SetStatus(DllExports::GdipFillPolygon(graphics
, brush
? brush
->brush
: NULL
, points
, count
, fillMode
));
567 Status
FillRectangle(const Brush
*brush
, const Rect
&rect
)
569 return SetStatus(DllExports::GdipFillRectangleI(graphics
, brush
? brush
->brush
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
));
572 Status
FillRectangle(const Brush
*brush
, const RectF
&rect
)
574 return SetStatus(DllExports::GdipFillRectangle(graphics
, brush
? brush
->brush
: NULL
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
));
577 Status
FillRectangle(const Brush
*brush
, REAL x
, REAL y
, REAL width
, REAL height
)
579 return SetStatus(DllExports::GdipFillRectangle(graphics
, brush
? brush
->brush
: NULL
, x
, y
, width
, height
));
582 Status
FillRectangle(const Brush
*brush
, INT x
, INT y
, INT width
, INT height
)
584 return SetStatus(DllExports::GdipFillRectangleI(graphics
, brush
? brush
->brush
: NULL
, x
, y
, width
, height
));
587 Status
FillRectangles(const Brush
*brush
, const Rect
*rects
, INT count
)
589 return SetStatus(DllExports::GdipFillRectanglesI(graphics
, brush
? brush
->brush
: NULL
, rects
, count
));
592 Status
FillRectangles(const Brush
*brush
, const RectF
*rects
, INT count
)
594 return SetStatus(DllExports::GdipFillRectangles(graphics
, brush
? brush
->brush
: NULL
, rects
, count
));
597 Status
FillRegion(const Brush
*brush
, const Region
*region
)
599 return NotImplemented
;
602 VOID
Flush(FlushIntention intention
)
606 static Graphics
*FromHDC(HDC hdc
)
611 static Graphics
*FromHDC(HDC hdc
, HANDLE hDevice
)
616 static Graphics
*FromHWND(HWND hWnd
, BOOL icm
)
621 static Graphics
*FromImage(Image
*image
)
626 Status
GetClip(Region
*region
) const
628 return NotImplemented
;
631 Status
GetClipBounds(Rect
* rect
) const
633 return SetStatus(DllExports::GdipGetClipBoundsI(graphics
, rect
));
636 Status
GetClipBounds(RectF
* rect
) const
638 return SetStatus(DllExports::GdipGetClipBounds(graphics
, rect
));
641 CompositingMode
GetCompositingMode(VOID
)
643 CompositingMode compositingMode
;
644 SetStatus(DllExports::GdipGetCompositingMode(graphics
, &compositingMode
));
645 return compositingMode
;
648 CompositingQuality
GetCompositingQuality(VOID
)
650 CompositingQuality compositingQuality
;
651 SetStatus(DllExports::GdipGetCompositingQuality(graphics
, &compositingQuality
));
652 return compositingQuality
;
658 SetStatus(DllExports::GdipGetDpiX(graphics
, &dpi
));
665 SetStatus(DllExports::GdipGetDpiY(graphics
, &dpi
));
669 static HPALETTE
GetHalftonePalette(VOID
)
679 InterpolationMode
GetInterpolationMode(VOID
)
681 InterpolationMode interpolationMode
;
682 SetStatus(DllExports::GdipGetInterpolationMode(graphics
, &interpolationMode
));
683 return interpolationMode
;
686 Status
GetLastStatus(VOID
)
691 Status
GetNearestColor(Color
* color
) const
693 return NotImplemented
;
696 REAL
GetPageScale(VOID
)
699 SetStatus(DllExports::GdipGetPageScale(graphics
, &scale
));
703 Unit
GetPageUnit(VOID
)
706 SetStatus(DllExports::GdipGetPageUnit(graphics
, &unit
));
710 PixelOffsetMode
GetPixelOffsetMode(VOID
)
712 PixelOffsetMode pixelOffsetMode
;
713 SetStatus(DllExports::GdipGetPixelOffsetMode(graphics
, &pixelOffsetMode
));
714 return pixelOffsetMode
;
717 Status
GetRenderingOrigin(INT
*x
, INT
*y
)
719 return NotImplemented
; // FIXME: not available: SetStatus(DllExports::GdipGetRenderingOrigin(graphics, x, y));
722 SmoothingMode
GetSmoothingMode(VOID
) const
724 SmoothingMode smoothingMode
;
725 SetStatus(DllExports::GdipGetSmoothingMode(graphics
, &smoothingMode
));
726 return smoothingMode
;
729 UINT
GetTextContrast(VOID
) const
732 SetStatus(DllExports::GdipGetTextContrast(graphics
, &contrast
));
736 TextRenderingHint
GetTextRenderingHint(VOID
) const
738 TextRenderingHint mode
;
739 SetStatus(DllExports::GdipGetTextRenderingHint(graphics
, &mode
));
743 Status
GetTransform(Matrix
* matrix
)
745 return NotImplemented
;
748 Status
GetVisibleClipBounds(Rect
* rect
) const
750 return SetStatus(DllExports::GdipGetVisibleClipBoundsI(graphics
, rect
));
753 Status
GetVisibleClipBounds(RectF
* rect
) const
755 return SetStatus(DllExports::GdipGetVisibleClipBounds(graphics
, rect
));
758 Status
IntersectClip(const Rect
& rect
)
760 return NotImplemented
;
763 Status
IntersectClip(const Region
* region
)
765 return NotImplemented
;
768 Status
IntersectClip(const RectF
& rect
)
770 return NotImplemented
;
773 BOOL
IsClipEmpty(VOID
) const
776 SetStatus(DllExports::GdipIsClipEmpty(graphics
, &result
));
780 BOOL
IsVisible(const Point
& point
) const
783 SetStatus(DllExports::GdipIsVisiblePointI(graphics
, point
.X
, point
.Y
, &result
));
787 BOOL
IsVisible(const Rect
& rect
) const
790 SetStatus(DllExports::GdipIsVisibleRectI(graphics
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
, &result
));
794 BOOL
IsVisible(REAL x
, REAL y
) const
797 SetStatus(DllExports::GdipIsVisiblePoint(graphics
, x
, y
, &result
));
801 BOOL
IsVisible(const RectF
& rect
) const
804 SetStatus(DllExports::GdipIsVisibleRect(graphics
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
, &result
));
808 BOOL
IsVisible(INT x
, INT y
, INT width
, INT height
) const
811 SetStatus(DllExports::GdipIsVisibleRectI(graphics
, x
, y
, width
, height
, &result
));
815 BOOL
IsVisible(INT x
, INT y
) const
818 SetStatus(DllExports::GdipIsVisiblePointI(graphics
, x
, y
, &result
));
822 BOOL
IsVisible(const PointF
& point
) const
825 SetStatus(DllExports::GdipIsVisiblePoint(graphics
, point
.X
, point
.Y
, &result
));
829 BOOL
IsVisible(REAL x
, REAL y
, REAL width
, REAL height
) const
832 SetStatus(DllExports::GdipIsVisibleRect(graphics
, x
, y
, width
, height
, &result
));
836 BOOL
IsVisibleClipEmpty(VOID
) const
838 return FALSE
; /* FIXME: not available:
840 SetStatus(DllExports::GdipIsVisibleClipEmpty(graphics, &result));
844 Status
MeasureCharacterRanges(const WCHAR
*string
, INT length
, const Font
*font
, const RectF
&layoutRect
, const StringFormat
*stringFormat
, INT regionCount
, Region
*regions
) const
846 return NotImplemented
;
849 Status
MeasureDriverString(const UINT16
*text
, INT length
, const Font
*font
, const PointF
*positions
, INT flags
, const Matrix
*matrix
, RectF
*boundingBox
) const
851 return NotImplemented
;
854 Status
MeasureString(const WCHAR
*string
, INT length
, const Font
*font
, const RectF
&layoutRect
, RectF
*boundingBox
) const
856 return NotImplemented
;
859 Status
MeasureString(const WCHAR
*string
, INT length
, const Font
*font
, const PointF
&origin
, const StringFormat
*stringFormat
, RectF
*boundingBox
) const
861 return NotImplemented
;
864 Status
MeasureString(const WCHAR
*string
, INT length
, const Font
*font
, const RectF
&layoutRect
, const StringFormat
*stringFormat
, RectF
*boundingBox
, INT
*codepointsFitted
, INT
*linesFilled
) const
866 return NotImplemented
;
869 Status
MeasureString(const WCHAR
*string
, INT length
, const Font
*font
, const SizeF
&layoutRectSize
, const StringFormat
*stringFormat
, SizeF
*size
, INT
*codepointsFitted
, INT
*linesFilled
) const
871 return NotImplemented
;
874 Status
MeasureString(const WCHAR
*string
, INT length
, const Font
*font
, const PointF
&origin
, RectF
*boundingBox
) const
876 return NotImplemented
;
879 Status
MultiplyTransform(Matrix
*matrix
, MatrixOrder order
)
881 return NotImplemented
;
884 VOID
ReleaseHDC(HDC hdc
)
888 Status
ResetClip(VOID
)
890 return SetStatus(DllExports::GdipResetClip(graphics
));
893 Status
ResetTransform(VOID
)
895 return SetStatus(DllExports::GdipResetWorldTransform(graphics
));
898 Status
Restore(GraphicsState gstate
)
900 return NotImplemented
;
903 Status
RotateTransform(REAL angle
, MatrixOrder order
)
905 return SetStatus(DllExports::GdipRotateWorldTransform(graphics
, angle
, order
));
908 GraphicsState
Save(VOID
)
913 Status
ScaleTransform(REAL sx
, REAL sy
, MatrixOrder order
)
915 return SetStatus(DllExports::GdipScaleWorldTransform(graphics
, sx
, sy
, order
));
918 Status
SetClip(const Graphics
*g
, CombineMode combineMode
)
920 return SetStatus(DllExports::GdipSetClipGraphics(graphics
, g
? g
->graphics
: NULL
, combineMode
));
923 Status
SetClip(const GraphicsPath
*path
, CombineMode combineMode
)
925 return NotImplemented
;
928 Status
SetClip(const Region
*region
, CombineMode combineMode
)
930 return NotImplemented
;
933 Status
SetClip(const Rect
&rect
, CombineMode combineMode
)
935 return SetStatus(DllExports::GdipSetClipRectI(graphics
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
, combineMode
));
938 Status
SetClip(HRGN hRgn
, CombineMode combineMode
)
940 return SetStatus(DllExports::GdipSetClipHrgn(graphics
, hRgn
, combineMode
));
943 Status
SetClip(const RectF
& rect
, CombineMode combineMode
)
945 return SetStatus(DllExports::GdipSetClipRect(graphics
, rect
.X
, rect
.Y
, rect
.Width
, rect
.Height
, combineMode
));
948 Status
SetCompositingMode(CompositingMode compositingMode
)
950 return SetStatus(DllExports::GdipSetCompositingMode(graphics
, compositingMode
));
953 Status
SetCompositingQuality(CompositingQuality compositingQuality
)
955 return SetStatus(DllExports::GdipSetCompositingQuality(graphics
, compositingQuality
));
958 Status
SetInterpolationMode(InterpolationMode interpolationMode
)
960 return SetStatus(DllExports::GdipSetInterpolationMode(graphics
, interpolationMode
));
963 Status
SetPageScale(REAL scale
)
965 return SetStatus(DllExports::GdipSetPageScale(graphics
, scale
));
968 Status
SetPageUnit(Unit unit
)
970 return SetStatus(DllExports::GdipSetPageUnit(graphics
, unit
));
973 Status
SetPixelOffsetMode(PixelOffsetMode pixelOffsetMode
)
975 return SetStatus(DllExports::GdipSetPixelOffsetMode(graphics
, pixelOffsetMode
));
978 Status
SetRenderingOrigin(INT x
, INT y
)
980 return SetStatus(DllExports::GdipSetRenderingOrigin(graphics
, x
, y
));
983 Status
SetSmoothingMode(SmoothingMode smoothingMode
)
985 return SetStatus(DllExports::GdipSetSmoothingMode(graphics
, smoothingMode
));
988 Status
SetTextContrast(UINT contrast
)
990 return SetStatus(DllExports::GdipSetTextContrast(graphics
, contrast
));
993 Status
SetTextRenderingHint(TextRenderingHint newMode
)
995 return SetStatus(DllExports::GdipSetTextRenderingHint(graphics
, newMode
));
998 Status
SetTransform(const Matrix
*matrix
)
1000 return NotImplemented
;
1003 Status
TransformPoints(CoordinateSpace destSpace
, CoordinateSpace srcSpace
, Point
*pts
, INT count
)
1005 return SetStatus(DllExports::GdipTransformPointsI(graphics
, destSpace
, srcSpace
, pts
, count
));
1008 Status
TranslateClip(INT dx
, INT dy
)
1010 return SetStatus(DllExports::GdipTranslateClipI(graphics
, dx
, dy
));
1013 Status
TranslateClip(REAL dx
, REAL dy
)
1015 return SetStatus(DllExports::GdipTranslateClip(graphics
, dx
, dy
));
1018 Status
TranslateTransform(REAL dx
, REAL dy
, MatrixOrder order
)
1020 return SetStatus(DllExports::GdipTranslateWorldTransform(graphics
, dx
, dy
, order
));
1024 Status
SetStatus(Status status
) const
1028 this->status
= status
;
1032 VOID
SetGraphics(GpGraphics
*graphics
)
1034 this->graphics
= graphics
;
1038 mutable Status status
;
1039 GpGraphics
*graphics
;
1042 #endif /* _GDIPLUSGRAPHICS_H */