source: branch/egtra-gdiplus/Classes/System/Drawing/Graphics.ab@ 241

Last change on this file since 241 was 241, checked in by イグトランス (egtra), 17 years ago

GDI+に対して名前空間で囲ったものの、現在コンパイルできないため分岐させておく

File size: 78.1 KB
RevLine 
[33]1' Classes/System/Drawing/Graphics.ab
2
3#ifndef __SYSTEM_DRAWING_GRAPHICS_AB__
4#define __SYSTEM_DRAWING_GRAPHICS_AB__
5
[241]6#require <GdiplusGpStubs.ab>
7#require <GdiPlusFlat.ab>
8#require <Classes/System/Drawing/misc.ab>
9#require <Classes/System/Drawing/Rectangle.ab>
10#require <Classes/System/Drawing/RectangleF.ab>
11#require <Classes/System/Drawing/Point.ab>
12#require <Classes/System/Drawing/PointF.ab>
13#require <Classes/System/Drawing/SizeF.ab>
14#require <Classes/System/Drawing/Font.ab>
15#require <Classes/System/Drawing/Brush.ab>
16'#require <Classes/System/Drawing/Pen.ab>
17'#require <Classes/System/Drawing/Region.ab>
18'#require <Classes/System/Drawing/StringFormat.ab>
19'#require <Classes/System/Drawing/Image.ab>
20#require <Classes/System/Drawing/Drawing2D/misc.ab>
21#require <Classes/System/Drawing/Drawing2D/Matrix.ab>
22#require <Classes/System/Drawing/Imaging/ImageAttributes.ab>
23
24Namespace System
25Namespace Drawing
26
[104]27Class Pen : End Class
28Class StringFormat : End Class
29Class Image : End Class
30Class Metafile : End Class
31Class Region : End Class
32Class GraphicsPath : End Class
33Class CachedBitmap : End Class
34
[33]35Class Graphics
36Public
37 '=========================================================================
38 ' Properties
39 '=========================================================================
40 Const Function Clip() As Region
[212]41 Dim r As Region
[33]42 GetClip(r)
43 Return r
44 End Function
45
[212]46 Sub Clip(region As /*Const*/ Region)
[33]47 SetClip(region, CombineMode.Replace)
48 End Sub
49
50 Const Function ClipBounds() As RectangleF
51 Dim rc As RectangleF
52 GetClipBounds(rc)
53 Return rc
54 End Function
55
56 Sub ClipBounds(rc As RectangleF)
57 SetClipBounds(rc)
58 End Sub
59
60 Function CompositingMode() As CompositingMode
61 Return GetCompositingMode()
62 End Function
63
64 Sub CompositingMode(mode As CompositingMode)
65 SetCompositingMode(mode)
66 End Sub
67
68 Function CompositingQuality() As CompositingQuality
69 Return GetCompositingQuality()
70 End Function
71
72 Sub CompositingQuality(cq As CompositingQuality)
73 SetCompositingQuality(cq)
74 End Sub
75
76 Const Function DpiX() As Single
77 Dim dpi As Single
78 SetStatus(GdipGetDpiX(nativeGraphics, dpi))
79 Return dpi
80 End Function
81
82 Const Function DpiY() As Single
83 Dim dpi As Single
84 SetStatus(GdipGetDpiY(nativeGraphics, dpi))
85 Return dpi
86 End Function
87
88 Const Function InterpolationMode() As InterpolationMode
89 Return GetInterpolationMode()
90 End Function
91
92 Sub InterpolationMode(im As InterpolationMode)
93 SetInterpolationMode(im)
94 End Sub
95
96 Const Function IsClipEmpty() As BOOL
97 Dim b = FALSE As BOOL
98 SetStatus(GdipIsClipEmpty(nativeGraphics, b))
99 Return b
100 End Function
101
102 Const Function IsVisibleClipEmpty() As BOOL
103 Dim b = FALSE As BOOL
104 SetStatus(GdipIsVisibleClipEmpty(nativeGraphics, b))
105 Return b
106 End Function
107
[241]108 Function PageScale(scale As Single) As Gdiplus.Status
[33]109 Return SetStatus(GdipSetPageScale(nativeGraphics, scale))
110 End Function
111
112 Const Function PageScale() As Single
113 Dim scale As Single
114 SetStatus(GdipGetPageScale(nativeGraphics, scale))
115 Return scale
116 End Function
117
118 Const Function PageUnit() As GraphicsUnit
119 Dim unit As GraphicsUnit
120 SetStatus(GdipGetPageUnit(nativeGraphics, unit))
121 Return unit
122 End Function
123
[241]124 Function PageUnit(unit As GraphicsUnit) As Gdiplus.Status
[33]125 Return SetStatus(GdipSetPageUnit(nativeGraphics, unit))
126 End Function
127
128 Function PixelOffsetMode() As PixelOffsetMode
129 Return GetPixelOffsetMode()
130 End Function
131
132 Sub PixelOffsetMode(mode As PixelOffsetMode)
133 SetPixelOffsetMode(mode)
134 End Sub
135
136 Function RenderingOrigin() As Point
137 Dim pt As Point
138 GetRenderingOrigin(pt.X, pt.Y)
139 Return pt
140 End Function
141
142 Sub RenderingOrigin(pt As Point)
143 SetRenderingOrigin(pt.X, pt.Y)
144 End Sub
145
146 Function SmoothingMode() As SmoothingMode
147 Return GetSmoothingMode()
148 End Function
149
150 Sub SmoothingMode(mode As SmoothingMode)
151 SetSmoothingMode(mode)
152 End Sub
153
154 Function TextContrast() As DWord
155 Return GetTextContrast()
156 End Function
157
158 Sub TextContrast(contrast As DWord)
159 SetTextContrast(contrast)
160 End Sub
161
162 Function TextRenderingHint() As TextRenderingHint
163 Return GetTextRenderingHint()
164 End Function
165
166 Sub TextRenderingHint(mode As TextRenderingHint)
167 SetTextRenderingHint(mode)
168 End Sub
169
170 Function Transform() As Matrix
171 Dim matrix As Matrix
172 GetTransform(matrix)
173 Return matrix
174 End Function
175
[212]176 Sub Transform(matrix As Matrix)
[33]177 SetTransform(matirx)
178 End Sub
179
180 Function VisibleClipBounds() As RectangleF
181 Dim rc As RectangleF
182 GetVisibleClipBounds(rc)
183 Return rc
184 End Function
185
186 '=========================================================================
187 ' Methods
188 '=========================================================================
[212]189 Static Function FromHDC(hdc As HDC) As Graphics
[33]190 Return New Graphics(hdc)
191 End Function
192
[212]193 Static Function FromHDC(hdc As HDC, hdevice As HANDLE) As Graphics
[33]194 Return New Graphics(hdc, hdevice)
195 End Function
196
[212]197 Static Function FromHWND(hwnd As HWND) As Graphics
[33]198 Return New Graphics(hwnd, FALSE)
199 End Function
200
[212]201 Static Function FromHWND(hwnd As DWord, icm As BOOL) As Graphics
[33]202 Return New Graphics(hwnd, icm)
203 End Function
204
[212]205 Static Function FromImage(image As Image) As Graphics
[33]206 Return New Graphics(image)
207 End Function
208
209 Sub Graphics(hdc As HDC)
[241]210 Dim graphics = 0 As Gdiplus.GpGraphics
[33]211 lastResult = GdipCreateFromHDC(hdc, graphics)
212 SetNativeGraphics(graphics)
213 End Sub
214
215 Sub Graphics(hdc As HDC, hdevice As HANDLE)
[241]216 Dim graphics = 0 As *Gdiplus.GpGraphics
[33]217 lastResult = GdipCreateFromHDC2(hdc, hdevice, graphics)
218 SetNativeGraphics(graphics)
219 End Sub
220
221 Sub Graphics(hwnd As HWND)
[241]222 Dim graphics = 0 As *Gdiplus.GpGraphics
[33]223 lastResult = GdipCreateFromHWND(hwnd, graphics)
224 SetNativeGraphics(graphics)
225 End Sub
226
227 Sub Graphics(hwnd As HWND, icm As BOOL)
[241]228 Dim graphics = 0 As *Gdiplus.GpGraphics
[33]229 If icm <> FALSE Then
230 lastResult = GdipCreateFromHWNDICM(hwnd, graphics)
231 Else
232 lastResult = GdipCreateFromHWND(hwnd, graphics)
233 End If
234 SetNativeGraphics(graphics)
235 End Sub
236
[212]237 Sub Graphics(image As Image)
[241]238 Dim graphics = 0 As *Gdiplus.GpGraphics
[33]239 If (image != 0)
[104]240 lastResult = GdipGetImageGraphicsContext(image->NativeImage, graphics)
[33]241 End If
242 SetNativeGraphics(graphics)
243 End Sub
244
245 Sub ~Graphics()
246 GdipDeleteGraphics(nativeGraphics)
247 End Sub
248
249 Sub Flush()
250 GdipFlush(nativeGraphics, FlushIntention.Flush)
251 End Sub
252
253 Sub Flush(intention As FlushIntention)
254 GdipFlush(nativeGraphics, intention)
255 End Sub
256
257 '------------------------------------------------------------------------
258 ' GDI Interop methods
259 '------------------------------------------------------------------------
260
261 ' Locks the graphics until ReleaseDC is called
262
263 Function GetHDC() As HDC
264 Dim hdc = 0 As HDC
265 SetStatus(GdipGetDC(nativeGraphics, hdc))
266 Return hdc
267 End Function
268
269 Sub ReleaseHDC(hdc As HDC)
270 SetStatus(GdipReleaseDC(nativeGraphics, hdc))
271 End Sub
272
273 '------------------------------------------------------------------------
274 ' Rendering modes
275 '------------------------------------------------------------------------
276
[241]277 Function SetRenderingOrigin(x As Long, y As Long) As Gdiplus.Status
[33]278 Return SetStatus(GdipSetRenderingOrigin(nativeGraphics, x, y))
279 End Function
280
[241]281 Const Function GetRenderingOrigin(x As Long, y As Long) As Gdiplus.Status
[33]282 Return SetStatus(GdipGetRenderingOrigin(nativeGraphics, x, y))
283 End Function
284
[241]285 Function SetCompositingMode(compositingMode As CompositingMode) As Gdiplus.Status
[33]286 Return SetStatus(GdipSetCompositingMode(nativeGraphics, compositingMode))
287 End Function
288
289 Const Function GetCompositingMode() As CompositingMode
290 Dim mode As CompositingMode
291 SetStatus(GdipGetCompositingMode(nativeGraphics, mode))
292 Return mode
293 End Function
294
295 Function SetCompositingQuality(compositingQuality As CompositingQuality)
296 Return SetStatus(GdipSetCompositingQuality(nativeGraphics, compositingQuality))
297 End Function
298
299 Const Function GetCompositingQuality() As CompositingQuality
300 Dim quality As CompositingQuality
301 SetStatus(GdipGetCompositingQuality(nativeGraphics, quality))
302 Return quality
303 End Function
304
[241]305 Function SetTextRenderingHint(newMode As TextRenderingHint) As Gdiplus.Status
[33]306 Return SetStatus(GdipSetTextRenderingHint(nativeGraphics, newMode))
307 End Function
308
309 Const Function GetTextRenderingHint() As TextRenderingHint
310 Dim hint As TextRenderingHint
311 SetStatus(GdipGetTextRenderingHint(nativeGraphics, hint))
312 Return hint
313 End Function
314
[241]315 Function SetTextContrast(contrast As DWord) As Gdiplus.Status
[33]316 Return SetStatus(GdipSetTextContrast(nativeGraphics, contrast))
317 End Function
318
319 Const Function GetTextContrast() As DWord
320 Dim contrast As DWord
321 SetStatus(GdipGetTextContrast(nativeGraphics, contrast))
322 Return contrast
323 End Function
324
325 Const Function GetInterpolationMode() As InterpolationMode
326 Dim mode = InterpolationMode.Invalid As InterpolationMode
327 SetStatus(GdipGetInterpolationMode(nativeGraphics, mode))
328 Return mode
329 End Function
330
[241]331 Function SetInterpolationMode(interpolationMode As InterpolationMode) As Gdiplus.Status
[33]332 Return SetStatus(GdipSetInterpolationMode(nativeGraphics, interpolationMode))
333 End Function
334
335 Const Function GetSmoothingMode() As SmoothingMode
336 Dim smoothingMode = SmoothingMode.Invalid As SmoothingMode
337 SetStatus(GdipGetSmoothingMode(nativeGraphics, smoothingMode))
338 Return smoothingMode
339 End Function
340
[241]341 Function SetSmoothingMode(smoothingMode As SmoothingMode) As Gdiplus.Status
[33]342 Return SetStatus(GdipSetSmoothingMode(nativeGraphics, smoothingMode))
343 End Function
344
345 Const Function GetPixelOffsetMode() As PixelOffsetMode
346 Dim pixelOffsetMode = PixelOffsetMode.Invalid As PixelOffsetMode
347 SetStatus(GdipGetPixelOffsetMode(nativeGraphics, pixelOffsetMode))
348 Return pixelOffsetMode
349 End Function
350
[241]351 Function SetPixelOffsetMode(pixelOffsetMode As PixelOffsetMode) As Gdiplus.Status
[33]352 Return SetStatus(GdipSetPixelOffsetMode(nativeGraphics, pixelOffsetMode))
353 End Function
354
355 '------------------------------------------------------------------------
356 ' Manipulate current world transform
357 '------------------------------------------------------------------------
358
[241]359 Function SetTransform(matrix As /*Const*/ *Matrix) As Gdiplus.Status
[33]360 Return SetStatus(GdipSetWorldTransform(nativeGraphics, matrix->nativeMatrix))
361 End Function
362
[241]363 Function ResetTransform() As Gdiplus.Status
[33]364 Return SetStatus(GdipResetWorldTransform(nativeGraphics))
365 End Function
366
[241]367 Function MultiplyTransform(matrix As /*Const*/ Matrix) As Gdiplus.Status
[33]368 Return SetStatus(GdipMultiplyWorldTransform(nativeGraphics, matrix->nativeMatrix, MatrixOrder.Prepend))
369 End Function
370
[241]371 Function MultiplyTransform(matrix As /*Const*/ Matrix, order As MatrixOrder) As Gdiplus.Status
[33]372 Return SetStatus(GdipMultiplyWorldTransform(nativeGraphics, matrix->nativeMatrix, order))
373 End Function
374
[241]375 Function TranslateTransform(dx As Single, dy As Single) As Gdiplus.Status
[33]376 Return SetStatus(GdipTranslateWorldTransform(nativeGraphics, dx, dy, MatrixOrder.Prepend))
377 End Function
378
[241]379 Function TranslateTransform(dx As Single, dy As Single, order As MatrixOrder) As Gdiplus.Status
[33]380 Return SetStatus(GdipTranslateWorldTransform(nativeGraphics, dx, dy, order))
381 End Function
382
[241]383 Function ScaleTransform(sx As Single, sy As Single) As Gdiplus.Status
[33]384 Return SetStatus(GdipScaleWorldTransform(nativeGraphics, sx, sy, MatrixOrder.Prepend))
385 End Function
386
[241]387 Function ScaleTransform(sx As Single, sy As Single, order As MatrixOrder) As Gdiplus.Status
[33]388 Return SetStatus(GdipScaleWorldTransform(nativeGraphics, sx, sy, order))
389 End Function
390
[241]391 Function RotateTransform(angle As Single) As Gdiplus.Status
[33]392 Return SetStatus(GdipRotateWorldTransform(nativeGraphics, angle, MatrixOrder.Prepend))
393 End Function
394
[241]395 Function RotateTransform(angle As Single, order As MatrixOrder) As Gdiplus.Status
[33]396 Return SetStatus(GdipRotateWorldTransform(nativeGraphics, angle, order))
397 End Function
398
[241]399 Const Function GetTransform(matrix As Matrix) As Gdiplus.Status
[33]400 Return SetStatus(GdipGetWorldTransform(nativeGraphics, matrix->nativeMatrix))
401 End Function
402
[241]403 Const Function TransformPoints(destSpace As CoordinateSpace, srcSpace As CoordinateSpace, pts As PointF, count As Long) As Gdiplus.Status
[33]404 Return SetStatus(GdipTransformPoints(nativeGraphics, destSpace, srcSpace, pts, count))
405 End Function
406
[241]407 Const Function TransformPoints(destSpace As CoordinateSpace, srcSpace As CoordinateSpace, pts As Point, count As Long) As Gdiplus.Status
[33]408 Return SetStatus(GdipTransformPointsI(nativeGraphics, destSpace, srcSpace, pts, count))
409 End Function
410
411 '------------------------------------------------------------------------
412 ' GetNearestColor (for <= 8bpp surfaces). Note: Alpha is ignored.
413 '------------------------------------------------------------------------
414
[241]415 Const Function GetNearestColor(color As Color) As Gdiplus.Status
[33]416 Dim argb = color->Value
417 Dim status = SetStatus(GdipGetNearestColor(nativeGraphics, argb))
418 color->Value = argb
419 Return status
420 End Function
421
[241]422 Function DrawLine(pen As /*Const*/ Pen, x1 As Single, y1 As Single, x2 As Single, y2 As Single) As Gdiplus.Status
[33]423 Return SetStatus(GdipDrawLine(nativeGraphics, pen->nativePen, x1, y1, x2, y2))
424 End Function
425
[241]426 Function DrawLine(pen As /*Const*/ Pen, pt1 As /*Const*/ PointF, pt2 As /*Const*/ PointF) As Gdiplus.Status
[33]427 Return DrawLine(pen, pt1.X, pt1.Y, pt2.X, pt2.Y)
428 End Function
429
[241]430 Function DrawLines(pen As /*Const*/ Pen, points As /*Const*/ *PointF, count As Long) As Gdiplus.Status
[33]431 Return SetStatus(GdipDrawLines(nativeGraphics, pen->nativePen, points, count))
432 End Function
433
[241]434 Function DrawLine(pen As /*Const*/ Pen, x1 As Long, y1 As Long, x2 As Long, y2 As Long) As Gdiplus.Status
[33]435 Return SetStatus(GdipDrawLineI(nativeGraphics, pen->nativePen, x1, y1, x2, y2))
436 End Function
437
[241]438 Function DrawLine(pen As /*Const*/ Pen, pt1 As /*Const*/ Point, pt2 As /*Const*/ Point) As Gdiplus.Status
[33]439 Return DrawLine(pen, pt1.X, pt1.Y, pt2.X, pt2.Y)
440 End Function
441
[241]442 Function DrawLines(pen As /*Const*/ Pen, points As /*Const*/ *Point, count As Long) As Gdiplus.Status
[33]443 Return SetStatus(GdipDrawLinesI(nativeGraphics, pen->nativePen, points, count))
444 End Function
445
[241]446 Function DrawArc(pen As /*Const*/ Pen, x As Single, y As Single, width As Single, height As Single, startAngle As Single, sweepAngle As Single) As Gdiplus.Status
[33]447 Return SetStatus(GdipDrawArc(nativeGraphics, pen->nativePen, x, y, width, height, startAngle, sweepAngle))
448 End Function
449
[241]450 Function DrawArc(pen As /*Const*/ Pen, rect As /*Const*/ RectangleF, startAngle As Single, sweepAngle As Single) As Gdiplus.Status
[33]451 Return DrawArc(pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)
452 End Function
453
[241]454 Function DrawArc(pen As /*Const*/ Pen, x As Long, y As Long, width As Long, height As Long, startAngle As Single, sweepAngle As Single) As Gdiplus.Status
[33]455 Return SetStatus(GdipDrawArcI(nativeGraphics, pen->nativePen, x, y, width, height, startAngle, sweepAngle))
456 End Function
457
[241]458 Function DrawArc(pen As /*Const*/ Pen, rect As /*Const*/ Rectangle, startAngle As Single, sweepAngle As Single) As Gdiplus.Status
[33]459 Return DrawArc(pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)
460 End Function
461
[241]462 Function DrawBezier(pen As /*Const*/ Pen, x1 As Single, y1 As Single, x2 As Single, y2 As Single, x3 As Single, y3 As Single, x4 As Single, y4 As Single) As Gdiplus.Status
[33]463 Return SetStatus(GdipDrawBezier(nativeGraphics, pen->nativePen, x1, y1,x2, y2, x3, y3, x4, y4))
464 End Function
465
[241]466 Function DrawBezier(pen As /*Const*/ Pen, pt1 As /*Const*/ PointF, pt2 As /*Const*/ PointF, pt3 As /*Const*/ PointF, pt4 As /*Const*/ PointF) As Gdiplus.Status
[33]467 Return DrawBezier(pen, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y)
468 End Function
469
[241]470 Function DrawBeziers(pen As /*Const*/ Pen, points As /*Const*/ *PointF, count As Long) As Gdiplus.Status
[33]471 Return SetStatus(GdipDrawBeziers(nativeGraphics, pen->nativePen, points, count))
472 End Function
473
[241]474 Function DrawBezier(pen As /*Const*/ Pen, x1 As Long, y1 As Long, x2 As Long, y2 As Long, x3 As Long, y3 As Long, x4 As Long, y4 As Long) As Gdiplus.Status
[33]475 Return SetStatus(GdipDrawBezierI(nativeGraphics, pen->nativePen, x1, y1, x2, y2, x3, y3, x4, y4))
476 End Function
477
[241]478 Function DrawBezier(pen As /*Const*/ Pen, pt1 As /*Const*/ Point, pt2 As /*Const*/ Point, pt3 As /*Const*/ Point, pt4 As /*Const*/ Point) As Gdiplus.Status
[33]479 Return DrawBezier(pen pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y)
480 End Function
481
[241]482 Function DrawBeziers(pen As /*Const*/ Pen, points As /*Const*/ *Point, count As Long) As Gdiplus.Status
[33]483 Return SetStatus(GdipDrawBeziersI(nativeGraphics, pen->nativePen, points, count))
484 End Function
485
[241]486 Function DrawRectangle(pen As /*Const*/ Pen, rect As /*Const*/ RectangleF) As Gdiplus.Status
[33]487 Return DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height)
488 End Function
489
[241]490 Function DrawRectangle(pen As /*Const*/ Pen, x As Single, y As Single, width As Single, height As Single) As Gdiplus.Status
[33]491 Return SetStatus(GdipDrawRectangle(nativeGraphics, pen->nativePen, x, y, width, height))
492 End Function
493
[241]494 Function DrawRectangles(pen As /*Const*/ Pen, rects As /*Const*/ *RectangleF, count As Long) As Gdiplus.Status
[33]495 Return SetStatus(GdipDrawRectangles(nativeGraphics, pen->nativePen, rects, count))
496 End Function
497
[241]498 Function DrawRectangle(pen As /*Const*/ Pen, rect As /*Const*/ Rectangle) As Gdiplus.Status
[33]499 Return DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height)
500 End Function
501
[241]502 Function DrawRectangle(pen As /*Const*/ Pen, x As Long, y As Long, width As Long, height As Long) As Gdiplus.Status
[33]503 Return SetStatus(GdipDrawRectangleI(nativeGraphics, pen->nativePen, x, y, width, height))
504 End Function
505
[241]506 Function DrawRectangles(pen As /*Const*/ Pen, rects As /*Const*/ *Rectangle, count As Long) As Gdiplus.Status
[33]507 Return SetStatus(GdipDrawRectanglesI(nativeGraphics, pen->nativePen, rects, count))
508 End Function
509
[241]510 Function DrawEllipse(pen As /*Const*/ Pen, rect As /*Const*/ RectangleF) As Gdiplus.Status
[33]511 Return DrawEllipse(pen, rect.X, rect.Y, rect.Width, rect.Height)
512 End Function
513
[241]514 Function DrawEllipse(pen As /*Const*/ Pen, x As Single, y As Single, width As Single, height As Single) As Gdiplus.Status
[33]515 Return SetStatus(GdipDrawEllipse(nativeGraphics, pen->nativePen, x, y, width, height))
516 End Function
517
[241]518 Function DrawEllipse(pen As /*Const*/ Pen, rect As /*Const*/ Rectangle) As Gdiplus.Status
[33]519 Return DrawEllipse(pen, rect.X, rect.Y, rect.Width, rect.Height)
520 End Function
521
[241]522 Function DrawEllipse(pen As /*Const*/ Pen, x As Long, y As Long, width As Long, height As Long) As Gdiplus.Status
[33]523 Return SetStatus(GdipDrawEllipseI(nativeGraphics, pen->nativePen, x, y, width, height))
524 End Function
525
[241]526 Function DrawPie(pen As /*Const*/ Pen, rect As /*Const*/ RectangleF, startAngle As Single, sweepAngle As Single) As Gdiplus.Status
[33]527 Return DrawPie(pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)
528 End Function
529
[241]530 Function DrawPie(pen As /*Const*/ Pen, x As Single, y As Single, width As Single, height As Single, startAngle As Single, sweepAngle As Single) As Gdiplus.Status
[33]531 Return SetStatus(GdipDrawPie(nativeGraphics, pen->nativePen, x, y, width, height, startAngle, sweepAngle))
532 End Function
533
[241]534 Function DrawPie(pen As /*Const*/ Pen, rect As /*Const*/ Rectangle, startAngle As Single, sweepAngle As Single) As Gdiplus.Status
[33]535 Return DrawPie(pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)
536 End Function
537
[241]538 Function DrawPie(pen As /*Const*/ Pen, x As Long, y As Long, width As Long, height As Long, startAngle As Single, sweepAngle As Single) As Gdiplus.Status
[33]539 Return SetStatus(GdipDrawPieI(nativeGraphics, pen->nativePen, x, y, width, height, startAngle, sweepAngle))
540 End Function
541
[241]542 Function DrawPolygon(pen As /*Const*/ Pen, points As /*Const*/ *PointF, count As Long) As Gdiplus.Status
[33]543 Return SetStatus(GdipDrawPolygon(nativeGraphics, pen->nativePen, points, count))
544 End Function
545
[241]546 Function DrawPolygon(pen As /*Const*/ Pen, points As /*Const*/ *Point, count As Long) As Gdiplus.Status
[33]547 Return SetStatus(GdipDrawPolygonI(nativeGraphics, pen->nativePen, points, count))
548 End Function
549
[241]550 Function DrawPath(pen As /*Const*/ Pen, path As /*Const*/ GraphicsPath) As Gdiplus.Status
[33]551 Return SetStatus(GdipDrawPath(nativeGraphics, pen->nativePen, path->nativePath))
552' Return SetStatus(GdipDrawPath(nativeGraphics, pen ? pen->nativePen : NULL, path ? path->nativePath : NULL))
553 End Function
554
[241]555 Function DrawCurve(pen As /*Const*/ Pen, points As /*Const*/ *PointF, count As Long) As Gdiplus.Status
[33]556 Return SetStatus(GdipDrawCurve(nativeGraphics, pen->nativePen, points, count))
557 End Function
558
[241]559 Function DrawCurve(pen As /*Const*/ Pen, points As /*Const*/ *PointF, count As Long, tension As Single) As Gdiplus.Status
[33]560 Return SetStatus(GdipDrawCurve2(nativeGraphics, pen->nativePen, points,count, tension))
561 End Function
562
[241]563 Function DrawCurve(pen As /*Const*/ Pen, points As /*Const*/ *PointF, count As Long, offset As Long, numberOfSegments As Long) As Gdiplus.Status
[33]564 Return SetStatus(GdipDrawCurve3(nativeGraphics, pen->nativePen, points, count, offset,numberOfSegments, 0.5))
565 End Function
566
[241]567 Function DrawCurve(pen As /*Const*/ Pen, points As /*Const*/ *PointF, count As Long, offset As Long, numberOfSegments As Long, tension As Single) As Gdiplus.Status
[33]568 Return SetStatus(GdipDrawCurve3(nativeGraphics, pen->nativePen, points, count, offset,numberOfSegments, tension))
569 End Function
570
[241]571 Function DrawCurve(pen As /*Const*/ Pen, points As /*Const*/ *Point, count As Long) As Gdiplus.Status
[33]572 Return SetStatus(GdipDrawCurveI(nativeGraphics, pen->nativePen, points, count))
573 End Function
574
[241]575 Function DrawCurve(pen As /*Const*/ Pen, points As /*Const*/ *Point, count As Long, tension As Single) As Gdiplus.Status
[33]576 Return SetStatus(GdipDrawCurve2I(nativeGraphics, pen->nativePen, points, count, tension))
577 End Function
578
[241]579 Function DrawCurve(pen As /*Const*/ Pen, points As /*Const*/ *Point, count As Long, offset As Long, numberOfSegments As Long) As Gdiplus.Status
[33]580 Return SetStatus(GdipDrawCurve3I(nativeGraphics, pen->nativePen, points, count, offset, numberOfSegments, 0.5))
581 End Function
582
[241]583 Function DrawCurve(pen As /*Const*/ Pen, points As /*Const*/ *Point, count As Long, offset As Long, numberOfSegments As Long, tension As Single) As Gdiplus.Status
[33]584 Return SetStatus(GdipDrawCurve3I(nativeGraphics, pen->nativePen, points, count, offset, numberOfSegments, tension))
585 End Function
586
[241]587 Function DrawClosedCurve(pen As /*Const*/ Pen, points As /*Const*/ *PointF, count As Long) As Gdiplus.Status
[33]588 Return SetStatus(GdipDrawClosedCurve(nativeGraphics, pen->nativePen, points, count))
589 End Function
590
[241]591 Function DrawClosedCurve(pen As /*Const*/ Pen, points As /*Const*/ *PointF, count As Long, tension As Single) As Gdiplus.Status
[33]592 Return SetStatus(GdipDrawClosedCurve2(nativeGraphics, pen->nativePen, points, count, tension))
593 End Function
594
[241]595 Function DrawClosedCurve(pen As /*Const*/ Pen, points As /*Const*/ *Point, count As Long) As Gdiplus.Status
[33]596 Return SetStatus(GdipDrawClosedCurveI(nativeGraphics, pen->nativePen, points, count))
597 End Function
598
[241]599 Function DrawClosedCurve(pen As /*Const*/ Pen, points As /*Const*/ *Point, count As Long, tension As Single) As Gdiplus.Status
[33]600 Return SetStatus(GdipDrawClosedCurve2I(nativeGraphics, pen->nativePen, points, count, tension))
601 End Function
602
[241]603 Function Clear(color As /*Const*/ Color) As Gdiplus.Status
[33]604 Return SetStatus(GdipGraphicsClear(nativeGraphics, color.Value))
605 End Function
606
[241]607 Function FillRectangle(brush As /*Const*/ Brush, rect As /*Const*/ RectangleF) As Gdiplus.Status
[33]608 Return FillRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height)
609 End Function
610
[241]611 Function FillRectangle(brush As /*Const*/ Brush, x As Single, y As Single, width As Single, height As Single) As Gdiplus.Status
[33]612 Return SetStatus(GdipFillRectangle(nativeGraphics, brush->nativeBrush, x, y, width, height))
613 End Function
614
[241]615 Function FillRectangles(brush As /*Const*/ Brush, rects As /*Const*/ *RectangleF, count As Long) As Gdiplus.Status
[33]616 Return SetStatus(GdipFillRectangles(nativeGraphics,brush->nativeBrush,rects, count))
617 End Function
618
[241]619 Function FillRectangle(brush As /*Const*/ Brush, rect As /*Const*/ Rectangle) As Gdiplus.Status
[33]620 Return FillRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height)
621 End Function
622
[241]623 Function FillRectangle(brush As /*Const*/ Brush, x As Long, y As Long, width As Long, height As Long) As Gdiplus.Status
[33]624 Return SetStatus(GdipFillRectangleI(nativeGraphics, brush->nativeBrush, x, y, width, height))
625 End Function
626
[241]627 Function FillRectangles(brush As /*Const*/ Brush, rects As /*Const*/ *Rectangle, count As Long) As Gdiplus.Status
[33]628 Return SetStatus(GdipFillRectanglesI(nativeGraphics, brush->nativeBrush, rects, count))
629 End Function
630
[241]631 Function FillPolygon(brush As /*Const*/ Brush, points As /*Const*/ *PointF, count As Long) As Gdiplus.Status
[33]632 Return FillPolygon(brush, points, count, FillModeAlternate)
633 End Function
634
[241]635 Function FillPolygon(brush As /*Const*/ Brush, points As /*Const*/ *PointF, count As Long, fillMode As FillMode) As Gdiplus.Status
[33]636 Return SetStatus(GdipFillPolygon(nativeGraphics, brush->nativeBrush, points, count, fillMode))
637 End Function
638
[241]639 Function FillPolygon(brush As /*Const*/ Brush, points As /*Const*/ *Point, count As Long) As Gdiplus.Status
[33]640 Return FillPolygon(brush, points, count, FillModeAlternate)
641 End Function
642
[241]643 Function FillPolygon(brush As /*Const*/ Brush, points As /*Const*/ *Point, count As Long, fillMode As FillMode) As Gdiplus.Status
[33]644 Return SetStatus(GdipFillPolygonI(nativeGraphics, brush->nativeBrush, points, count, fillMode))
645 End Function
646
[241]647 Function FillEllipse(brush As /*Const*/ Brush, rect As /*Const*/ RectangleF) As Gdiplus.Status
[33]648 Return FillEllipse(brush, rect.X, rect.Y, rect.Width, rect.Height)
649 End Function
650
[241]651 Function FillEllipse(brush As /*Const*/ Brush, x As Single, y As Single, width As Single, height As Single) As Gdiplus.Status
[33]652 Return SetStatus(GdipFillEllipse(nativeGraphics, brush->nativeBrush, x, y, width, height))
653 End Function
654
[241]655 Function FillEllipse(brush As /*Const*/ Brush, rect As /*Const*/ Rectangle) As Gdiplus.Status
[33]656 Return FillEllipse(brush, rect.X, rect.Y, rect.Width, rect.Height)
657 End Function
658
[241]659 Function FillEllipse(brush As /*Const*/ Brush, x As Long, y As Long, width As Long, height As Long) As Gdiplus.Status
[33]660 Return SetStatus(GdipFillEllipseI(nativeGraphics, brush->nativeBrush, x, y, width, height))
661 End Function
662
[241]663 Function FillPie(brush As /*Const*/ Brush, rect As /*Const*/ RectangleF, startAngle As Single, sweepAngle As Single) As Gdiplus.Status
[33]664 Return FillPie(brush, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)
665 End Function
666
[241]667 Function FillPie(brush As /*Const*/ Brush, x As Single, y As Single, width As Single, height As Single, startAngle As Single, sweepAngle As Single) As Gdiplus.Status
[33]668 Return SetStatus(GdipFillPie(nativeGraphics, brush->nativeBrush, x, y, width, height, startAngle, sweepAngle))
669 End Function
670
[241]671 Function FillPie(brush As /*Const*/ Brush, rect As /*Const*/ Rectangle, startAngle As Single, sweepAngle As Single) As Gdiplus.Status
[33]672 Return FillPie(brush, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)
673 End Function
674
[241]675 Function FillPie(brush As /*Const*/ Brush, x As Long, y As Long, width As Long, height As Long, startAngle As Single, sweepAngle As Single) As Gdiplus.Status
[33]676 Return SetStatus(GdipFillPieI(nativeGraphics, brush->nativeBrush, x, y, width, height, startAngle, sweepAngle))
677 End Function
678
[241]679 Function FillPath(brush As /*Const*/ Brush, path As /*Const*/ GraphicsPath) As Gdiplus.Status
[33]680 Return SetStatus(GdipFillPath(nativeGraphics, brush->nativeBrush, path->nativePath))
681 End Function
682
[241]683 Function FillClosedCurve(brush As /*Const*/ Brush, points As /*Const*/ *PointF, count As Long) As Gdiplus.Status
[33]684 Return SetStatus(GdipFillClosedCurve(nativeGraphics, brush->nativeBrush, points, count))
685 End Function
686
[241]687 Function FillClosedCurve(brush As /*Const*/ Brush, points As /*Const*/ *PointF, count As Long, fillMode As FillMode) As Gdiplus.Status
[33]688 Return SetStatus(GdipFillClosedCurve2(nativeGraphics, brush->nativeBrush, points, count, 0.5, fillMode))
689 End Function
690
[241]691 Function FillClosedCurve(brush As /*Const*/ Brush, points As /*Const*/ *PointF, count As Long, fillMode As FillMode, tension As Single) As Gdiplus.Status
[33]692 Return SetStatus(GdipFillClosedCurve2(nativeGraphics, brush->nativeBrush, points, count, tension, fillMode))
693 End Function
694
[241]695 Function FillClosedCurve(brush As /*Const*/ Brush, points As /*Const*/ *Point, count As Long) As Gdiplus.Status
[33]696 Return SetStatus(GdipFillClosedCurveI(nativeGraphics, brush->nativeBrush, points, count))
697 End Function
698
[241]699 Function FillClosedCurve(brush As /*Const*/ Brush, points As /*Const*/ *Point, count As Long, fillMode As FillMode) As Gdiplus.Status
[33]700 Return SetStatus(GdipFillClosedCurve2I(nativeGraphics, brush->nativeBrush, points, count, 0.5, fillMode))
701 End Function
702
[241]703 Function FillClosedCurve(brush As /*Const*/ Brush, points As /*Const*/ *Point, count As Long, fillMode As FillMode, tension As Single) As Gdiplus.Status
[33]704 Return SetStatus(GdipFillClosedCurve2I(nativeGraphics, brush->nativeBrush, points, count, tension, fillMode))
705 End Function
706
[241]707 Function FillRegion(brush As /*Const*/ Brush, region As /*Const*/ Region) As Gdiplus.Status
[33]708 Return SetStatus(GdipFillRegion(nativeGraphics, brush->nativeBrush, region->nativeRegion))
709 End Function
710
[241]711 Function DrawString(str As PCWSTR, length As Long, font As /*Const*/ Font, layoutRect As /*Const*/ RectangleF) As Gdiplus.Status
[33]712 Dim nativeFont As *GpFont
713 If VarPtr(font) <> 0 Then
714 nativeFont = font.nativeFormat
715 Else
716 nativeFont = 0
717 End If
718 Return SetStatus(GdipDrawString( nativeGraphics, str, length, nativeFont, layoutRect, 0, 0))
719 End Function
720
[212]721 Function DrawString(str As PCWSTR, length As Long, font As /*Const*/ Font, layoutRect As /*Const*/ Rectangle,
[241]722 stringFormat As /*Const*/ StringFormat, brush As /*Const*/ Brush) As Gdiplus.Status
[33]723
724 Dim nativeFont As *GpFont
725 If VarPtr(font) <> 0 Then
726 nativeFont = font.nativeFormat
727 Else
728 nativeFont = 0
729 End If
730 Dim nativeFormat As *GpStringFormat
731 If VarPtr(layoutRect) <> 0 Then
732 nativeFormat = layoutRect.nativeFormat
733 Else
734 nativeFormat = 0
735 End If
[104]736 Return SetStatus(GdipDrawString(nativeGraphics, str, length, nativeFont, layoutRect, nativeFormat, 0))
[33]737 End Function
738
[212]739 Function DrawString(str As PCWSTR, length As Long, font As /*Const*/ Font, layoutRect As /*Const*/ RectangleF,
[241]740 stringFormat As /*Const*/ StringFormat, brush As /*Const*/ Brush) As Gdiplus.Status
[33]741
742 Dim nativeFont As *GpFont
743 If VarPtr(font) <> 0 Then
744 nativeFont = font.nativeFormat
745 Else
746 nativeFont = 0
747 End If
748 Dim nativeFormat As *GpStringFormat
749 If VarPtr(stringFormat) <> 0 Then
750 nativeFormat = stringFormat.nativeFormat
751 Else
752 nativeFormat = 0
753 End If
754 Dim nativeBrush As *GpBrush
755 If VarPtr(brush) <> 0 Then
756 nativeBrush = brush.nativeFormat
757 Else
758 nativeBrush = 0
759 End If
760 Return SetStatus(GdipDrawString(nativeGraphics, str, length, nativeFont, layoutRect, nativeFormat, nativeBrush))
761 End Function
762
[241]763 Function DrawString(str As PCWSTR, length As Long, font As /*Const*/ Font, origin As /*Const*/ Point) As Gdiplus.Status
[33]764 Dim rect As RectangleF(origin.X, origin.Y, 0.0, 0.0)
765 Dim nativeFont As *GpFont
766 If VarPtr(font) <> 0 Then
767 nativeFont = font.nativeFormat
768 Else
769 nativeFont = 0
770 End If
771 Return SetStatus(GdipDrawString(nativeGraphics, str, length, nativeFont, rect, 0, 0))
772 End Function
773
[212]774 Function DrawString(str As PCWSTR, length As Long, font As /*Const*/ Font, origin As /*Const*/ PointF,
[241]775 brush As /*Const*/ Brush) As Gdiplus.Status
[33]776
777 Dim rect As RectangleF(origin.X, origin.Y, 0.0, 0.0)
778 Dim nativeFont As *GpFont
779 If VarPtr(font) <> 0 Then
780 nativeFont = font.nativeFormat
781 Else
782 nativeFont = 0
783 End If
784 Dim nativeBrush As *GpBrush
785 If VarPtr(brush) <> 0 Then
786 nativeBrush = brush.nativeFormat
787 Else
788 nativeBrush = 0
789 End If
790 Return SetStatus(GdipDrawString(nativeGraphics, str, length, nativeFont, rect, 0, nativeBrush))
791 End Function
792
[241]793 Function DrawString(str As PCWSTR, length As Long, font As /*Const*/ Font, origin As /*Const*/ PointF) As Gdiplus.Status
[33]794 Dim rect As RectangleF(origin.X, origin.Y, 0.0, 0.0)
795 Dim nativeFont As *GpFont
796 If VarPtr(font) <> 0 Then
797 nativeFont = font.nativeFormat
798 Else
799 nativeFont = 0
800 End If
801 Return SetStatus(GdipDrawString(nativeGraphics, str, length, nativeFont, rect, 0, 0))
802 End Function
803
[212]804 Function DrawString(str As PCWSTR, length As Long, font As /*Const*/ Font, origin As /*Const*/ PointF,
[241]805 stringFormat As /*Const*/ StringFormat) As Gdiplus.Status
[33]806
807 Dim rect As RectangleF(origin.X, origin.Y, 0.0, 0.0)
808 Dim nativeFont As *GpFont
809 If VarPtr(font) <> 0 Then
810 nativeFont = font.nativeFormat
811 Else
812 nativeFont = 0
813 End If
814 Dim nativeFormat As *GpStringFormat
815 If VarPtr(stringFormat) <> 0 Then
816 nativeFormat = stringFormat.nativeFormat
817 Else
818 nativeFormat = 0
819 End If
820 Return SetStatus(GdipDrawString(nativeGraphics, str, length, nativeFont, rect, nativeFormat, 0))
821 End Function
822
[212]823 Function DrawString(str As PCWSTR, length As Long, font As /*Const*/ Font, origin As /*Const*/ PointF,
[241]824 stringFormat As /*Const*/ StringFormat, brush As /*Const*/ Brush) As Gdiplus.Status
[33]825
826 Dim rect As RectangleF(origin.X, origin.Y, 0.0, 0.0)
827 Dim nativeFont As *GpFont
828 If VarPtr(font) <> 0 Then
829 nativeFont = font.nativeFormat
830 Else
831 nativeFont = 0
832 End If
833 Dim nativeFormat As *GpStringFormat
834 If VarPtr(stringFormat) <> 0 Then
835 nativeFormat = stringFormat.nativeFormat
836 Else
837 nativeFormat = 0
838 End If
839 If VarPtr(brush) <> 0 Then
840 nativeBrush = brush.nativeFormat
841 Else
842 nativeBrush = 0
843 End If
844 Return SetStatus(GdipDrawString( nativeGraphics, str, length, nativeFont, rect, nativeFormat, nativeBrush))
845 End Function
846
[212]847 Const Function MeasureString(str As PCWSTR, length As Long, font As /*Const*/ Font, layoutRect As /*Const*/ RectangleF,
[241]848 stringFormat As /*Const*/ StringFormat, boundingBox As RectangleF) As Gdiplus.Status
[33]849
850 Return MeasureString(str, length, font, layoutRect, stringFormat, boundingBox, ByVal 0, ByVal 0)
851 End Function
852
[212]853 Const Function MeasureString(str As PCWSTR, length As Long, font As /*Const*/ Font, layoutRect As /*Const*/ RectangleF,
854 stringFormat As /*Const*/ StringFormat, boundingBox As RectangleF,
[241]855 codepointsFitted As Long) As Gdiplus.Status
[33]856
857 Return MeasureString(str, length, font, layoutRect, stringFormat, boundingBox, codepointsFitted, ByVal 0)
858 End Function
859
[212]860 Const Function MeasureString(str As PCWSTR, length As Long, font As /*Const*/ Font, layoutRect As /*Const*/ RectangleF,
861 stringFormat As /*Const*/ StringFormat, boundingBox As RectangleF,
[241]862 codepointsFitted As Long, linesFilled As Long) As Gdiplus.Status
[33]863
864 Dim nativeFont As *GpFont
865 If VarPtr(font) <> 0 Then
866 nativeFont = font.nativeFormat
867 Else
868 nativeFont = 0
869 End If
870 Dim nativeFormat As *GpStringFormat
871 If VarPtr(stringFormat) <> 0 Then
872 nativeFormat = stringFormat.nativeFormat
873 Else
874 nativeFormat = 0
875 End If
876 Return SetStatus(GdipMeasureString(nativeGraphics, str, length, nativeFont, layoutRect, nativeFormat,
877 boundingBox, codepointsFitted, linesFilled))
878 End Function
879
[212]880 Const Function MeasureString(str As PCWSTR, length As Long, font As /*Const*/ Font,
881 layoutRectSize As /*Const*/ SizeF, stringFormat As /*Const*/ StringFormat,
[241]882 size As SizeF) As Gdiplus.Status
[33]883
[104]884 Return MeasureString(str, length, font, layoutRectSize, stringFormat, size, ByVal 0, ByVal 0)
[33]885 End Function
886
[212]887 Const Function MeasureString(str As PCWSTR, length As Long, font As /*Const*/ Font,
888 layoutRectSize As /*Const*/ SizeF, stringFormat As /*Const*/ StringFormat,
[241]889 size As SizeF, codepointsFitted As Long) As Gdiplus.Status
[33]890
[104]891 Return MeasureString(str, length, font, layoutRectSize, stringFormat, size, codepointsFitted, ByVal 0)
[33]892 End Function
893
[212]894 Const Function MeasureString(str As PCWSTR, length As Long, font As /*Const*/ Font,
895 layoutRectSize As /*Const*/ SizeF, stringFormat As /*Const*/ StringFormat,
[241]896 size As SizeF, codepointsFitted As Long, linesFilled As Long) As Gdiplus.Status
[33]897
898 Dim layoutRect As RectangleF(0, 0, layoutRectSize.Width, layoutRectSize.Height)
899 Dim boundingBox As RectangleF, pBoundingBox As *RectangleF
900 If VarPtr(size) <> 0 Then
901 pBoundingBox = VarPtr(boundingBox)
902 Else
903 pBoundingBox = 0
904 End If
905
906 Dim nativeFont As *GpFont
907 If VarPtr(font) <> 0 Then
908 nativeFont = font.nativeFormat
909 Else
910 nativeFont = 0
911 End If
912 Dim nativeFormat As *GpStringFormat
913 If VarPtr(stringFormat) <> 0 Then
914 nativeFormat = stringFormat.nativeFormat
915 Else
916 nativeFormat = 0
917 End If
918 Dim status = SetStatus(GdipMeasureString(nativeGraphics, str, length,
919 nativeFont, layoutRect, nativeFormat, pBoundingBox, codepointsFitted, linesFilled))
920
[241]921 If VarPtr(size) <> 0 And status = Gdiplus.Status.Ok Then
[33]922 size.Width = boundingBox.Width
923 size.Height = boundingBox.Height
924 End Function
925
926 Return status
927 End Function
928
[212]929 Const Function MeasureString(str As PCWSTR, length As Long, font As /*Const*/ Font,
930 origin As /*Const*/ PointF, stringFormat As /*Const*/ StringFormat,
[241]931 boundingBox As RectangleF) As Gdiplus.Status
[33]932
933 Dim rect As RectangleF(origin.X, origin.Y, 0.0f, 0.0f)
934 Dim nativeFont As *GpFont
935 If VarPtr(font) <> 0 Then
936 nativeFont = font.nativeFormat
937 Else
938 nativeFont = 0
939 End If
940 Dim nativeFormat As *GpStringFormat
941 If VarPtr(stringFormat) <> 0 Then
942 nativeFormat = stringFormat.nativeFormat
943 Else
944 nativeFormat = 0
945 End If
946
947 Return SetStatus(GdipMeasureString(nativeGraphics, str, length, nativeFont, rect, nativeFormat, boundingBox, 0, 0))
948 End Function
949
[212]950 Const Function MeasureString(str As PCWSTR, length As Long, font As /*Const*/ Font,
[241]951 layoutRect As /*Const*/ RectangleF, boundingBox As RectangleF) As Gdiplus.Status
[33]952
953 Dim nativeFont As *GpFont
954 If VarPtr(font) <> 0 Then
955 nativeFont = font.nativeFormat
956 Else
957 nativeFont = 0
958 End If
959
960 Return SetStatus(GdipMeasureString(nativeGraphics, str, length, nativeFont, layoutRect, 0, boundingBox, 0, 0))
961 End Function
962
[212]963 Const Function MeasureString(str As PCWSTR, length As Long, font As /*Const*/ Font,
[241]964 origin As /*Const*/ PointF, boundingBox As RectangleF) As Gdiplus.Status
[33]965 Dim rect As RectangleF(origin.X, origin.Y, 0.0, 0.0)
966
967 Dim nativeFont As *GpFont
968 If VarPtr(font) <> 0 Then
969 nativeFont = font.nativeFormat
970 Else
971 nativeFont = 0
972 End If
973 Return SetStatus(GdipMeasureString(nativeGraphics, str, length, nativeFont, rect, 0, boundingBox, 0, 0))
974 End Function
975
[212]976 Const Function MeasureCharacterRanges(str As PCWSTR, length As Long, font As /*Const*/ Font,
977 layoutRect As /*Const*/ RectangleF, stringFormat As /*Const*/ StringFormat,
[241]978 regionCount As Long, regions As *Region) As Gdiplus.Status
[33]979 If regions = 0 Or regionCount <= 0 Then
980 Return InvalidParameter
981 End If
982
983 Dim nativeRegions = _System_malloc(regionCount * SizeOf (GpRegion*)) As **GpRegion
984
985 If nativeRegions = 0 Then
986 Return OutOfMemory
987 End If
988
989 Dim i As Long
990 For i = 0 To regionCount
991 nativeRegions[i] = regions[i].nativeRegion
992 Next
993
994 Dim nativeFont As *GpFont
995 If VarPtr(font) <> 0 Then
996 nativeFont = font.nativeFormat
997 Else
998 nativeFont = 0
999 End If
1000 Dim nativeFormat As *GpStringFormat
1001 If VarPtr(stringFormat) <> 0 Then
1002 nativeFormat = stringFormat.nativeFormat
1003 Else
1004 nativeFormat = 0
1005 End If
1006
1007 Dim status = SetStatus(GdipMeasureCharacterRanges(nativeGraphics,
1008 str, length, nativeFont, layoutRect, nativeFormat,regionCount, nativeRegions))
1009 _System_free(nativeRegions)
1010 Return status
1011 End Function
1012
[212]1013 Function DrawDriverString(text As /*Const*/ Word, length As Long, font As /*Const*/ Font,
[241]1014 brush As /*Const*/ Brush, positions As /*Const*/ *PointF, flags As Long) As Gdiplus.Status
[33]1015
1016 Return DrawDriverString(text, length, font, brush, positions, flags, ByVal 0)
1017 End Function
1018
[212]1019 Function DrawDriverString(text As /*Const*/ Word, length As Long, font As /*Const*/ Font,
[241]1020 brush As /*Const*/ Brush, positions As /*Const*/ *PointF, flags As Long, matrix As /*Const*/ Matrix) As Gdiplus.Status
[33]1021
1022 Dim nativeFont As *GpFont
1023 If VarPtr(font) <> 0 Then
1024 nativeFont = font.nativeFormat
1025 Else
1026 nativeFont = 0
1027 End If
1028 Dim nativeBrush As *GpBrush
1029 If VarPtr(brush) <> 0 Then
1030 nativeBrush = brush.nativeBrush
1031 Else
1032 nativeBrush = 0
1033 End If
1034 Dim nativeMatrix As *GpMatrix
1035 If VarPtr(matrix) <> 0 Then
1036 nativeMatrix = matrix.nativeMatrix
1037 Else
1038 nativeMatrix = 0
1039 End If
1040 Return SetStatus(GdipDrawDriverString(nativeGraphics, text, length, nativeFont, nativeBrush, positions, flags, nativeMatrix))
1041 End Function
1042
[212]1043 Const Function MeasureDriverString(text As /*Const*/ Word, length As Long, font As /*Const*/ Font,
[241]1044 positions As /*Const*/ *PointF, flags As Long, matrix As /*Const*/ Matrix, boundingBox As RectangleF) As Gdiplus.Status
[33]1045
1046 Dim nativeFont As *GpFont
1047 If VarPtr(font) <> 0 Then
1048 nativeFont = font.nativeFormat
1049 Else
1050 nativeFont = 0
1051 End If
1052 Dim nativeMatrix As *GpMatrix
1053 If VarPtr(matrix) <> 0 Then
1054 nativeMatrix = matrix.nativeMatrix
1055 Else
1056 nativeMatrix = 0
1057 End If
1058 Return SetStatus(GdipMeasureDriverString(nativeGraphics, text, length, nativeFont, positions, flags, nativeMatrix, boundingBox))
1059 End Function
1060
1061 ' Draw a cached bitmap on this graphics destination offset by
1062 ' x, y. Note this will fail with WrongState if the CachedBitmap
1063 ' native format differs from this Graphics.
1064
[241]1065 Function DrawCachedBitmap(cb As CachedBitmap, x As Long, y As Long) As Gdiplus.Status
[33]1066 Return SetStatus(GdipDrawCachedBitmap(nativeGraphics, cb->nativeCachedBitmap, x, y))
1067 End Function
1068
[241]1069 Function DrawImage(image As Image, point As /*Const*/ PointF) As Gdiplus.Status
[33]1070 Return DrawImage(image, point.X, point.Y)
1071 End Function
1072
[241]1073 Function DrawImage(image As Image, x As Single, y As Single) As Gdiplus.Status
[33]1074 Dim nativeImage As *GpImage
1075 If VarPtr(image) <> 0 Then
[104]1076 nativeImage = image.NativeImage
[33]1077 Else
1078 nativeImage = 0
1079 End If
1080 Return SetStatus(GdipDrawImage(nativeGraphics, nativeImage, x, y))
1081 End Function
1082
[241]1083 Function DrawImage(image As Image, rect As /*Const*/ RectangleF) As Gdiplus.Status
[33]1084 Return DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height)
1085 End Function
1086
[241]1087 Function DrawImage(image As Image, x As Single, y As Single, width As Single, height As Single) As Gdiplus.Status
[33]1088 Dim nativeImage As *GpImage
1089 If VarPtr(image) <> 0 Then
[104]1090 nativeImage = image.NativeImage
[33]1091 Else
1092 nativeImage = 0
1093 End If
1094 Return SetStatus(GdipDrawImageRect(nativeGraphics, nativeImage, x, y, width, height))
1095 End Function
1096
[241]1097 Function DrawImage(image As Image, point As /*Const*/ Point) As Gdiplus.Status
1098 Return DrawImage(image, point.X, point.Y) As Gdiplus.Status
[33]1099 End Function
1100
[241]1101 Function DrawImage(image As Image, x As Long, y As Long) As Gdiplus.Status
[33]1102 Dim nativeImage As *GpImage
1103 If VarPtr(image) <> 0 Then
[104]1104 nativeImage = image.NativeImage
[33]1105 Else
1106 nativeImage = 0
1107 End If
1108 Return SetStatus(GdipDrawImageI(nativeGraphics, nativeImage, x, y))
1109 End Function
1110
[241]1111 Function DrawImage(image As Image, rect As /*Const*/ Rectangle) As Gdiplus.Status
[33]1112 Return DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height)
1113 End Function
1114
[241]1115 Function DrawImage(image As Image, x As Long, y As Long, width As Long, height As Long) As Gdiplus.Status
[33]1116 Dim nativeImage As *GpImage
1117 If VarPtr(image) <> 0 Then
[104]1118 nativeImage = image.NativeImage
[33]1119 Else
1120 nativeImage = 0
1121 End If
1122 Return SetStatus(GdipDrawImageRectI(nativeGraphics, nativeImage, x, y, width, height))
1123 End Function
1124
1125 ' Affine Draw Image
1126 ' destPoints.length = 3: rect => parallelogram
1127 ' destPoints[0] <=> top-left corner of the source rectangle
1128 ' destPoints[1] <=> top-right corner
1129 ' destPoints[2] <=> bottom-left corner
1130 ' destPoints.length = 4: rect => quad
1131 ' destPoints[3] <=> bottom-right corner
1132
[241]1133 Function DrawImage(image As Image, destPoints As /*Const*/ PointF, count As Long) As Gdiplus.Status
[33]1134 If count <> 3 And count <> 4 Then
1135 Return SetStatus(InvalidParameter)
1136 End If
1137
1138 Dim nativeImage As *GpImage
1139 If VarPtr(image) <> 0 Then
[104]1140 nativeImage = image.NativeImage
[33]1141 Else
1142 nativeImage = 0
1143 End If
1144 Return SetStatus(GdipDrawImagePoints(nativeGraphics, nativeImage, destPoints, count))
1145 End Function
1146
[241]1147 Function DrawImage(image As Image, destPoints As /*Const*/ Point, count As Long) As Gdiplus.Status
[33]1148 If count <> 3 And count <> 4 Then
1149 Return SetStatus(InvalidParameter)
1150 End If
1151
1152 Dim nativeImage As *GpImage
1153 If VarPtr(image) <> 0 Then
[104]1154 nativeImage = image.NativeImage
[33]1155 Else
1156 nativeImage = 0
1157 End If
1158 Return SetStatus(GdipDrawImagePointsI(nativeGraphics, nativeImage, destPoints, count))
1159 End Function
1160
[212]1161 Function DrawImage(image As Image, x As Single, y As Single,
[241]1162 srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit) As Gdiplus.Status
[33]1163
1164 Dim nativeImage As *GpImage
1165 If VarPtr(image) <> 0 Then
[104]1166 nativeImage = image.NativeImage
[33]1167 Else
1168 nativeImage = 0
1169 End If
1170 Return SetStatus(GdipDrawImagePointRect(nativeGraphics, nativeImage, x, y, srcx, srcy, srcwidth, srcheight, srcUnit))
1171 End Function
1172
[212]1173 Function DrawImage(image As Image, destRect As /*Const*/ RectangleF,
[241]1174 srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit) As Gdiplus.Status
[33]1175
1176 Return DrawImage(image, destRect, srcx, srcy, srcwidth, srcheight, srcUnit, 0, 0, 0)
1177 End Function
1178
[212]1179 Function DrawImage(image As Image, destRect As /*Const*/ RectangleF,
[33]1180 srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit,
[241]1181 imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
[33]1182
1183 Return DrawImage(image, destRect, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, 0, 0)
1184 End Function
1185
[212]1186 Function DrawImage(image As Image, destRect As /*Const*/ RectangleF,
[33]1187 srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit,
[212]1188 imageAttributes As /*Const*/ ImageAttributes,
[241]1189 callback As DrawImageAbort) As Gdiplus.Status
[33]1190
1191 Return DrawImage(image, destRect, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, callback, 0)
1192 End Function
1193
[212]1194 Function DrawImage(image As Image, destRect As /*Const*/ RectangleF,
[33]1195 srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit,
[241]1196 imageAttributes As /*Const*/ ImageAttributes, callback As DrawImageAbort, callbackData As VoidPtr) As Gdiplus.Status
[33]1197
1198 Dim nativeImage As *GpImage
1199 If VarPtr(image) <> 0 Then
[104]1200 nativeImage = image.NativeImage
[33]1201 Else
1202 nativeImage = 0
1203 End If
1204
1205 Return SetStatus(GdipDrawImageRectRect(nativeGraphics, nativeImageAttr,
1206 destRect.X, destRect.Y, destRect.Width, destRect.Height, srcx, srcy, srcwidth, srcheight,
[241]1207 srcUnit, ImageAttributes.Native(imageAttributes), callback, callbackData))
[33]1208 End Function
1209
[212]1210 Function DrawImage(image As Image, destPoints As /*Const*/ PointF, count As Long,
[241]1211 srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit) As Gdiplus.Status
[33]1212
1213 Return DrawImage(image, destPoints, count, srcx, srcy, srcwidth, srcheight, srcUnit, 0, 0, 0)
1214 End Function
1215
[212]1216 Function DrawImage(image As Image, destPoints As /*Const*/ PointF, count As Long,
[33]1217 srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit,
[241]1218 imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
[33]1219
1220 Return DrawImage(image, destPoints, count, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, 0, 0)
1221 End Function
1222
[212]1223 Function DrawImage(image As Image, destPoints As /*Const*/ PointF, count As Long,
[33]1224 srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit,
[212]1225 imageAttributes As /*Const*/ ImageAttributes,
[241]1226 callback As DrawImageAbort) As Gdiplus.Status
[33]1227
1228 Return DrawImage(image, destPoints, count, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, callback, 0)
1229 End Function
1230
[212]1231 Function DrawImage(image As Image, destPoints As /*Const*/ PointF, count As Long,
[33]1232 srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit,
[241]1233 imageAttributes As /*Const*/ ImageAttributes, callback As DrawImageAbort, callbackData As VoidPtr) As Gdiplus.Status
[33]1234
1235 Dim nativeImage As *GpImage
1236 If VarPtr(image) <> 0 Then
[104]1237 nativeImage = image.NativeImage
[33]1238 Else
1239 nativeImage = 0
1240 End If
1241
1242 Return SetStatus(GdipDrawImagePointsRect(nativeGraphics, nativeImage, destPoints, count,
[241]1243 srcx, srcy, srcwidth, srcheight, srcUnit, ImageAttributes.Native(imageAttributes), callback, callbackData))
[33]1244 End Function
1245
[212]1246 Function DrawImage(image As Image, x As Long, y As Long,
[241]1247 srcx As Long, srcy As Long, srcwidth As Long, srcheight As Long, srcUnit As GraphicsUnit) As Gdiplus.Status
[33]1248
1249 Dim nativeImage As *GpImage
1250 If VarPtr(image) <> 0 Then
[104]1251 nativeImage = image.NativeImage
[33]1252 Else
1253 nativeImage = 0
1254 End If
1255 Return SetStatus(GdipDrawImagePointRectI(nativeGraphics, nativeImage, x, y, srcx, srcy, srcwidth, srcheight, srcUnit))
1256 End Function
1257
[212]1258 Function DrawImage(image As Image, destRect As /*Const*/ Rectangle,
[241]1259 srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit) As Gdiplus.Status
[33]1260
1261 Return DrawImage(image, destRect, srcx, srcy, srcwidth, srcheight, srcUnit, 0, 0, 0)
1262 End Function
1263
[212]1264 Function DrawImage(image As Image, destRect As /*Const*/ Rectangle,
[33]1265 srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit,
[241]1266 imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
[33]1267
1268 Return DrawImage(image, destRect, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, 0, 0)
1269 End Function
1270
[212]1271 Function DrawImage(image As Image, destRect As /*Const*/ Rectangle,
[33]1272 srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit,
[241]1273 imageAttributes As /*Const*/ ImageAttributes, callback As DrawImageAbort) As Gdiplus.Status
[33]1274
1275 Return DrawImage(image, destRect, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, callback, 0)
1276 End Function
1277
[212]1278 Function DrawImage(image As Image, destRect As /*Const*/ Rectangle,
[33]1279 srcx As Long, srcy As Long, srcwidth As Long, srcheight As Long, srcUnit As GraphicsUnit,
[241]1280 imageAttributes As /*Const*/ ImageAttributes, callback As DrawImageAbort, callbackData As VoidPtr) As Gdiplus.Status
[33]1281
1282 Dim nativeImage As *GpImage
1283 If VarPtr(image) <> 0 Then
[104]1284 nativeImage = image.NativeImage
[33]1285 Else
1286 nativeImage = 0
1287 End If
1288
1289 Return SetStatus(GdipDrawImageRectRectI(nativeGraphics, nativeImage,
1290 destRect.X, destRect.Y, destRect.Width, destRect.Height,
[241]1291 srcx, srcy, srcwidth, srcheight, srcUnit, ImageAttributes.Native(imageAttributes), callback, callbackData))
[33]1292 End Function
1293
[212]1294 Function DrawImage(image As Image, destPoints As /*Const*/ Point, count As Long,
[241]1295 srcx As Long, srcy As Long, srcwidth As Long, srcheight As Long, srcUnit As GraphicsUnit) As Gdiplus.Status
[33]1296
1297 Return DrawImage(image, destPoints, count, srcx, srcy, srcwidth, srcheight, srcUnit, 0, 0, 0)
1298 End Function
1299
[212]1300 Function DrawImage(image As Image, destPoints As /*Const*/ Point, count As Long,
[33]1301 srcx As Long, srcy As Long, srcwidth As Long, srcheight As Long, srcUnit As GraphicsUnit,
[241]1302 imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
[33]1303
1304 Return DrawImage(image, destPoints, count, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, 0, 0)
1305 End Function
1306
[212]1307 Function DrawImage(image As Image, destPoints As /*Const*/ Point, count As Long, _
[104]1308 srcx As Long, srcy As Long, srcwidth As Long, srcheight As Long, srcUnit As GraphicsUnit, _
[212]1309 imageAttributes As /*Const*/ ImageAttributes,
[241]1310 callback As DrawImageAbort) As Gdiplus.Status
[33]1311
1312 Return DrawImage(image, destPoints, count, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, callback, 0)
1313 End Function
1314
[212]1315 Function DrawImage(image As Image, destPoints As /*Const*/ Point, count As Long,
[33]1316 srcx As Long, srcy As Long, srcwidth As Long, srcheight As Long, srcUnit As GraphicsUnit,
[241]1317 imageAttributes As /*Const*/ ImageAttributes, callback As DrawImageAbort, callbackData As VoidPtr) As Gdiplus.Status
[33]1318
1319 Dim nativeImage As *GpImage
1320 If VarPtr(image) <> 0 Then
[104]1321 nativeImage = image.NativeImage
[33]1322 Else
1323 nativeImage = 0
1324 End If
1325
1326 Return SetStatus(GdipDrawImagePointsRectI(nativeGraphics, nativeImage, destPoints, count,
[241]1327 srcx, srcy, srcwidth, srcheight, srcUnit, ImageAttributes.Native(imageAttributes), callback, callbackData))
[33]1328 End Function
1329
[241]1330 Function DrawImage(image As Image, destPoints As /*Const*/ *Point, count As Long, srcRect As Rectangle, srcUnit As GraphicsUnit) As Gdiplus.Status
[33]1331 Return DrawImage(image, destPoints, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit)
1332 End Function
1333
[241]1334 Function DrawImage(image As Image, destPoints As /*Const*/ *PointF, count As Long, srcRect As RectangleF, srcUnit As GraphicsUnit) As Gdiplus.Status
[33]1335 Return DrawImage(image, destPoints, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit)
1336 End Function
1337
[241]1338 Function DrawImage(image As Image, x As Long, y As Long, srcRect As Rectangle, srcUnit As GraphicsUnit) As Gdiplus.Status
[33]1339 Return DrawImage(image, x, y, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit)
1340 End Function
1341
[241]1342 Function DrawImage(image As Image, x As Single, y As Single, srcRect As RectangleF, srcUnit As GraphicsUnit) As Gdiplus.Status
[33]1343 Return DrawImage(image, x, y, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit)
1344 End Function
1345
[241]1346 Function DrawImage(image As Image, destPoints As /*Const*/ *Point, count As Long, srcRect As Rectangle, srcUnit As GraphicsUnit, imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
[33]1347 Return DrawImage(image, destPoints, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit, imageAttributes)
1348 End Function
1349
[241]1350 Function DrawImage(image As Image, destPoints As /*Const*/ *PointF, count As Long, srcRect As RectangleF, srcUnit As GraphicsUnit, imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
[33]1351 Return DrawImage(image, destPoints, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit, imageAttributes)
1352 End Function
1353
[241]1354 Function DrawImage(image As Image, destPoints As /*Const*/ *Point, count As Long, srcRect As Rectangle, srcUnit As GraphicsUnit, imageAttributes As /*Const*/ ImageAttributes, callback As DrawImageAbort) As Gdiplus.Status
[33]1355 Return DrawImage(image, destPoints, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit, imageAttributes, callback)
1356 End Function
1357
[241]1358 Function DrawImage(image As Image, destPoints As /*Const*/ *PointF, count As Long, srcRect As RectangleF, srcUnit As GraphicsUnit, imageAttributes As /*Const*/ ImageAttributes, callback As DrawImageAbort) As Gdiplus.Status
[33]1359 Return DrawImage(image, destPoints, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit, imageAttributes, callback)
1360 End Function
1361
[241]1362 Function DrawImage(image As Image, destPoints As /*Const*/ *Point, count As Long, srcRect As Rectangle, srcUnit As GraphicsUnit, imageAttributes As /*Const*/ ImageAttributes, callback As DrawImageAbort, callbackData As VoidPtr) As Gdiplus.Status
[33]1363 Return DrawImage(image, destPoints, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit, imageAttributes, callback, callbackData)
1364 End Function
1365
[241]1366 Function DrawImage(image As Image, destPoints As /*Const*/ *PointF, count As Long, srcRect As RectangleF, srcUnit As GraphicsUnit, imageAttributes As /*Const*/ ImageAttributes, callback As DrawImageAbort, callbackData As VoidPtr) As Gdiplus.Status
[33]1367 Return DrawImage(image, destPoints, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit, imageAttributes, callback, callbackData)
1368 End Function
1369
1370 ' The following methods are for playing an EMF+ to a graphics
1371 ' via the enumeration interface. Each record of the EMF+ is
1372 ' sent to the callback (along with the callbackData). Then
1373 ' the callback can invoke the Metafile::PlayRecord method
1374 ' to play the particular record.
1375
[212]1376 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoint As /*Const*/ PointF,
[241]1377 callback As EnumerateMetafileProc) As Gdiplus.Status
[33]1378
1379 Return EnumerateMetafile(metafile, destPoint, callback, 0, 0)
1380 End Function
1381
[212]1382 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoint As /*Const*/ PointF,
[241]1383 callback As EnumerateMetafileProc, callbackData As VoidPtr) As Gdiplus.Status
[33]1384
1385 Return EnumerateMetafile(metafile, destPoint, callback, callbackData, 0)
1386 End Function
1387
[212]1388 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoint As /*Const*/ PointF,
[241]1389 callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
[33]1390
1391 Dim nativeImage As /*Const*/ *GpMetafile
1392 If VarPtr(metafile) <> 0 Then
[104]1393 nativeImage = metafile.NativeImage
[33]1394 Else
1395 nativeImage = 0
1396 End If
1397
1398 Return SetStatus(GdipEnumerateMetafileDestPoint(nativeGraphics,
[241]1399 nativeImage, destPoint, callback, callbackData, ImageAttributes.Native(imageAttributes)))
[33]1400 End Function
1401
[212]1402 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoint As /*Const*/ Point,
[241]1403 callback As EnumerateMetafileProc) As Gdiplus.Status
[33]1404
1405 Return EnumerateMetafile(metafile, destPoint, callback, 0, 0)
1406 End Function
1407
[212]1408 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoint As /*Const*/ Point,
[241]1409 callback As EnumerateMetafileProc, callbackData As VoidPtr) As Gdiplus.Status
[33]1410
1411 Return EnumerateMetafile(metafile, destPoint, callback, callbackData, 0)
1412 End Function
1413
[212]1414 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoint As /*Const*/ Point,
[241]1415 callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
[33]1416
1417 Dim nativeImage As /*Const*/ *GpMetafile
1418 If VarPtr(metafile) <> 0 Then
[104]1419 nativeImage = metafile.NativeImage
[33]1420 Else
1421 nativeImage = 0
1422 End If
1423
1424 Return SetStatus(GdipEnumerateMetafileDestPointI(nativeGraphics,
[241]1425 nativeImage, destPoint, callback, callbackData, ImageAttributes.Native(imageAttributes)))
[33]1426 End Function
1427
[212]1428 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destRect As /*Const*/ RectangleF,
[241]1429 callback As EnumerateMetafileProc) As Gdiplus.Status
[33]1430
1431 Return EnumerateMetafile(metafile, destRect, callback, 0, 0)
1432 End Function
1433
[212]1434 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destRect As /*Const*/ RectangleF,
[241]1435 callback As EnumerateMetafileProc, callbackData As VoidPtr) As Gdiplus.Status
[33]1436
1437 Return EnumerateMetafile(metafile, destRect, callback, callbackData, 0)
1438 End Function
1439
[212]1440 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destRect As /*Const*/ RectangleF,
[241]1441 callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
[33]1442
1443 Dim nativeImage As /*Const*/ *GpMetafile
1444 If VarPtr(metafile) <> 0 Then
[104]1445 nativeImage = metafile.NativeImage
[33]1446 Else
1447 nativeImage = 0
1448 End If
1449
1450 Return SetStatus(GdipEnumerateMetafileDestRect(nativeGraphics,
[241]1451 nativeImage, destRect, callback, callbackData, ImageAttributes.Native(imageAttributes)))
[33]1452 End Function
1453
[212]1454 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destRect As /*Const*/ Rectangle,
[241]1455 callback As EnumerateMetafileProc) As Gdiplus.Status
[33]1456
1457 Return EnumerateMetafile(metafile, destRect, callback, 0, 0)
1458 End Function
1459
[212]1460 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destRect As /*Const*/ Rectangle,
[241]1461 callback As EnumerateMetafileProc, callbackData As VoidPtr) As Gdiplus.Status
[33]1462
1463 Return EnumerateMetafile(metafile, destRect, callback, callbackData, 0)
1464 End Function
1465
[212]1466 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destRect As /*Const*/ Rectangle,
[241]1467 callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
[33]1468
1469 Dim nativeImage As /*Const*/ *GpMetafile
1470 If VarPtr(metafile) <> 0 Then
[104]1471 nativeImage = metafile.NativeImage
[33]1472 Else
1473 nativeImage = 0
1474 End If
1475
1476 Return SetStatus(GdipEnumerateMetafileDestRectI(nativeGraphics,
[241]1477 nativeImage, destRect, callback, callbackData, ImageAttributes.Native(imageAttributes)))
[33]1478 End Function
1479
[212]1480 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoints As /*Const*/ *PointF, count As Long,
[241]1481 callback As EnumerateMetafileProc) As Gdiplus.Status
[33]1482
1483 Return EnumerateMetafile(metafile, destPoints, count, callback, 0, 0)
1484 End Function
1485
[212]1486 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoints As /*Const*/ *PointF, count As Long,
[241]1487 callback As EnumerateMetafileProc, callbackData As VoidPtr) As Gdiplus.Status
[33]1488
1489 Return EnumerateMetafile(metafile, destPoints, count, callback, callbackData, 0)
1490 End Function
1491
[212]1492 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoints As /*Const*/ *PointF, count As Long,
[241]1493 callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
[33]1494
1495 Dim nativeImage As /*Const*/ *GpMetafile
1496 If VarPtr(metafile) <> 0 Then
[104]1497 nativeImage = metafile.NativeImage
[33]1498 Else
1499 nativeImage = 0
1500 End If
1501
1502 Return SetStatus(GdipEnumerateMetafileDestPoints(nativeGraphics,
[241]1503 nativeImage,destPoints, count, callback, callbackData, ImageAttributes.Native(imageAttributes)))
[33]1504 End Function
1505
[212]1506 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoints As /*Const*/ *Point, count As Long,
[241]1507 callback As EnumerateMetafileProc) As Gdiplus.Status
[33]1508
1509 Return EnumerateMetafile(metafile, destPoints, count, callback, 0, 0)
1510 End Function
1511
[212]1512 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoints As /*Const*/ *Point, count As Long,
[241]1513 callback As EnumerateMetafileProc, callbackData As VoidPtr) As Gdiplus.Status
[33]1514
1515 Return EnumerateMetafile(metafile, destPoints, count, callback, callbackData, 0)
1516 End Function
1517
[212]1518 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoints As /*Const*/ *Point, count As Long,
[241]1519 callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
[33]1520
1521 Dim nativeImage As /*Const*/ *GpMetafile
1522 If VarPtr(metafile) <> 0 Then
[104]1523 nativeImage = metafile.NativeImage
[33]1524 Else
1525 nativeImage = 0
1526 End If
1527
1528 Return SetStatus(GdipEnumerateMetafileDestPointsI(nativeGraphics,
[241]1529 nativeImage,destPoints, count, callback, callbackData, ImageAttributes.Native(imageAttributes)))
[33]1530 End Function
1531
[212]1532 Function EnumerateMetafile(metafile As /*Const*/ Metafile,
1533 destPoint As /*Const*/ PointF, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit,
[241]1534 callback As EnumerateMetafileProc) As Gdiplus.Status
[33]1535
1536 Return EnumerateMetafile(metafile, destPoint, count, srcUnit, callback, 0, 0)
1537 End Function
1538
[212]1539 Function EnumerateMetafile(metafile As /*Const*/ Metafile,
1540 destPoint As /*Const*/ PointF, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit,
[241]1541 callback As EnumerateMetafileProc, callbackData As VoidPtr) As Gdiplus.Status
[33]1542
1543 Return EnumerateMetafile(metafile, destPoint, srcRect, srcUnit, callback, callbackData, 0)
1544 End Function
1545
[212]1546 Function EnumerateMetafile(metafile As /*Const*/ Metafile,
1547 destPoint As /*Const*/ PointF, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit,
[241]1548 callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
[33]1549
1550 Dim nativeImage As /*Const*/ *GpMetafile
1551 If VarPtr(metafile) <> 0 Then
[104]1552 nativeImage = metafile.NativeImage
[33]1553 Else
1554 nativeImage = 0
1555 End If
1556
[104]1557 Return SetStatus(GdipEnumerateMetafileSrcRectDestPoint(nativeGraphics, _
[241]1558 nativeImage, destPoint, srcRect, srcUnit, callback, callbackData, ImageAttributes.Native(imageAttributes)))
[33]1559 End Function
1560
[212]1561 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1562 destPoint As /*Const*/ Point, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
[241]1563 callback As EnumerateMetafileProc) As Gdiplus.Status
[33]1564
1565 Return EnumerateMetafile(metafile, destPoint, count, srcUnit, callback, 0, 0)
1566 End Function
1567
[212]1568 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1569 destPoint As /*Const*/ Point, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
[241]1570 callback As EnumerateMetafileProc, callbackData As VoidPtr) As Gdiplus.Status
[33]1571
1572 Return EnumerateMetafile(metafile, destPoint, srcRect, srcUnit, callback, callbackData, 0)
1573 End Function
1574
[212]1575 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1576 destPoint As /*Const*/ Point, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
[241]1577 callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
[33]1578
1579 Dim nativeImage As /*Const*/ *GpMetafile
1580 If VarPtr(metafile) <> 0 Then
[104]1581 nativeImage = metafile.NativeImage
[33]1582 Else
1583 nativeImage = 0
1584 End If
1585
[104]1586 Return SetStatus(GdipEnumerateMetafileSrcRectDestPointI(nativeGraphics, _
[241]1587 nativeImage, destPoint, srcRect, srcUnit, callback, callbackData, ImageAttributes.Native(imageAttributes)))
[33]1588 End Function
1589
[212]1590 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1591 destRect As /*Const*/ RectangleF, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit, _
[241]1592 callback As EnumerateMetafileProc) As Gdiplus.Status
[33]1593
1594 Return EnumerateMetafile(metafile, destRect, count, srcUnit, callback, 0, 0)
1595 End Function
1596
[212]1597 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1598 destRect As /*Const*/ RectangleF, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit, _
[241]1599 callback As EnumerateMetafileProc, callbackData As VoidPtr) As Gdiplus.Status
[33]1600
1601 Return EnumerateMetafile(metafile, destRect, srcRect, srcUnit, callback, callbackData, 0)
1602 End Function
1603
[212]1604 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1605 destRect As /*Const*/ RectangleF, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit, _
[241]1606 callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
[33]1607
1608 Dim nativeImage As /*Const*/ *GpMetafile
1609 If VarPtr(metafile) <> 0 Then
[104]1610 nativeImage = metafile.NativeImage
[33]1611 Else
1612 nativeImage = 0
1613 End If
1614
[104]1615 Return SetStatus(GdipEnumerateMetafileSrcRectDestRect(nativeGraphics, _
[241]1616 nativeImage, destRect, srcRect, srcUnit, callback, callbackData, ImageAttributes.Native(imageAttributes)))
[33]1617 End Function
1618
[212]1619 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1620 destRect As /*Const*/ Rectangle, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
[241]1621 callback As EnumerateMetafileProc) As Gdiplus.Status
[33]1622
1623 Return EnumerateMetafile(metafile, destRect, srcRect, srcUnit, callback, 0, 0)
1624 End Function
1625
[212]1626 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1627 destRect As /*Const*/ Rectangle, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
[241]1628 callback As EnumerateMetafileProc, callbackData As VoidPtr) As Gdiplus.Status
[33]1629
1630 Return EnumerateMetafile(metafile, destRect, srcRect, srcUnit, callback, callbackData, 0)
1631 End Function
1632
[212]1633 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1634 destRect As /*Const*/ Rectangle, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
[241]1635 callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
[33]1636
1637 Dim nativeImage As /*Const*/ *GpMetafile
1638 If VarPtr(metafile) <> 0 Then
[104]1639 nativeImage = metafile.NativeImage
[33]1640 Else
1641 nativeImage = 0
1642 End If
1643
[104]1644 Return SetStatus(GdipEnumerateMetafileSrcRectDestRectI(nativeGraphics, _
[241]1645 nativeImage, destRect, srcRect, srcUnit, callback, callbackData, ImageAttributes.Native(imageAttributes)))
[33]1646 End Function
1647
[212]1648 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1649 destPoints As /*Const*/ *PointF, count As Long, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit, _
[241]1650 callback As EnumerateMetafileProc) As Gdiplus.Status
[33]1651
1652 Return EnumerateMetafile(metafile, destPoints, count, srcRect, srcUnit, callback, 0, 0)
1653 End Function
1654
[212]1655 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1656 destPoints As /*Const*/ *PointF, count As Long, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit, _
[241]1657 callback As EnumerateMetafileProc, callbackData As VoidPtr) As Gdiplus.Status
[33]1658
1659 Return EnumerateMetafile(metafile, destPoints, count, srcRect, srcUnit, callback, callbackData, 0)
1660 End Function
1661
[212]1662 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1663 destPoints As /*Const*/ *PointF, count As Long, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit, _
[241]1664 callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
[33]1665
1666 Dim nativeImage As /*Const*/ *GpMetafile
1667 If VarPtr(metafile) <> 0 Then
[104]1668 nativeImage = metafile.NativeImage
[33]1669 Else
1670 nativeImage = 0
1671 End If
1672
[104]1673 Return SetStatus(GdipEnumerateMetafileSrcRectDestPoints(nativeGraphics, _
[241]1674 nativeImage, destPoints, count, srcRect, srcUnit, callback, callbackData, ImageAttributes.Native(imageAttributes)))
[33]1675 End Function
1676
[212]1677 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1678 destPoints As /*Const*/ *Point, count As Long, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
[241]1679 callback As EnumerateMetafileProc) As Gdiplus.Status
[33]1680
1681 Return EnumerateMetafile(metafile, destPoints, count, srcRect, srcUnit, callback, 0, 0)
1682 End Function
1683
[212]1684 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1685 destPoints As /*Const*/ *Point, count As Long, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
[241]1686 callback As EnumerateMetafileProc, callbackData As VoidPtr) As Gdiplus.Status
[33]1687
1688 Return EnumerateMetafile(metafile, destPoints, count, srcRect, srcUnit, callback, callbackData, 0)
1689 End Function
1690
[212]1691 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1692 destPoints As /*Const*/ *Point, count As Long, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
[241]1693 callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
[33]1694
1695 Dim nativeImage As /*Const*/ *GpMetafile
1696 If VarPtr(metafile) <> 0 Then
[104]1697 nativeImage = metafile.NativeImage
[33]1698 Else
1699 nativeImage = 0
1700 End If
1701
[104]1702 Return SetStatus(GdipEnumerateMetafileSrcRectDestPointsI(nativeGraphics, nativeImage, _
[241]1703 destPoints, count, srcRect, srcUnit, callback, callbackData, ImageAttributes.Native(imageAttributes)))
[33]1704 End Function
1705
[241]1706 Function SetClip(g As /*Const*/ Graphics) As Gdiplus.Status
[33]1707 Return SetClip(g, CombineMode.Replace)
1708 End Function
1709
[241]1710 Function SetClip(rc As /*Const*/ RectangleF) As Gdiplus.Status
[33]1711 Return SetStatus(GdipSetClipRect(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, CombineMode.Replace))
1712 End Function
1713
[241]1714 Function SetClip(rc As /*Const*/ Rectangle) As Gdiplus.Status
[33]1715 Return SetStatus(GdipSetClipRectI(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, CombineMode.Replace))
1716 End Function
1717
[241]1718 Function SetClip(path As /*Const*/ GraphicsPath) As Gdiplus.Status
[33]1719 Return SetStatus(GdipSetClipPath(nativeGraphics, path->nativePath, CombineMode.Replace))
1720 End Function
1721
[241]1722 Function SetClip(region As /*Const*/ Region) As Gdiplus.Status
[33]1723 Return SetStatus(GdipSetClipRegion(nativeGraphics, region->nativeRegion, CombineMode.Replace))
1724 End Function
1725
[241]1726 Function SetClip(g As /*Const*/ Graphics, combineMode As CombineMode) As Gdiplus.Status
[33]1727 Return SetStatus(GdipSetClipGraphics(nativeGraphics, g->nativeGraphics, combineMode))
1728 End Function
1729
[241]1730 Function SetClip(rc As /*Const*/ RectangleF, combineMode As CombineMode) As Gdiplus.Status
[33]1731 Return SetStatus(GdipSetClipRect(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, combineMode))
1732 End Function
1733
[241]1734 Function SetClip(rc As /*Const*/ Rectangle, combineMode As CombineMode) As Gdiplus.Status
[33]1735 Return SetStatus(GdipSetClipRectI(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, combineMode))
1736 End Function
1737
[241]1738 Function SetClip(path As /*Const*/ GraphicsPath, combineMode As CombineMode) As Gdiplus.Status
[33]1739 Return SetStatus(GdipSetClipPath(nativeGraphics, path->nativePath, combineMode))
1740 End Function
1741
[241]1742 Function SetClip(region As /*Const*/ Region, combineMode As CombineMode) As Gdiplus.Status
[33]1743 Return SetStatus(GdipSetClipRegion(nativeGraphics, region->nativeRegion, combineMode))
1744 End Function
1745
1746 ' This is different than the other SetClip methods because it assumes
1747 ' that the HRGN is already in device units, so it doesn't transform
1748 ' the coordinates in the HRGN.
1749
[241]1750 Function SetClip(hrgn As HRGN, combineMode As CombineMode /* = CombineModeReplace*/) As Gdiplus.Status
[33]1751 Return SetStatus(GdipSetClipHrgn(nativeGraphics, hrgn, combineMode))
1752 End Function
1753
[241]1754 Function IntersectClip(rc As /*Const*/ RectangleF) As Gdiplus.Status
[33]1755 Return SetStatus(GdipSetClipRect(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, CombineMode.Intersect))
1756 End Function
1757
[241]1758 Function IntersectClip(rc As /*Const*/ Rectangle) As Gdiplus.Status
[33]1759 Return SetStatus(GdipSetClipRectI(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, CombineMode.Intersect))
1760 End Function
1761
[241]1762 Function IntersectClip(region As /*Const*/ Region) As Gdiplus.Status
[33]1763 Return SetStatus(GdipSetClipRegion(nativeGraphics, region->nativeRegion, CombineMode.Intersect))
1764 End Function
1765
[241]1766 Function ExcludeClip(rc As /*Const*/ RectangleF) As Gdiplus.Status
[33]1767 Return SetStatus(GdipSetClipRect(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, CombineMode.Exclude))
1768 End Function
1769
[241]1770 Function ExcludeClip(rc As /*Const*/ Rectangle) As Gdiplus.Status
[33]1771 Return SetStatus(GdipSetClipRectI(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, CombineMode.Exclude))
1772 End Function
1773
[241]1774 Function ExcludeClip(region As /*Const*/ Region) As Gdiplus.Status
[33]1775 Return SetStatus(GdipSetClipRegion(nativeGraphics, region->nativeRegion, CombineMode.Exclude))
1776 End Function
1777
[241]1778 Function ResetClip() As Gdiplus.Status
[33]1779 Return SetStatus(GdipResetClip(nativeGraphics))
1780 End Function
1781
[241]1782 Function TranslateClip(dx As Single, dy As Single) As Gdiplus.Status
[33]1783 Return SetStatus(GdipTranslateClip(nativeGraphics, dx, dy))
1784 End Function
1785
[241]1786 Function TranslateClip(dx As Long, dy As Long) As Gdiplus.Status
[33]1787 Return SetStatus(GdipTranslateClipI(nativeGraphics, dx, dy))
1788 End Function
1789
[241]1790 Const Function GetClip(region As Region) As Gdiplus.Status
[33]1791 Return SetStatus(GdipGetClip(nativeGraphics, region->nativeRegion))
1792 End Function
1793
[241]1794 Const Function GetClipBounds(rc As RectangleF) As Gdiplus.Status
[33]1795 Return SetStatus(GdipGetClipBounds(nativeGraphics, rc))
1796 End Function
1797
[241]1798 Const Function GetClipBounds(rc As Rectangle) As Gdiplus.Status
[33]1799 Return SetStatus(GdipGetClipBoundsI(nativeGraphics, rc))
1800 End Function
1801
[241]1802 Const Function GetVisibleClipBounds(rc As RectangleF) As Gdiplus.Status
[33]1803 Return SetStatus(GdipGetVisibleClipBounds(nativeGraphics, rc))
1804 End Function
1805
[241]1806 Const Function GetVisibleClipBounds(rc As Rectangle) As Gdiplus.Status
[33]1807 Return SetStatus(GdipGetVisibleClipBoundsI(nativeGraphics, rc))
1808 End Function
1809
1810 Const Function IsVisible(x As Long, y As Long) As BOOL
1811 Dim b = FALSE As BOOL
1812 SetStatus(GdipIsVisiblePointI(nativeGraphics, x, y, b))
1813 Return b
1814 End Function
1815
[212]1816 Const Function IsVisible(pt As /*Const*/ Point) As BOOL
[33]1817 Return IsVisible(pt.X, pt.Y)
1818 End Function
1819
1820 Const Function IsVisible(x As Long, y As Long, width As Long, height As Long) As BOOL
1821 Dim b = FALSE As BOOL
1822 SetStatus(GdipIsVisibleRectI(nativeGraphics, x, y, width, height, b))
1823 Return b
1824 End Function
1825
[212]1826 Const Function IsVisible(rc As /*Const*/ Rectangle) As BOOL
[33]1827 Return IsVisible(rc.X, rc.Y, rc.Width, rc.Height)
1828 End Function
1829
1830 Const Function IsVisible(x As Single, y As Single) As BOOL
1831 Dim b = FALSE As BOOL
1832 SetStatus(GdipIsVisiblePoint(nativeGraphics, x, y, b))
1833 Return b
1834 End Function
1835
[212]1836 Const Function IsVisible(point As /*Const*/ PointF) As BOOL
[33]1837 Return IsVisible(pt.X, pt.Y)
1838 End Function
1839
1840 Const Function IsVisible(x As Single, y As Single, width As Single, height As Single) As BOOL
1841 Dim b = FALSE As BOOL
1842 SetStatus(GdipIsVisibleRect(nativeGraphics, x, y, width, height, b))
1843 Return b
1844 End Function
1845
[212]1846 Const Function IsVisible(rect As /*Const*/ RectangleF) As BOOL
[33]1847 Return IsVisible(rc.X, rc.Y, rc.Width, rc.Height)
1848 End Function
1849
1850 Const Function Save() As GraphicsState
1851 Dim gstate As GraphicsState
1852 SetStatus(GdipSaveGraphics(nativeGraphics, state))
1853 Return gstate
1854 End Function
1855
1856 Function Restore(gstate As GraphicsState)
1857 Return SetStatus(GdipRestoreGraphics(nativeGraphics, gstate))
1858 End Function
1859
[212]1860 Function BeginContainer(dstrect As /*Const*/ RectangleF, srcrect As /*Const*/ RectangleF, unit As GraphicsUnit) As GraphicsContainer
[33]1861 Dim state As GraphicsContainer
1862 SetStatus(GdipBeginContainer(nativeGraphics, dstrect, srcrect, unit, state))
1863 Return state
1864 End Function
1865
[212]1866 Function BeginContainer(dstrect As /*Const*/ Rectangle, srcrect As /*Const*/ Rectangle, unit As GraphicsUnit) As GraphicsContainer
[33]1867 Dim state As GraphicsContainer
1868 SetStatus(GdipBeginContainerI(nativeGraphics, dstrect, srcrect, unit, state))
1869 Return state
1870 End Function
1871
1872 Function BeginContainer() As GraphicsContainer
1873 Dim state As GraphicsContainer
1874 SetStatus(GdipBeginContainer2(nativeGraphics, state))
1875 Return state
1876 End Function
1877
[241]1878 Function EndContainer(state As GraphicsContainer) As Gdiplus.Status
[33]1879 Return SetStatus(GdipEndContainer(nativeGraphics, state))
1880 End Function
1881
1882 ' Only valid when recording metafiles.
1883
1884 Function AddMetafileComment(data As /*Const*/ *Byte, sizeData As DWord)
1885 Return SetStatus(GdipComment(nativeGraphics, sizeData, data))
1886 End Function
1887
1888 Static Function GetHalftonePalette() As HPALETTE
1889 Return GdipCreateHalftonePalette()
1890 End Function
1891
[241]1892 Const Function GetLastStatus() As Gdiplus.Status
[33]1893 Dim lastStatus = lastResult
[241]1894 lastResult = Gdiplus.Status.Ok
[33]1895 Return lastStatus
1896 End Function
1897
1898Private
[212]1899' Sub Graphics(gr As Graphics)
[104]1900' Debug
1901' End Sub
[33]1902
1903Protected
[241]1904 Sub Graphics(graphics As *Gdiplus.GpGraphics)
1905 lastResult = Gdiplus.Status.Ok
[33]1906 SetNativeGraphics(graphics)
1907 End Sub
1908
[241]1909 Sub SetNativeGraphics(graphics As *Gdiplus.GpGraphics)
[33]1910 This.nativeGraphics = graphics
1911 End Sub
1912
[241]1913 Const Function SetStatus(status As Gdiplus.Status) As Gdiplus.Status
1914 If status <> Gdiplus.Status.Ok Then
[33]1915 lastResult = status
1916 End If
1917 Return status
1918 End Function
1919
[241]1920 Const Function GetNativeGraphics() As *Gdiplus.GpGraphics
[33]1921 Return This.nativeGraphics
1922 End Function
1923
[104]1924 Function GetNativePen(pen As /*Const*/ *Pen) As *GpPen
[33]1925 Return pen->nativePen
1926 End Function
1927
1928Protected
[241]1929 nativeGraphics As *Gdiplus.GpGraphics
1930 lastResult As /*Mutable*/ Gdiplus.Status
[33]1931End Class
1932
[241]1933End Namespace 'Drawing
1934End Namespace 'System
1935
[33]1936#endif
Note: See TracBrowser for help on using the repository browser.