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

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

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

File size: 78.1 KB
Line 
1' Classes/System/Drawing/Graphics.ab
2
3#ifndef __SYSTEM_DRAWING_GRAPHICS_AB__
4#define __SYSTEM_DRAWING_GRAPHICS_AB__
5
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
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
35Class Graphics
36Public
37 '=========================================================================
38 ' Properties
39 '=========================================================================
40 Const Function Clip() As Region
41 Dim r As Region
42 GetClip(r)
43 Return r
44 End Function
45
46 Sub Clip(region As /*Const*/ Region)
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
108 Function PageScale(scale As Single) As Gdiplus.Status
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
124 Function PageUnit(unit As GraphicsUnit) As Gdiplus.Status
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
176 Sub Transform(matrix As Matrix)
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 '=========================================================================
189 Static Function FromHDC(hdc As HDC) As Graphics
190 Return New Graphics(hdc)
191 End Function
192
193 Static Function FromHDC(hdc As HDC, hdevice As HANDLE) As Graphics
194 Return New Graphics(hdc, hdevice)
195 End Function
196
197 Static Function FromHWND(hwnd As HWND) As Graphics
198 Return New Graphics(hwnd, FALSE)
199 End Function
200
201 Static Function FromHWND(hwnd As DWord, icm As BOOL) As Graphics
202 Return New Graphics(hwnd, icm)
203 End Function
204
205 Static Function FromImage(image As Image) As Graphics
206 Return New Graphics(image)
207 End Function
208
209 Sub Graphics(hdc As HDC)
210 Dim graphics = 0 As Gdiplus.GpGraphics
211 lastResult = GdipCreateFromHDC(hdc, graphics)
212 SetNativeGraphics(graphics)
213 End Sub
214
215 Sub Graphics(hdc As HDC, hdevice As HANDLE)
216 Dim graphics = 0 As *Gdiplus.GpGraphics
217 lastResult = GdipCreateFromHDC2(hdc, hdevice, graphics)
218 SetNativeGraphics(graphics)
219 End Sub
220
221 Sub Graphics(hwnd As HWND)
222 Dim graphics = 0 As *Gdiplus.GpGraphics
223 lastResult = GdipCreateFromHWND(hwnd, graphics)
224 SetNativeGraphics(graphics)
225 End Sub
226
227 Sub Graphics(hwnd As HWND, icm As BOOL)
228 Dim graphics = 0 As *Gdiplus.GpGraphics
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
237 Sub Graphics(image As Image)
238 Dim graphics = 0 As *Gdiplus.GpGraphics
239 If (image != 0)
240 lastResult = GdipGetImageGraphicsContext(image->NativeImage, graphics)
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
277 Function SetRenderingOrigin(x As Long, y As Long) As Gdiplus.Status
278 Return SetStatus(GdipSetRenderingOrigin(nativeGraphics, x, y))
279 End Function
280
281 Const Function GetRenderingOrigin(x As Long, y As Long) As Gdiplus.Status
282 Return SetStatus(GdipGetRenderingOrigin(nativeGraphics, x, y))
283 End Function
284
285 Function SetCompositingMode(compositingMode As CompositingMode) As Gdiplus.Status
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
305 Function SetTextRenderingHint(newMode As TextRenderingHint) As Gdiplus.Status
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
315 Function SetTextContrast(contrast As DWord) As Gdiplus.Status
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
331 Function SetInterpolationMode(interpolationMode As InterpolationMode) As Gdiplus.Status
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
341 Function SetSmoothingMode(smoothingMode As SmoothingMode) As Gdiplus.Status
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
351 Function SetPixelOffsetMode(pixelOffsetMode As PixelOffsetMode) As Gdiplus.Status
352 Return SetStatus(GdipSetPixelOffsetMode(nativeGraphics, pixelOffsetMode))
353 End Function
354
355 '------------------------------------------------------------------------
356 ' Manipulate current world transform
357 '------------------------------------------------------------------------
358
359 Function SetTransform(matrix As /*Const*/ *Matrix) As Gdiplus.Status
360 Return SetStatus(GdipSetWorldTransform(nativeGraphics, matrix->nativeMatrix))
361 End Function
362
363 Function ResetTransform() As Gdiplus.Status
364 Return SetStatus(GdipResetWorldTransform(nativeGraphics))
365 End Function
366
367 Function MultiplyTransform(matrix As /*Const*/ Matrix) As Gdiplus.Status
368 Return SetStatus(GdipMultiplyWorldTransform(nativeGraphics, matrix->nativeMatrix, MatrixOrder.Prepend))
369 End Function
370
371 Function MultiplyTransform(matrix As /*Const*/ Matrix, order As MatrixOrder) As Gdiplus.Status
372 Return SetStatus(GdipMultiplyWorldTransform(nativeGraphics, matrix->nativeMatrix, order))
373 End Function
374
375 Function TranslateTransform(dx As Single, dy As Single) As Gdiplus.Status
376 Return SetStatus(GdipTranslateWorldTransform(nativeGraphics, dx, dy, MatrixOrder.Prepend))
377 End Function
378
379 Function TranslateTransform(dx As Single, dy As Single, order As MatrixOrder) As Gdiplus.Status
380 Return SetStatus(GdipTranslateWorldTransform(nativeGraphics, dx, dy, order))
381 End Function
382
383 Function ScaleTransform(sx As Single, sy As Single) As Gdiplus.Status
384 Return SetStatus(GdipScaleWorldTransform(nativeGraphics, sx, sy, MatrixOrder.Prepend))
385 End Function
386
387 Function ScaleTransform(sx As Single, sy As Single, order As MatrixOrder) As Gdiplus.Status
388 Return SetStatus(GdipScaleWorldTransform(nativeGraphics, sx, sy, order))
389 End Function
390
391 Function RotateTransform(angle As Single) As Gdiplus.Status
392 Return SetStatus(GdipRotateWorldTransform(nativeGraphics, angle, MatrixOrder.Prepend))
393 End Function
394
395 Function RotateTransform(angle As Single, order As MatrixOrder) As Gdiplus.Status
396 Return SetStatus(GdipRotateWorldTransform(nativeGraphics, angle, order))
397 End Function
398
399 Const Function GetTransform(matrix As Matrix) As Gdiplus.Status
400 Return SetStatus(GdipGetWorldTransform(nativeGraphics, matrix->nativeMatrix))
401 End Function
402
403 Const Function TransformPoints(destSpace As CoordinateSpace, srcSpace As CoordinateSpace, pts As PointF, count As Long) As Gdiplus.Status
404 Return SetStatus(GdipTransformPoints(nativeGraphics, destSpace, srcSpace, pts, count))
405 End Function
406
407 Const Function TransformPoints(destSpace As CoordinateSpace, srcSpace As CoordinateSpace, pts As Point, count As Long) As Gdiplus.Status
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
415 Const Function GetNearestColor(color As Color) As Gdiplus.Status
416 Dim argb = color->Value
417 Dim status = SetStatus(GdipGetNearestColor(nativeGraphics, argb))
418 color->Value = argb
419 Return status
420 End Function
421
422 Function DrawLine(pen As /*Const*/ Pen, x1 As Single, y1 As Single, x2 As Single, y2 As Single) As Gdiplus.Status
423 Return SetStatus(GdipDrawLine(nativeGraphics, pen->nativePen, x1, y1, x2, y2))
424 End Function
425
426 Function DrawLine(pen As /*Const*/ Pen, pt1 As /*Const*/ PointF, pt2 As /*Const*/ PointF) As Gdiplus.Status
427 Return DrawLine(pen, pt1.X, pt1.Y, pt2.X, pt2.Y)
428 End Function
429
430 Function DrawLines(pen As /*Const*/ Pen, points As /*Const*/ *PointF, count As Long) As Gdiplus.Status
431 Return SetStatus(GdipDrawLines(nativeGraphics, pen->nativePen, points, count))
432 End Function
433
434 Function DrawLine(pen As /*Const*/ Pen, x1 As Long, y1 As Long, x2 As Long, y2 As Long) As Gdiplus.Status
435 Return SetStatus(GdipDrawLineI(nativeGraphics, pen->nativePen, x1, y1, x2, y2))
436 End Function
437
438 Function DrawLine(pen As /*Const*/ Pen, pt1 As /*Const*/ Point, pt2 As /*Const*/ Point) As Gdiplus.Status
439 Return DrawLine(pen, pt1.X, pt1.Y, pt2.X, pt2.Y)
440 End Function
441
442 Function DrawLines(pen As /*Const*/ Pen, points As /*Const*/ *Point, count As Long) As Gdiplus.Status
443 Return SetStatus(GdipDrawLinesI(nativeGraphics, pen->nativePen, points, count))
444 End Function
445
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
447 Return SetStatus(GdipDrawArc(nativeGraphics, pen->nativePen, x, y, width, height, startAngle, sweepAngle))
448 End Function
449
450 Function DrawArc(pen As /*Const*/ Pen, rect As /*Const*/ RectangleF, startAngle As Single, sweepAngle As Single) As Gdiplus.Status
451 Return DrawArc(pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)
452 End Function
453
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
455 Return SetStatus(GdipDrawArcI(nativeGraphics, pen->nativePen, x, y, width, height, startAngle, sweepAngle))
456 End Function
457
458 Function DrawArc(pen As /*Const*/ Pen, rect As /*Const*/ Rectangle, startAngle As Single, sweepAngle As Single) As Gdiplus.Status
459 Return DrawArc(pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)
460 End Function
461
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
463 Return SetStatus(GdipDrawBezier(nativeGraphics, pen->nativePen, x1, y1,x2, y2, x3, y3, x4, y4))
464 End Function
465
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
467 Return DrawBezier(pen, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y)
468 End Function
469
470 Function DrawBeziers(pen As /*Const*/ Pen, points As /*Const*/ *PointF, count As Long) As Gdiplus.Status
471 Return SetStatus(GdipDrawBeziers(nativeGraphics, pen->nativePen, points, count))
472 End Function
473
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
475 Return SetStatus(GdipDrawBezierI(nativeGraphics, pen->nativePen, x1, y1, x2, y2, x3, y3, x4, y4))
476 End Function
477
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
479 Return DrawBezier(pen pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y)
480 End Function
481
482 Function DrawBeziers(pen As /*Const*/ Pen, points As /*Const*/ *Point, count As Long) As Gdiplus.Status
483 Return SetStatus(GdipDrawBeziersI(nativeGraphics, pen->nativePen, points, count))
484 End Function
485
486 Function DrawRectangle(pen As /*Const*/ Pen, rect As /*Const*/ RectangleF) As Gdiplus.Status
487 Return DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height)
488 End Function
489
490 Function DrawRectangle(pen As /*Const*/ Pen, x As Single, y As Single, width As Single, height As Single) As Gdiplus.Status
491 Return SetStatus(GdipDrawRectangle(nativeGraphics, pen->nativePen, x, y, width, height))
492 End Function
493
494 Function DrawRectangles(pen As /*Const*/ Pen, rects As /*Const*/ *RectangleF, count As Long) As Gdiplus.Status
495 Return SetStatus(GdipDrawRectangles(nativeGraphics, pen->nativePen, rects, count))
496 End Function
497
498 Function DrawRectangle(pen As /*Const*/ Pen, rect As /*Const*/ Rectangle) As Gdiplus.Status
499 Return DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height)
500 End Function
501
502 Function DrawRectangle(pen As /*Const*/ Pen, x As Long, y As Long, width As Long, height As Long) As Gdiplus.Status
503 Return SetStatus(GdipDrawRectangleI(nativeGraphics, pen->nativePen, x, y, width, height))
504 End Function
505
506 Function DrawRectangles(pen As /*Const*/ Pen, rects As /*Const*/ *Rectangle, count As Long) As Gdiplus.Status
507 Return SetStatus(GdipDrawRectanglesI(nativeGraphics, pen->nativePen, rects, count))
508 End Function
509
510 Function DrawEllipse(pen As /*Const*/ Pen, rect As /*Const*/ RectangleF) As Gdiplus.Status
511 Return DrawEllipse(pen, rect.X, rect.Y, rect.Width, rect.Height)
512 End Function
513
514 Function DrawEllipse(pen As /*Const*/ Pen, x As Single, y As Single, width As Single, height As Single) As Gdiplus.Status
515 Return SetStatus(GdipDrawEllipse(nativeGraphics, pen->nativePen, x, y, width, height))
516 End Function
517
518 Function DrawEllipse(pen As /*Const*/ Pen, rect As /*Const*/ Rectangle) As Gdiplus.Status
519 Return DrawEllipse(pen, rect.X, rect.Y, rect.Width, rect.Height)
520 End Function
521
522 Function DrawEllipse(pen As /*Const*/ Pen, x As Long, y As Long, width As Long, height As Long) As Gdiplus.Status
523 Return SetStatus(GdipDrawEllipseI(nativeGraphics, pen->nativePen, x, y, width, height))
524 End Function
525
526 Function DrawPie(pen As /*Const*/ Pen, rect As /*Const*/ RectangleF, startAngle As Single, sweepAngle As Single) As Gdiplus.Status
527 Return DrawPie(pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)
528 End Function
529
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
531 Return SetStatus(GdipDrawPie(nativeGraphics, pen->nativePen, x, y, width, height, startAngle, sweepAngle))
532 End Function
533
534 Function DrawPie(pen As /*Const*/ Pen, rect As /*Const*/ Rectangle, startAngle As Single, sweepAngle As Single) As Gdiplus.Status
535 Return DrawPie(pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)
536 End Function
537
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
539 Return SetStatus(GdipDrawPieI(nativeGraphics, pen->nativePen, x, y, width, height, startAngle, sweepAngle))
540 End Function
541
542 Function DrawPolygon(pen As /*Const*/ Pen, points As /*Const*/ *PointF, count As Long) As Gdiplus.Status
543 Return SetStatus(GdipDrawPolygon(nativeGraphics, pen->nativePen, points, count))
544 End Function
545
546 Function DrawPolygon(pen As /*Const*/ Pen, points As /*Const*/ *Point, count As Long) As Gdiplus.Status
547 Return SetStatus(GdipDrawPolygonI(nativeGraphics, pen->nativePen, points, count))
548 End Function
549
550 Function DrawPath(pen As /*Const*/ Pen, path As /*Const*/ GraphicsPath) As Gdiplus.Status
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
555 Function DrawCurve(pen As /*Const*/ Pen, points As /*Const*/ *PointF, count As Long) As Gdiplus.Status
556 Return SetStatus(GdipDrawCurve(nativeGraphics, pen->nativePen, points, count))
557 End Function
558
559 Function DrawCurve(pen As /*Const*/ Pen, points As /*Const*/ *PointF, count As Long, tension As Single) As Gdiplus.Status
560 Return SetStatus(GdipDrawCurve2(nativeGraphics, pen->nativePen, points,count, tension))
561 End Function
562
563 Function DrawCurve(pen As /*Const*/ Pen, points As /*Const*/ *PointF, count As Long, offset As Long, numberOfSegments As Long) As Gdiplus.Status
564 Return SetStatus(GdipDrawCurve3(nativeGraphics, pen->nativePen, points, count, offset,numberOfSegments, 0.5))
565 End Function
566
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
568 Return SetStatus(GdipDrawCurve3(nativeGraphics, pen->nativePen, points, count, offset,numberOfSegments, tension))
569 End Function
570
571 Function DrawCurve(pen As /*Const*/ Pen, points As /*Const*/ *Point, count As Long) As Gdiplus.Status
572 Return SetStatus(GdipDrawCurveI(nativeGraphics, pen->nativePen, points, count))
573 End Function
574
575 Function DrawCurve(pen As /*Const*/ Pen, points As /*Const*/ *Point, count As Long, tension As Single) As Gdiplus.Status
576 Return SetStatus(GdipDrawCurve2I(nativeGraphics, pen->nativePen, points, count, tension))
577 End Function
578
579 Function DrawCurve(pen As /*Const*/ Pen, points As /*Const*/ *Point, count As Long, offset As Long, numberOfSegments As Long) As Gdiplus.Status
580 Return SetStatus(GdipDrawCurve3I(nativeGraphics, pen->nativePen, points, count, offset, numberOfSegments, 0.5))
581 End Function
582
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
584 Return SetStatus(GdipDrawCurve3I(nativeGraphics, pen->nativePen, points, count, offset, numberOfSegments, tension))
585 End Function
586
587 Function DrawClosedCurve(pen As /*Const*/ Pen, points As /*Const*/ *PointF, count As Long) As Gdiplus.Status
588 Return SetStatus(GdipDrawClosedCurve(nativeGraphics, pen->nativePen, points, count))
589 End Function
590
591 Function DrawClosedCurve(pen As /*Const*/ Pen, points As /*Const*/ *PointF, count As Long, tension As Single) As Gdiplus.Status
592 Return SetStatus(GdipDrawClosedCurve2(nativeGraphics, pen->nativePen, points, count, tension))
593 End Function
594
595 Function DrawClosedCurve(pen As /*Const*/ Pen, points As /*Const*/ *Point, count As Long) As Gdiplus.Status
596 Return SetStatus(GdipDrawClosedCurveI(nativeGraphics, pen->nativePen, points, count))
597 End Function
598
599 Function DrawClosedCurve(pen As /*Const*/ Pen, points As /*Const*/ *Point, count As Long, tension As Single) As Gdiplus.Status
600 Return SetStatus(GdipDrawClosedCurve2I(nativeGraphics, pen->nativePen, points, count, tension))
601 End Function
602
603 Function Clear(color As /*Const*/ Color) As Gdiplus.Status
604 Return SetStatus(GdipGraphicsClear(nativeGraphics, color.Value))
605 End Function
606
607 Function FillRectangle(brush As /*Const*/ Brush, rect As /*Const*/ RectangleF) As Gdiplus.Status
608 Return FillRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height)
609 End Function
610
611 Function FillRectangle(brush As /*Const*/ Brush, x As Single, y As Single, width As Single, height As Single) As Gdiplus.Status
612 Return SetStatus(GdipFillRectangle(nativeGraphics, brush->nativeBrush, x, y, width, height))
613 End Function
614
615 Function FillRectangles(brush As /*Const*/ Brush, rects As /*Const*/ *RectangleF, count As Long) As Gdiplus.Status
616 Return SetStatus(GdipFillRectangles(nativeGraphics,brush->nativeBrush,rects, count))
617 End Function
618
619 Function FillRectangle(brush As /*Const*/ Brush, rect As /*Const*/ Rectangle) As Gdiplus.Status
620 Return FillRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height)
621 End Function
622
623 Function FillRectangle(brush As /*Const*/ Brush, x As Long, y As Long, width As Long, height As Long) As Gdiplus.Status
624 Return SetStatus(GdipFillRectangleI(nativeGraphics, brush->nativeBrush, x, y, width, height))
625 End Function
626
627 Function FillRectangles(brush As /*Const*/ Brush, rects As /*Const*/ *Rectangle, count As Long) As Gdiplus.Status
628 Return SetStatus(GdipFillRectanglesI(nativeGraphics, brush->nativeBrush, rects, count))
629 End Function
630
631 Function FillPolygon(brush As /*Const*/ Brush, points As /*Const*/ *PointF, count As Long) As Gdiplus.Status
632 Return FillPolygon(brush, points, count, FillModeAlternate)
633 End Function
634
635 Function FillPolygon(brush As /*Const*/ Brush, points As /*Const*/ *PointF, count As Long, fillMode As FillMode) As Gdiplus.Status
636 Return SetStatus(GdipFillPolygon(nativeGraphics, brush->nativeBrush, points, count, fillMode))
637 End Function
638
639 Function FillPolygon(brush As /*Const*/ Brush, points As /*Const*/ *Point, count As Long) As Gdiplus.Status
640 Return FillPolygon(brush, points, count, FillModeAlternate)
641 End Function
642
643 Function FillPolygon(brush As /*Const*/ Brush, points As /*Const*/ *Point, count As Long, fillMode As FillMode) As Gdiplus.Status
644 Return SetStatus(GdipFillPolygonI(nativeGraphics, brush->nativeBrush, points, count, fillMode))
645 End Function
646
647 Function FillEllipse(brush As /*Const*/ Brush, rect As /*Const*/ RectangleF) As Gdiplus.Status
648 Return FillEllipse(brush, rect.X, rect.Y, rect.Width, rect.Height)
649 End Function
650
651 Function FillEllipse(brush As /*Const*/ Brush, x As Single, y As Single, width As Single, height As Single) As Gdiplus.Status
652 Return SetStatus(GdipFillEllipse(nativeGraphics, brush->nativeBrush, x, y, width, height))
653 End Function
654
655 Function FillEllipse(brush As /*Const*/ Brush, rect As /*Const*/ Rectangle) As Gdiplus.Status
656 Return FillEllipse(brush, rect.X, rect.Y, rect.Width, rect.Height)
657 End Function
658
659 Function FillEllipse(brush As /*Const*/ Brush, x As Long, y As Long, width As Long, height As Long) As Gdiplus.Status
660 Return SetStatus(GdipFillEllipseI(nativeGraphics, brush->nativeBrush, x, y, width, height))
661 End Function
662
663 Function FillPie(brush As /*Const*/ Brush, rect As /*Const*/ RectangleF, startAngle As Single, sweepAngle As Single) As Gdiplus.Status
664 Return FillPie(brush, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)
665 End Function
666
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
668 Return SetStatus(GdipFillPie(nativeGraphics, brush->nativeBrush, x, y, width, height, startAngle, sweepAngle))
669 End Function
670
671 Function FillPie(brush As /*Const*/ Brush, rect As /*Const*/ Rectangle, startAngle As Single, sweepAngle As Single) As Gdiplus.Status
672 Return FillPie(brush, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)
673 End Function
674
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
676 Return SetStatus(GdipFillPieI(nativeGraphics, brush->nativeBrush, x, y, width, height, startAngle, sweepAngle))
677 End Function
678
679 Function FillPath(brush As /*Const*/ Brush, path As /*Const*/ GraphicsPath) As Gdiplus.Status
680 Return SetStatus(GdipFillPath(nativeGraphics, brush->nativeBrush, path->nativePath))
681 End Function
682
683 Function FillClosedCurve(brush As /*Const*/ Brush, points As /*Const*/ *PointF, count As Long) As Gdiplus.Status
684 Return SetStatus(GdipFillClosedCurve(nativeGraphics, brush->nativeBrush, points, count))
685 End Function
686
687 Function FillClosedCurve(brush As /*Const*/ Brush, points As /*Const*/ *PointF, count As Long, fillMode As FillMode) As Gdiplus.Status
688 Return SetStatus(GdipFillClosedCurve2(nativeGraphics, brush->nativeBrush, points, count, 0.5, fillMode))
689 End Function
690
691 Function FillClosedCurve(brush As /*Const*/ Brush, points As /*Const*/ *PointF, count As Long, fillMode As FillMode, tension As Single) As Gdiplus.Status
692 Return SetStatus(GdipFillClosedCurve2(nativeGraphics, brush->nativeBrush, points, count, tension, fillMode))
693 End Function
694
695 Function FillClosedCurve(brush As /*Const*/ Brush, points As /*Const*/ *Point, count As Long) As Gdiplus.Status
696 Return SetStatus(GdipFillClosedCurveI(nativeGraphics, brush->nativeBrush, points, count))
697 End Function
698
699 Function FillClosedCurve(brush As /*Const*/ Brush, points As /*Const*/ *Point, count As Long, fillMode As FillMode) As Gdiplus.Status
700 Return SetStatus(GdipFillClosedCurve2I(nativeGraphics, brush->nativeBrush, points, count, 0.5, fillMode))
701 End Function
702
703 Function FillClosedCurve(brush As /*Const*/ Brush, points As /*Const*/ *Point, count As Long, fillMode As FillMode, tension As Single) As Gdiplus.Status
704 Return SetStatus(GdipFillClosedCurve2I(nativeGraphics, brush->nativeBrush, points, count, tension, fillMode))
705 End Function
706
707 Function FillRegion(brush As /*Const*/ Brush, region As /*Const*/ Region) As Gdiplus.Status
708 Return SetStatus(GdipFillRegion(nativeGraphics, brush->nativeBrush, region->nativeRegion))
709 End Function
710
711 Function DrawString(str As PCWSTR, length As Long, font As /*Const*/ Font, layoutRect As /*Const*/ RectangleF) As Gdiplus.Status
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
721 Function DrawString(str As PCWSTR, length As Long, font As /*Const*/ Font, layoutRect As /*Const*/ Rectangle,
722 stringFormat As /*Const*/ StringFormat, brush As /*Const*/ Brush) As Gdiplus.Status
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
736 Return SetStatus(GdipDrawString(nativeGraphics, str, length, nativeFont, layoutRect, nativeFormat, 0))
737 End Function
738
739 Function DrawString(str As PCWSTR, length As Long, font As /*Const*/ Font, layoutRect As /*Const*/ RectangleF,
740 stringFormat As /*Const*/ StringFormat, brush As /*Const*/ Brush) As Gdiplus.Status
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
763 Function DrawString(str As PCWSTR, length As Long, font As /*Const*/ Font, origin As /*Const*/ Point) As Gdiplus.Status
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
774 Function DrawString(str As PCWSTR, length As Long, font As /*Const*/ Font, origin As /*Const*/ PointF,
775 brush As /*Const*/ Brush) As Gdiplus.Status
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
793 Function DrawString(str As PCWSTR, length As Long, font As /*Const*/ Font, origin As /*Const*/ PointF) As Gdiplus.Status
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
804 Function DrawString(str As PCWSTR, length As Long, font As /*Const*/ Font, origin As /*Const*/ PointF,
805 stringFormat As /*Const*/ StringFormat) As Gdiplus.Status
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
823 Function DrawString(str As PCWSTR, length As Long, font As /*Const*/ Font, origin As /*Const*/ PointF,
824 stringFormat As /*Const*/ StringFormat, brush As /*Const*/ Brush) As Gdiplus.Status
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
847 Const Function MeasureString(str As PCWSTR, length As Long, font As /*Const*/ Font, layoutRect As /*Const*/ RectangleF,
848 stringFormat As /*Const*/ StringFormat, boundingBox As RectangleF) As Gdiplus.Status
849
850 Return MeasureString(str, length, font, layoutRect, stringFormat, boundingBox, ByVal 0, ByVal 0)
851 End Function
852
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,
855 codepointsFitted As Long) As Gdiplus.Status
856
857 Return MeasureString(str, length, font, layoutRect, stringFormat, boundingBox, codepointsFitted, ByVal 0)
858 End Function
859
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,
862 codepointsFitted As Long, linesFilled As Long) As Gdiplus.Status
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
880 Const Function MeasureString(str As PCWSTR, length As Long, font As /*Const*/ Font,
881 layoutRectSize As /*Const*/ SizeF, stringFormat As /*Const*/ StringFormat,
882 size As SizeF) As Gdiplus.Status
883
884 Return MeasureString(str, length, font, layoutRectSize, stringFormat, size, ByVal 0, ByVal 0)
885 End Function
886
887 Const Function MeasureString(str As PCWSTR, length As Long, font As /*Const*/ Font,
888 layoutRectSize As /*Const*/ SizeF, stringFormat As /*Const*/ StringFormat,
889 size As SizeF, codepointsFitted As Long) As Gdiplus.Status
890
891 Return MeasureString(str, length, font, layoutRectSize, stringFormat, size, codepointsFitted, ByVal 0)
892 End Function
893
894 Const Function MeasureString(str As PCWSTR, length As Long, font As /*Const*/ Font,
895 layoutRectSize As /*Const*/ SizeF, stringFormat As /*Const*/ StringFormat,
896 size As SizeF, codepointsFitted As Long, linesFilled As Long) As Gdiplus.Status
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
921 If VarPtr(size) <> 0 And status = Gdiplus.Status.Ok Then
922 size.Width = boundingBox.Width
923 size.Height = boundingBox.Height
924 End Function
925
926 Return status
927 End Function
928
929 Const Function MeasureString(str As PCWSTR, length As Long, font As /*Const*/ Font,
930 origin As /*Const*/ PointF, stringFormat As /*Const*/ StringFormat,
931 boundingBox As RectangleF) As Gdiplus.Status
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
950 Const Function MeasureString(str As PCWSTR, length As Long, font As /*Const*/ Font,
951 layoutRect As /*Const*/ RectangleF, boundingBox As RectangleF) As Gdiplus.Status
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
963 Const Function MeasureString(str As PCWSTR, length As Long, font As /*Const*/ Font,
964 origin As /*Const*/ PointF, boundingBox As RectangleF) As Gdiplus.Status
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
976 Const Function MeasureCharacterRanges(str As PCWSTR, length As Long, font As /*Const*/ Font,
977 layoutRect As /*Const*/ RectangleF, stringFormat As /*Const*/ StringFormat,
978 regionCount As Long, regions As *Region) As Gdiplus.Status
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
1013 Function DrawDriverString(text As /*Const*/ Word, length As Long, font As /*Const*/ Font,
1014 brush As /*Const*/ Brush, positions As /*Const*/ *PointF, flags As Long) As Gdiplus.Status
1015
1016 Return DrawDriverString(text, length, font, brush, positions, flags, ByVal 0)
1017 End Function
1018
1019 Function DrawDriverString(text As /*Const*/ Word, length As Long, font As /*Const*/ Font,
1020 brush As /*Const*/ Brush, positions As /*Const*/ *PointF, flags As Long, matrix As /*Const*/ Matrix) As Gdiplus.Status
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
1043 Const Function MeasureDriverString(text As /*Const*/ Word, length As Long, font As /*Const*/ Font,
1044 positions As /*Const*/ *PointF, flags As Long, matrix As /*Const*/ Matrix, boundingBox As RectangleF) As Gdiplus.Status
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
1065 Function DrawCachedBitmap(cb As CachedBitmap, x As Long, y As Long) As Gdiplus.Status
1066 Return SetStatus(GdipDrawCachedBitmap(nativeGraphics, cb->nativeCachedBitmap, x, y))
1067 End Function
1068
1069 Function DrawImage(image As Image, point As /*Const*/ PointF) As Gdiplus.Status
1070 Return DrawImage(image, point.X, point.Y)
1071 End Function
1072
1073 Function DrawImage(image As Image, x As Single, y As Single) As Gdiplus.Status
1074 Dim nativeImage As *GpImage
1075 If VarPtr(image) <> 0 Then
1076 nativeImage = image.NativeImage
1077 Else
1078 nativeImage = 0
1079 End If
1080 Return SetStatus(GdipDrawImage(nativeGraphics, nativeImage, x, y))
1081 End Function
1082
1083 Function DrawImage(image As Image, rect As /*Const*/ RectangleF) As Gdiplus.Status
1084 Return DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height)
1085 End Function
1086
1087 Function DrawImage(image As Image, x As Single, y As Single, width As Single, height As Single) As Gdiplus.Status
1088 Dim nativeImage As *GpImage
1089 If VarPtr(image) <> 0 Then
1090 nativeImage = image.NativeImage
1091 Else
1092 nativeImage = 0
1093 End If
1094 Return SetStatus(GdipDrawImageRect(nativeGraphics, nativeImage, x, y, width, height))
1095 End Function
1096
1097 Function DrawImage(image As Image, point As /*Const*/ Point) As Gdiplus.Status
1098 Return DrawImage(image, point.X, point.Y) As Gdiplus.Status
1099 End Function
1100
1101 Function DrawImage(image As Image, x As Long, y As Long) As Gdiplus.Status
1102 Dim nativeImage As *GpImage
1103 If VarPtr(image) <> 0 Then
1104 nativeImage = image.NativeImage
1105 Else
1106 nativeImage = 0
1107 End If
1108 Return SetStatus(GdipDrawImageI(nativeGraphics, nativeImage, x, y))
1109 End Function
1110
1111 Function DrawImage(image As Image, rect As /*Const*/ Rectangle) As Gdiplus.Status
1112 Return DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height)
1113 End Function
1114
1115 Function DrawImage(image As Image, x As Long, y As Long, width As Long, height As Long) As Gdiplus.Status
1116 Dim nativeImage As *GpImage
1117 If VarPtr(image) <> 0 Then
1118 nativeImage = image.NativeImage
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
1133 Function DrawImage(image As Image, destPoints As /*Const*/ PointF, count As Long) As Gdiplus.Status
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
1140 nativeImage = image.NativeImage
1141 Else
1142 nativeImage = 0
1143 End If
1144 Return SetStatus(GdipDrawImagePoints(nativeGraphics, nativeImage, destPoints, count))
1145 End Function
1146
1147 Function DrawImage(image As Image, destPoints As /*Const*/ Point, count As Long) As Gdiplus.Status
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
1154 nativeImage = image.NativeImage
1155 Else
1156 nativeImage = 0
1157 End If
1158 Return SetStatus(GdipDrawImagePointsI(nativeGraphics, nativeImage, destPoints, count))
1159 End Function
1160
1161 Function DrawImage(image As Image, x As Single, y As Single,
1162 srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit) As Gdiplus.Status
1163
1164 Dim nativeImage As *GpImage
1165 If VarPtr(image) <> 0 Then
1166 nativeImage = image.NativeImage
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
1173 Function DrawImage(image As Image, destRect As /*Const*/ RectangleF,
1174 srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit) As Gdiplus.Status
1175
1176 Return DrawImage(image, destRect, srcx, srcy, srcwidth, srcheight, srcUnit, 0, 0, 0)
1177 End Function
1178
1179 Function DrawImage(image As Image, destRect As /*Const*/ RectangleF,
1180 srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit,
1181 imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
1182
1183 Return DrawImage(image, destRect, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, 0, 0)
1184 End Function
1185
1186 Function DrawImage(image As Image, destRect As /*Const*/ RectangleF,
1187 srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit,
1188 imageAttributes As /*Const*/ ImageAttributes,
1189 callback As DrawImageAbort) As Gdiplus.Status
1190
1191 Return DrawImage(image, destRect, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, callback, 0)
1192 End Function
1193
1194 Function DrawImage(image As Image, destRect As /*Const*/ RectangleF,
1195 srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit,
1196 imageAttributes As /*Const*/ ImageAttributes, callback As DrawImageAbort, callbackData As VoidPtr) As Gdiplus.Status
1197
1198 Dim nativeImage As *GpImage
1199 If VarPtr(image) <> 0 Then
1200 nativeImage = image.NativeImage
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,
1207 srcUnit, ImageAttributes.Native(imageAttributes), callback, callbackData))
1208 End Function
1209
1210 Function DrawImage(image As Image, destPoints As /*Const*/ PointF, count As Long,
1211 srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit) As Gdiplus.Status
1212
1213 Return DrawImage(image, destPoints, count, srcx, srcy, srcwidth, srcheight, srcUnit, 0, 0, 0)
1214 End Function
1215
1216 Function DrawImage(image As Image, destPoints As /*Const*/ PointF, count As Long,
1217 srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit,
1218 imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
1219
1220 Return DrawImage(image, destPoints, count, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, 0, 0)
1221 End Function
1222
1223 Function DrawImage(image As Image, destPoints As /*Const*/ PointF, count As Long,
1224 srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit,
1225 imageAttributes As /*Const*/ ImageAttributes,
1226 callback As DrawImageAbort) As Gdiplus.Status
1227
1228 Return DrawImage(image, destPoints, count, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, callback, 0)
1229 End Function
1230
1231 Function DrawImage(image As Image, destPoints As /*Const*/ PointF, count As Long,
1232 srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit,
1233 imageAttributes As /*Const*/ ImageAttributes, callback As DrawImageAbort, callbackData As VoidPtr) As Gdiplus.Status
1234
1235 Dim nativeImage As *GpImage
1236 If VarPtr(image) <> 0 Then
1237 nativeImage = image.NativeImage
1238 Else
1239 nativeImage = 0
1240 End If
1241
1242 Return SetStatus(GdipDrawImagePointsRect(nativeGraphics, nativeImage, destPoints, count,
1243 srcx, srcy, srcwidth, srcheight, srcUnit, ImageAttributes.Native(imageAttributes), callback, callbackData))
1244 End Function
1245
1246 Function DrawImage(image As Image, x As Long, y As Long,
1247 srcx As Long, srcy As Long, srcwidth As Long, srcheight As Long, srcUnit As GraphicsUnit) As Gdiplus.Status
1248
1249 Dim nativeImage As *GpImage
1250 If VarPtr(image) <> 0 Then
1251 nativeImage = image.NativeImage
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
1258 Function DrawImage(image As Image, destRect As /*Const*/ Rectangle,
1259 srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit) As Gdiplus.Status
1260
1261 Return DrawImage(image, destRect, srcx, srcy, srcwidth, srcheight, srcUnit, 0, 0, 0)
1262 End Function
1263
1264 Function DrawImage(image As Image, destRect As /*Const*/ Rectangle,
1265 srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit,
1266 imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
1267
1268 Return DrawImage(image, destRect, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, 0, 0)
1269 End Function
1270
1271 Function DrawImage(image As Image, destRect As /*Const*/ Rectangle,
1272 srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit,
1273 imageAttributes As /*Const*/ ImageAttributes, callback As DrawImageAbort) As Gdiplus.Status
1274
1275 Return DrawImage(image, destRect, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, callback, 0)
1276 End Function
1277
1278 Function DrawImage(image As Image, destRect As /*Const*/ Rectangle,
1279 srcx As Long, srcy As Long, srcwidth As Long, srcheight As Long, srcUnit As GraphicsUnit,
1280 imageAttributes As /*Const*/ ImageAttributes, callback As DrawImageAbort, callbackData As VoidPtr) As Gdiplus.Status
1281
1282 Dim nativeImage As *GpImage
1283 If VarPtr(image) <> 0 Then
1284 nativeImage = image.NativeImage
1285 Else
1286 nativeImage = 0
1287 End If
1288
1289 Return SetStatus(GdipDrawImageRectRectI(nativeGraphics, nativeImage,
1290 destRect.X, destRect.Y, destRect.Width, destRect.Height,
1291 srcx, srcy, srcwidth, srcheight, srcUnit, ImageAttributes.Native(imageAttributes), callback, callbackData))
1292 End Function
1293
1294 Function DrawImage(image As Image, destPoints As /*Const*/ Point, count As Long,
1295 srcx As Long, srcy As Long, srcwidth As Long, srcheight As Long, srcUnit As GraphicsUnit) As Gdiplus.Status
1296
1297 Return DrawImage(image, destPoints, count, srcx, srcy, srcwidth, srcheight, srcUnit, 0, 0, 0)
1298 End Function
1299
1300 Function DrawImage(image As Image, destPoints As /*Const*/ Point, count As Long,
1301 srcx As Long, srcy As Long, srcwidth As Long, srcheight As Long, srcUnit As GraphicsUnit,
1302 imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
1303
1304 Return DrawImage(image, destPoints, count, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, 0, 0)
1305 End Function
1306
1307 Function DrawImage(image As Image, destPoints As /*Const*/ Point, count As Long, _
1308 srcx As Long, srcy As Long, srcwidth As Long, srcheight As Long, srcUnit As GraphicsUnit, _
1309 imageAttributes As /*Const*/ ImageAttributes,
1310 callback As DrawImageAbort) As Gdiplus.Status
1311
1312 Return DrawImage(image, destPoints, count, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, callback, 0)
1313 End Function
1314
1315 Function DrawImage(image As Image, destPoints As /*Const*/ Point, count As Long,
1316 srcx As Long, srcy As Long, srcwidth As Long, srcheight As Long, srcUnit As GraphicsUnit,
1317 imageAttributes As /*Const*/ ImageAttributes, callback As DrawImageAbort, callbackData As VoidPtr) As Gdiplus.Status
1318
1319 Dim nativeImage As *GpImage
1320 If VarPtr(image) <> 0 Then
1321 nativeImage = image.NativeImage
1322 Else
1323 nativeImage = 0
1324 End If
1325
1326 Return SetStatus(GdipDrawImagePointsRectI(nativeGraphics, nativeImage, destPoints, count,
1327 srcx, srcy, srcwidth, srcheight, srcUnit, ImageAttributes.Native(imageAttributes), callback, callbackData))
1328 End Function
1329
1330 Function DrawImage(image As Image, destPoints As /*Const*/ *Point, count As Long, srcRect As Rectangle, srcUnit As GraphicsUnit) As Gdiplus.Status
1331 Return DrawImage(image, destPoints, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit)
1332 End Function
1333
1334 Function DrawImage(image As Image, destPoints As /*Const*/ *PointF, count As Long, srcRect As RectangleF, srcUnit As GraphicsUnit) As Gdiplus.Status
1335 Return DrawImage(image, destPoints, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit)
1336 End Function
1337
1338 Function DrawImage(image As Image, x As Long, y As Long, srcRect As Rectangle, srcUnit As GraphicsUnit) As Gdiplus.Status
1339 Return DrawImage(image, x, y, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit)
1340 End Function
1341
1342 Function DrawImage(image As Image, x As Single, y As Single, srcRect As RectangleF, srcUnit As GraphicsUnit) As Gdiplus.Status
1343 Return DrawImage(image, x, y, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit)
1344 End Function
1345
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
1347 Return DrawImage(image, destPoints, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit, imageAttributes)
1348 End Function
1349
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
1351 Return DrawImage(image, destPoints, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit, imageAttributes)
1352 End Function
1353
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
1355 Return DrawImage(image, destPoints, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit, imageAttributes, callback)
1356 End Function
1357
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
1359 Return DrawImage(image, destPoints, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit, imageAttributes, callback)
1360 End Function
1361
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
1363 Return DrawImage(image, destPoints, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit, imageAttributes, callback, callbackData)
1364 End Function
1365
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
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
1376 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoint As /*Const*/ PointF,
1377 callback As EnumerateMetafileProc) As Gdiplus.Status
1378
1379 Return EnumerateMetafile(metafile, destPoint, callback, 0, 0)
1380 End Function
1381
1382 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoint As /*Const*/ PointF,
1383 callback As EnumerateMetafileProc, callbackData As VoidPtr) As Gdiplus.Status
1384
1385 Return EnumerateMetafile(metafile, destPoint, callback, callbackData, 0)
1386 End Function
1387
1388 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoint As /*Const*/ PointF,
1389 callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
1390
1391 Dim nativeImage As /*Const*/ *GpMetafile
1392 If VarPtr(metafile) <> 0 Then
1393 nativeImage = metafile.NativeImage
1394 Else
1395 nativeImage = 0
1396 End If
1397
1398 Return SetStatus(GdipEnumerateMetafileDestPoint(nativeGraphics,
1399 nativeImage, destPoint, callback, callbackData, ImageAttributes.Native(imageAttributes)))
1400 End Function
1401
1402 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoint As /*Const*/ Point,
1403 callback As EnumerateMetafileProc) As Gdiplus.Status
1404
1405 Return EnumerateMetafile(metafile, destPoint, callback, 0, 0)
1406 End Function
1407
1408 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoint As /*Const*/ Point,
1409 callback As EnumerateMetafileProc, callbackData As VoidPtr) As Gdiplus.Status
1410
1411 Return EnumerateMetafile(metafile, destPoint, callback, callbackData, 0)
1412 End Function
1413
1414 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoint As /*Const*/ Point,
1415 callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
1416
1417 Dim nativeImage As /*Const*/ *GpMetafile
1418 If VarPtr(metafile) <> 0 Then
1419 nativeImage = metafile.NativeImage
1420 Else
1421 nativeImage = 0
1422 End If
1423
1424 Return SetStatus(GdipEnumerateMetafileDestPointI(nativeGraphics,
1425 nativeImage, destPoint, callback, callbackData, ImageAttributes.Native(imageAttributes)))
1426 End Function
1427
1428 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destRect As /*Const*/ RectangleF,
1429 callback As EnumerateMetafileProc) As Gdiplus.Status
1430
1431 Return EnumerateMetafile(metafile, destRect, callback, 0, 0)
1432 End Function
1433
1434 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destRect As /*Const*/ RectangleF,
1435 callback As EnumerateMetafileProc, callbackData As VoidPtr) As Gdiplus.Status
1436
1437 Return EnumerateMetafile(metafile, destRect, callback, callbackData, 0)
1438 End Function
1439
1440 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destRect As /*Const*/ RectangleF,
1441 callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
1442
1443 Dim nativeImage As /*Const*/ *GpMetafile
1444 If VarPtr(metafile) <> 0 Then
1445 nativeImage = metafile.NativeImage
1446 Else
1447 nativeImage = 0
1448 End If
1449
1450 Return SetStatus(GdipEnumerateMetafileDestRect(nativeGraphics,
1451 nativeImage, destRect, callback, callbackData, ImageAttributes.Native(imageAttributes)))
1452 End Function
1453
1454 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destRect As /*Const*/ Rectangle,
1455 callback As EnumerateMetafileProc) As Gdiplus.Status
1456
1457 Return EnumerateMetafile(metafile, destRect, callback, 0, 0)
1458 End Function
1459
1460 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destRect As /*Const*/ Rectangle,
1461 callback As EnumerateMetafileProc, callbackData As VoidPtr) As Gdiplus.Status
1462
1463 Return EnumerateMetafile(metafile, destRect, callback, callbackData, 0)
1464 End Function
1465
1466 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destRect As /*Const*/ Rectangle,
1467 callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
1468
1469 Dim nativeImage As /*Const*/ *GpMetafile
1470 If VarPtr(metafile) <> 0 Then
1471 nativeImage = metafile.NativeImage
1472 Else
1473 nativeImage = 0
1474 End If
1475
1476 Return SetStatus(GdipEnumerateMetafileDestRectI(nativeGraphics,
1477 nativeImage, destRect, callback, callbackData, ImageAttributes.Native(imageAttributes)))
1478 End Function
1479
1480 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoints As /*Const*/ *PointF, count As Long,
1481 callback As EnumerateMetafileProc) As Gdiplus.Status
1482
1483 Return EnumerateMetafile(metafile, destPoints, count, callback, 0, 0)
1484 End Function
1485
1486 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoints As /*Const*/ *PointF, count As Long,
1487 callback As EnumerateMetafileProc, callbackData As VoidPtr) As Gdiplus.Status
1488
1489 Return EnumerateMetafile(metafile, destPoints, count, callback, callbackData, 0)
1490 End Function
1491
1492 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoints As /*Const*/ *PointF, count As Long,
1493 callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
1494
1495 Dim nativeImage As /*Const*/ *GpMetafile
1496 If VarPtr(metafile) <> 0 Then
1497 nativeImage = metafile.NativeImage
1498 Else
1499 nativeImage = 0
1500 End If
1501
1502 Return SetStatus(GdipEnumerateMetafileDestPoints(nativeGraphics,
1503 nativeImage,destPoints, count, callback, callbackData, ImageAttributes.Native(imageAttributes)))
1504 End Function
1505
1506 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoints As /*Const*/ *Point, count As Long,
1507 callback As EnumerateMetafileProc) As Gdiplus.Status
1508
1509 Return EnumerateMetafile(metafile, destPoints, count, callback, 0, 0)
1510 End Function
1511
1512 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoints As /*Const*/ *Point, count As Long,
1513 callback As EnumerateMetafileProc, callbackData As VoidPtr) As Gdiplus.Status
1514
1515 Return EnumerateMetafile(metafile, destPoints, count, callback, callbackData, 0)
1516 End Function
1517
1518 Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoints As /*Const*/ *Point, count As Long,
1519 callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
1520
1521 Dim nativeImage As /*Const*/ *GpMetafile
1522 If VarPtr(metafile) <> 0 Then
1523 nativeImage = metafile.NativeImage
1524 Else
1525 nativeImage = 0
1526 End If
1527
1528 Return SetStatus(GdipEnumerateMetafileDestPointsI(nativeGraphics,
1529 nativeImage,destPoints, count, callback, callbackData, ImageAttributes.Native(imageAttributes)))
1530 End Function
1531
1532 Function EnumerateMetafile(metafile As /*Const*/ Metafile,
1533 destPoint As /*Const*/ PointF, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit,
1534 callback As EnumerateMetafileProc) As Gdiplus.Status
1535
1536 Return EnumerateMetafile(metafile, destPoint, count, srcUnit, callback, 0, 0)
1537 End Function
1538
1539 Function EnumerateMetafile(metafile As /*Const*/ Metafile,
1540 destPoint As /*Const*/ PointF, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit,
1541 callback As EnumerateMetafileProc, callbackData As VoidPtr) As Gdiplus.Status
1542
1543 Return EnumerateMetafile(metafile, destPoint, srcRect, srcUnit, callback, callbackData, 0)
1544 End Function
1545
1546 Function EnumerateMetafile(metafile As /*Const*/ Metafile,
1547 destPoint As /*Const*/ PointF, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit,
1548 callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
1549
1550 Dim nativeImage As /*Const*/ *GpMetafile
1551 If VarPtr(metafile) <> 0 Then
1552 nativeImage = metafile.NativeImage
1553 Else
1554 nativeImage = 0
1555 End If
1556
1557 Return SetStatus(GdipEnumerateMetafileSrcRectDestPoint(nativeGraphics, _
1558 nativeImage, destPoint, srcRect, srcUnit, callback, callbackData, ImageAttributes.Native(imageAttributes)))
1559 End Function
1560
1561 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1562 destPoint As /*Const*/ Point, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
1563 callback As EnumerateMetafileProc) As Gdiplus.Status
1564
1565 Return EnumerateMetafile(metafile, destPoint, count, srcUnit, callback, 0, 0)
1566 End Function
1567
1568 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1569 destPoint As /*Const*/ Point, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
1570 callback As EnumerateMetafileProc, callbackData As VoidPtr) As Gdiplus.Status
1571
1572 Return EnumerateMetafile(metafile, destPoint, srcRect, srcUnit, callback, callbackData, 0)
1573 End Function
1574
1575 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1576 destPoint As /*Const*/ Point, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
1577 callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
1578
1579 Dim nativeImage As /*Const*/ *GpMetafile
1580 If VarPtr(metafile) <> 0 Then
1581 nativeImage = metafile.NativeImage
1582 Else
1583 nativeImage = 0
1584 End If
1585
1586 Return SetStatus(GdipEnumerateMetafileSrcRectDestPointI(nativeGraphics, _
1587 nativeImage, destPoint, srcRect, srcUnit, callback, callbackData, ImageAttributes.Native(imageAttributes)))
1588 End Function
1589
1590 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1591 destRect As /*Const*/ RectangleF, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit, _
1592 callback As EnumerateMetafileProc) As Gdiplus.Status
1593
1594 Return EnumerateMetafile(metafile, destRect, count, srcUnit, callback, 0, 0)
1595 End Function
1596
1597 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1598 destRect As /*Const*/ RectangleF, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit, _
1599 callback As EnumerateMetafileProc, callbackData As VoidPtr) As Gdiplus.Status
1600
1601 Return EnumerateMetafile(metafile, destRect, srcRect, srcUnit, callback, callbackData, 0)
1602 End Function
1603
1604 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1605 destRect As /*Const*/ RectangleF, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit, _
1606 callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
1607
1608 Dim nativeImage As /*Const*/ *GpMetafile
1609 If VarPtr(metafile) <> 0 Then
1610 nativeImage = metafile.NativeImage
1611 Else
1612 nativeImage = 0
1613 End If
1614
1615 Return SetStatus(GdipEnumerateMetafileSrcRectDestRect(nativeGraphics, _
1616 nativeImage, destRect, srcRect, srcUnit, callback, callbackData, ImageAttributes.Native(imageAttributes)))
1617 End Function
1618
1619 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1620 destRect As /*Const*/ Rectangle, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
1621 callback As EnumerateMetafileProc) As Gdiplus.Status
1622
1623 Return EnumerateMetafile(metafile, destRect, srcRect, srcUnit, callback, 0, 0)
1624 End Function
1625
1626 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1627 destRect As /*Const*/ Rectangle, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
1628 callback As EnumerateMetafileProc, callbackData As VoidPtr) As Gdiplus.Status
1629
1630 Return EnumerateMetafile(metafile, destRect, srcRect, srcUnit, callback, callbackData, 0)
1631 End Function
1632
1633 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1634 destRect As /*Const*/ Rectangle, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
1635 callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
1636
1637 Dim nativeImage As /*Const*/ *GpMetafile
1638 If VarPtr(metafile) <> 0 Then
1639 nativeImage = metafile.NativeImage
1640 Else
1641 nativeImage = 0
1642 End If
1643
1644 Return SetStatus(GdipEnumerateMetafileSrcRectDestRectI(nativeGraphics, _
1645 nativeImage, destRect, srcRect, srcUnit, callback, callbackData, ImageAttributes.Native(imageAttributes)))
1646 End Function
1647
1648 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1649 destPoints As /*Const*/ *PointF, count As Long, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit, _
1650 callback As EnumerateMetafileProc) As Gdiplus.Status
1651
1652 Return EnumerateMetafile(metafile, destPoints, count, srcRect, srcUnit, callback, 0, 0)
1653 End Function
1654
1655 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1656 destPoints As /*Const*/ *PointF, count As Long, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit, _
1657 callback As EnumerateMetafileProc, callbackData As VoidPtr) As Gdiplus.Status
1658
1659 Return EnumerateMetafile(metafile, destPoints, count, srcRect, srcUnit, callback, callbackData, 0)
1660 End Function
1661
1662 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1663 destPoints As /*Const*/ *PointF, count As Long, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit, _
1664 callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
1665
1666 Dim nativeImage As /*Const*/ *GpMetafile
1667 If VarPtr(metafile) <> 0 Then
1668 nativeImage = metafile.NativeImage
1669 Else
1670 nativeImage = 0
1671 End If
1672
1673 Return SetStatus(GdipEnumerateMetafileSrcRectDestPoints(nativeGraphics, _
1674 nativeImage, destPoints, count, srcRect, srcUnit, callback, callbackData, ImageAttributes.Native(imageAttributes)))
1675 End Function
1676
1677 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1678 destPoints As /*Const*/ *Point, count As Long, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
1679 callback As EnumerateMetafileProc) As Gdiplus.Status
1680
1681 Return EnumerateMetafile(metafile, destPoints, count, srcRect, srcUnit, callback, 0, 0)
1682 End Function
1683
1684 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1685 destPoints As /*Const*/ *Point, count As Long, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
1686 callback As EnumerateMetafileProc, callbackData As VoidPtr) As Gdiplus.Status
1687
1688 Return EnumerateMetafile(metafile, destPoints, count, srcRect, srcUnit, callback, callbackData, 0)
1689 End Function
1690
1691 Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
1692 destPoints As /*Const*/ *Point, count As Long, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
1693 callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Gdiplus.Status
1694
1695 Dim nativeImage As /*Const*/ *GpMetafile
1696 If VarPtr(metafile) <> 0 Then
1697 nativeImage = metafile.NativeImage
1698 Else
1699 nativeImage = 0
1700 End If
1701
1702 Return SetStatus(GdipEnumerateMetafileSrcRectDestPointsI(nativeGraphics, nativeImage, _
1703 destPoints, count, srcRect, srcUnit, callback, callbackData, ImageAttributes.Native(imageAttributes)))
1704 End Function
1705
1706 Function SetClip(g As /*Const*/ Graphics) As Gdiplus.Status
1707 Return SetClip(g, CombineMode.Replace)
1708 End Function
1709
1710 Function SetClip(rc As /*Const*/ RectangleF) As Gdiplus.Status
1711 Return SetStatus(GdipSetClipRect(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, CombineMode.Replace))
1712 End Function
1713
1714 Function SetClip(rc As /*Const*/ Rectangle) As Gdiplus.Status
1715 Return SetStatus(GdipSetClipRectI(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, CombineMode.Replace))
1716 End Function
1717
1718 Function SetClip(path As /*Const*/ GraphicsPath) As Gdiplus.Status
1719 Return SetStatus(GdipSetClipPath(nativeGraphics, path->nativePath, CombineMode.Replace))
1720 End Function
1721
1722 Function SetClip(region As /*Const*/ Region) As Gdiplus.Status
1723 Return SetStatus(GdipSetClipRegion(nativeGraphics, region->nativeRegion, CombineMode.Replace))
1724 End Function
1725
1726 Function SetClip(g As /*Const*/ Graphics, combineMode As CombineMode) As Gdiplus.Status
1727 Return SetStatus(GdipSetClipGraphics(nativeGraphics, g->nativeGraphics, combineMode))
1728 End Function
1729
1730 Function SetClip(rc As /*Const*/ RectangleF, combineMode As CombineMode) As Gdiplus.Status
1731 Return SetStatus(GdipSetClipRect(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, combineMode))
1732 End Function
1733
1734 Function SetClip(rc As /*Const*/ Rectangle, combineMode As CombineMode) As Gdiplus.Status
1735 Return SetStatus(GdipSetClipRectI(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, combineMode))
1736 End Function
1737
1738 Function SetClip(path As /*Const*/ GraphicsPath, combineMode As CombineMode) As Gdiplus.Status
1739 Return SetStatus(GdipSetClipPath(nativeGraphics, path->nativePath, combineMode))
1740 End Function
1741
1742 Function SetClip(region As /*Const*/ Region, combineMode As CombineMode) As Gdiplus.Status
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
1750 Function SetClip(hrgn As HRGN, combineMode As CombineMode /* = CombineModeReplace*/) As Gdiplus.Status
1751 Return SetStatus(GdipSetClipHrgn(nativeGraphics, hrgn, combineMode))
1752 End Function
1753
1754 Function IntersectClip(rc As /*Const*/ RectangleF) As Gdiplus.Status
1755 Return SetStatus(GdipSetClipRect(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, CombineMode.Intersect))
1756 End Function
1757
1758 Function IntersectClip(rc As /*Const*/ Rectangle) As Gdiplus.Status
1759 Return SetStatus(GdipSetClipRectI(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, CombineMode.Intersect))
1760 End Function
1761
1762 Function IntersectClip(region As /*Const*/ Region) As Gdiplus.Status
1763 Return SetStatus(GdipSetClipRegion(nativeGraphics, region->nativeRegion, CombineMode.Intersect))
1764 End Function
1765
1766 Function ExcludeClip(rc As /*Const*/ RectangleF) As Gdiplus.Status
1767 Return SetStatus(GdipSetClipRect(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, CombineMode.Exclude))
1768 End Function
1769
1770 Function ExcludeClip(rc As /*Const*/ Rectangle) As Gdiplus.Status
1771 Return SetStatus(GdipSetClipRectI(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, CombineMode.Exclude))
1772 End Function
1773
1774 Function ExcludeClip(region As /*Const*/ Region) As Gdiplus.Status
1775 Return SetStatus(GdipSetClipRegion(nativeGraphics, region->nativeRegion, CombineMode.Exclude))
1776 End Function
1777
1778 Function ResetClip() As Gdiplus.Status
1779 Return SetStatus(GdipResetClip(nativeGraphics))
1780 End Function
1781
1782 Function TranslateClip(dx As Single, dy As Single) As Gdiplus.Status
1783 Return SetStatus(GdipTranslateClip(nativeGraphics, dx, dy))
1784 End Function
1785
1786 Function TranslateClip(dx As Long, dy As Long) As Gdiplus.Status
1787 Return SetStatus(GdipTranslateClipI(nativeGraphics, dx, dy))
1788 End Function
1789
1790 Const Function GetClip(region As Region) As Gdiplus.Status
1791 Return SetStatus(GdipGetClip(nativeGraphics, region->nativeRegion))
1792 End Function
1793
1794 Const Function GetClipBounds(rc As RectangleF) As Gdiplus.Status
1795 Return SetStatus(GdipGetClipBounds(nativeGraphics, rc))
1796 End Function
1797
1798 Const Function GetClipBounds(rc As Rectangle) As Gdiplus.Status
1799 Return SetStatus(GdipGetClipBoundsI(nativeGraphics, rc))
1800 End Function
1801
1802 Const Function GetVisibleClipBounds(rc As RectangleF) As Gdiplus.Status
1803 Return SetStatus(GdipGetVisibleClipBounds(nativeGraphics, rc))
1804 End Function
1805
1806 Const Function GetVisibleClipBounds(rc As Rectangle) As Gdiplus.Status
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
1816 Const Function IsVisible(pt As /*Const*/ Point) As BOOL
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
1826 Const Function IsVisible(rc As /*Const*/ Rectangle) As BOOL
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
1836 Const Function IsVisible(point As /*Const*/ PointF) As BOOL
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
1846 Const Function IsVisible(rect As /*Const*/ RectangleF) As BOOL
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
1860 Function BeginContainer(dstrect As /*Const*/ RectangleF, srcrect As /*Const*/ RectangleF, unit As GraphicsUnit) As GraphicsContainer
1861 Dim state As GraphicsContainer
1862 SetStatus(GdipBeginContainer(nativeGraphics, dstrect, srcrect, unit, state))
1863 Return state
1864 End Function
1865
1866 Function BeginContainer(dstrect As /*Const*/ Rectangle, srcrect As /*Const*/ Rectangle, unit As GraphicsUnit) As GraphicsContainer
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
1878 Function EndContainer(state As GraphicsContainer) As Gdiplus.Status
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
1892 Const Function GetLastStatus() As Gdiplus.Status
1893 Dim lastStatus = lastResult
1894 lastResult = Gdiplus.Status.Ok
1895 Return lastStatus
1896 End Function
1897
1898Private
1899' Sub Graphics(gr As Graphics)
1900' Debug
1901' End Sub
1902
1903Protected
1904 Sub Graphics(graphics As *Gdiplus.GpGraphics)
1905 lastResult = Gdiplus.Status.Ok
1906 SetNativeGraphics(graphics)
1907 End Sub
1908
1909 Sub SetNativeGraphics(graphics As *Gdiplus.GpGraphics)
1910 This.nativeGraphics = graphics
1911 End Sub
1912
1913 Const Function SetStatus(status As Gdiplus.Status) As Gdiplus.Status
1914 If status <> Gdiplus.Status.Ok Then
1915 lastResult = status
1916 End If
1917 Return status
1918 End Function
1919
1920 Const Function GetNativeGraphics() As *Gdiplus.GpGraphics
1921 Return This.nativeGraphics
1922 End Function
1923
1924 Function GetNativePen(pen As /*Const*/ *Pen) As *GpPen
1925 Return pen->nativePen
1926 End Function
1927
1928Protected
1929 nativeGraphics As *Gdiplus.GpGraphics
1930 lastResult As /*Mutable*/ Gdiplus.Status
1931End Class
1932
1933End Namespace 'Drawing
1934End Namespace 'System
1935
1936#endif
Note: See TracBrowser for help on using the repository browser.