source: trunk/Include/Classes/System/Drawing/Graphics.ab@ 422

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

Object.ReferenceEqualsを追加

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