Changeset 701 for trunk/ab5.0/ablib/src/Classes/System/Drawing/Graphics.ab
- Timestamp:
- Apr 2, 2009, 5:27:22 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/ablib/src/Classes/System/Drawing/Graphics.ab
r700 r701 4 4 Namespace Drawing 5 5 6 Class Brush7 Public8 nativeBrush As *GpBrush9 End Class10 Class StringFormat11 Public12 nativeFormat As *GpStringFormat13 End Class14 Class Image15 Public16 nativeImage As *GpImage17 End Class18 6 Class ImageAttributes 19 7 Public … … 29 17 Class GraphicsPath 30 18 Public 19 Sub GraphicsPath(native As *GpPath) 20 nativePath = native 21 End Sub 22 Function NativePath() As *GpPath 23 End Function 31 24 nativePath As *GpPath 32 25 End Class … … 508 501 509 502 Sub FillRectangle(brush As Brush, x As Single, y As Single, width As Single, height As Single) 510 SetStatus(GdipFillRectangle(nativeGraphics, brush. nativeBrush, x, y, width, height))503 SetStatus(GdipFillRectangle(nativeGraphics, brush.NativeBrush, x, y, width, height)) 511 504 End Sub 512 505 513 506 Sub FillRectangles(brush As Brush, rects As *RectangleF, count As Long) 514 SetStatus(GdipFillRectangles(nativeGraphics,brush. nativeBrush,rects, count))507 SetStatus(GdipFillRectangles(nativeGraphics,brush.NativeBrush,rects, count)) 515 508 End Sub 516 509 … … 520 513 521 514 Sub FillRectangle(brush As Brush, x As Long, y As Long, width As Long, height As Long) 522 SetStatus(GdipFillRectangleI(nativeGraphics, brush. nativeBrush, x, y, width, height))515 SetStatus(GdipFillRectangleI(nativeGraphics, brush.NativeBrush, x, y, width, height)) 523 516 End Sub 524 517 525 518 Sub FillRectangles(brush As Brush, rects As *Rectangle, count As Long) 526 SetStatus(GdipFillRectanglesI(nativeGraphics, brush. nativeBrush, rects, count))519 SetStatus(GdipFillRectanglesI(nativeGraphics, brush.NativeBrush, rects, count)) 527 520 End Sub 528 521 … … 532 525 533 526 Sub FillPolygon(brush As Brush, points As *PointF, count As Long, fillMode As Drawing2D.FillMode) 534 SetStatus(GdipFillPolygon(nativeGraphics, brush. nativeBrush, points, count, fillMode))527 SetStatus(GdipFillPolygon(nativeGraphics, brush.NativeBrush, points, count, fillMode)) 535 528 End Sub 536 529 … … 540 533 541 534 Sub FillPolygon(brush As Brush, points As *Point, count As Long, fillMode As Drawing2D.FillMode) 542 SetStatus(GdipFillPolygonI(nativeGraphics, brush. nativeBrush, points, count, fillMode))535 SetStatus(GdipFillPolygonI(nativeGraphics, brush.NativeBrush, points, count, fillMode)) 543 536 End Sub 544 537 … … 548 541 549 542 Sub FillEllipse(brush As Brush, x As Single, y As Single, width As Single, height As Single) 550 SetStatus(GdipFillEllipse(nativeGraphics, brush. nativeBrush, x, y, width, height))543 SetStatus(GdipFillEllipse(nativeGraphics, brush.NativeBrush, x, y, width, height)) 551 544 End Sub 552 545 … … 556 549 557 550 Sub FillEllipse(brush As Brush, x As Long, y As Long, width As Long, height As Long) 558 SetStatus(GdipFillEllipseI(nativeGraphics, brush. nativeBrush, x, y, width, height))551 SetStatus(GdipFillEllipseI(nativeGraphics, brush.NativeBrush, x, y, width, height)) 559 552 End Sub 560 553 … … 564 557 565 558 Sub FillPie(brush As Brush, x As Single, y As Single, width As Single, height As Single, startAngle As Single, sweepAngle As Single) 566 SetStatus(GdipFillPie(nativeGraphics, brush. nativeBrush, x, y, width, height, startAngle, sweepAngle))559 SetStatus(GdipFillPie(nativeGraphics, brush.NativeBrush, x, y, width, height, startAngle, sweepAngle)) 567 560 End Sub 568 561 … … 572 565 573 566 Sub FillPie(brush As Brush, x As Long, y As Long, width As Long, height As Long, startAngle As Single, sweepAngle As Single) 574 SetStatus(GdipFillPieI(nativeGraphics, brush. nativeBrush, x, y, width, height, startAngle, sweepAngle))567 SetStatus(GdipFillPieI(nativeGraphics, brush.NativeBrush, x, y, width, height, startAngle, sweepAngle)) 575 568 End Sub 576 569 … … 579 572 Throw New ArgumentNullException("brush or path or both") 580 573 End If 581 SetStatus(GdipFillPath(nativeGraphics, brush. nativeBrush, path.nativePath))574 SetStatus(GdipFillPath(nativeGraphics, brush.NativeBrush, path.nativePath)) 582 575 End Sub 583 576 584 577 Sub FillClosedCurve(brush As Brush, points As *PointF, count As Long) 585 SetStatus(GdipFillClosedCurve(nativeGraphics, brush. nativeBrush, points, count))578 SetStatus(GdipFillClosedCurve(nativeGraphics, brush.NativeBrush, points, count)) 586 579 End Sub 587 580 588 581 Sub FillClosedCurve(brush As Brush, points As *PointF, count As Long, fillMode As Drawing2D.FillMode) 589 SetStatus(GdipFillClosedCurve2(nativeGraphics, brush. nativeBrush, points, count, 0.5, fillMode))582 SetStatus(GdipFillClosedCurve2(nativeGraphics, brush.NativeBrush, points, count, 0.5, fillMode)) 590 583 End Sub 591 584 592 585 Sub FillClosedCurve(brush As Brush, points As *PointF, count As Long, fillMode As Drawing2D.FillMode, tension As Single) 593 SetStatus(GdipFillClosedCurve2(nativeGraphics, brush. nativeBrush, points, count, tension, fillMode))586 SetStatus(GdipFillClosedCurve2(nativeGraphics, brush.NativeBrush, points, count, tension, fillMode)) 594 587 End Sub 595 588 596 589 Sub FillClosedCurve(brush As Brush, points As *Point, count As Long) 597 SetStatus(GdipFillClosedCurveI(nativeGraphics, brush. nativeBrush, points, count))590 SetStatus(GdipFillClosedCurveI(nativeGraphics, brush.NativeBrush, points, count)) 598 591 End Sub 599 592 600 593 Sub FillClosedCurve(brush As Brush, points As *Point, count As Long, fillMode As Drawing2D.FillMode) 601 SetStatus(GdipFillClosedCurve2I(nativeGraphics, brush. nativeBrush, points, count, 0.5, fillMode))594 SetStatus(GdipFillClosedCurve2I(nativeGraphics, brush.NativeBrush, points, count, 0.5, fillMode)) 602 595 End Sub 603 596 604 597 Sub FillClosedCurve(brush As Brush, points As *Point, count As Long, fillMode As Drawing2D.FillMode, tension As Single) 605 SetStatus(GdipFillClosedCurve2I(nativeGraphics, brush. nativeBrush, points, count, tension, fillMode))598 SetStatus(GdipFillClosedCurve2I(nativeGraphics, brush.NativeBrush, points, count, tension, fillMode)) 606 599 End Sub 607 600 608 601 Sub FillRegion(brush As Brush, region As Region) 609 SetStatus(GdipFillRegion(nativeGraphics, brush. nativeBrush, region.nativeRegion))602 SetStatus(GdipFillRegion(nativeGraphics, brush.NativeBrush, region.nativeRegion)) 610 603 End Sub 611 604 … … 629 622 Sub DrawString(str As PCWSTR, length As Long, font As Font, brush As Brush, ByRef layoutRect As RectangleF, stringFormat = Nothing As StringFormat) 630 623 Dim nativeFont = getNativeFont(font) 631 Dim nativeFormat = getNativeStringFormat(stringFormat)624 Dim nativeFormat = GetNativeStringFormat(stringFormat) 632 625 Dim nativeBrush = getNativeBrush(brush) 633 626 SetStatus(GdipDrawString(nativeGraphics, str, length, nativeFont, layoutRect, nativeFormat, nativeBrush)) … … 739 732 Function measureString(str As PCWSTR, length As Long, font As Font, ByRef layoutRect As RectangleF, stringFormat As StringFormat, codepointsFitted As *Long, linesFilled As *Long) As SizeF 740 733 Dim nativeFont = getNativeFont(font) 741 Dim nativeFormat = getNativeStringFormat(stringFormat)734 Dim nativeFormat = GetNativeStringFormat(stringFormat) 742 735 Dim boundingBox As RectangleF 743 736 SetStatus(GdipMeasureString(nativeGraphics, str, length, nativeFont, layoutRect, nativeFormat, boundingBox, codepointsFitted, linesFilled)) … … 759 752 End If 760 753 Dim count As Long 761 SetStatus(GdipGetStringFormatMeasurableCharacterRangeCount(stringFormat. nativeFormat, count))754 SetStatus(GdipGetStringFormatMeasurableCharacterRangeCount(stringFormat.NativeFormat, count)) 762 755 Dim nativeRegions As **GpRegion 'ここで = GC_mallocとすると、エラーになる。 763 756 nativeRegions = GC_malloc(count * SizeOf(*GpRegion)) … … 771 764 Next 772 765 Dim nativeFont = getNativeFont(font) 773 SetStatus(GdipMeasureCharacterRanges(nativeGraphics, str, length, nativeFont, layoutRect, stringFormat. nativeFormat, count, nativeRegions))766 SetStatus(GdipMeasureCharacterRanges(nativeGraphics, str, length, nativeFont, layoutRect, stringFormat.NativeFormat, count, nativeRegions)) 774 767 End Function 775 768 … … 1224 1217 End Function 1225 1218 1226 Static Function getNativeStringFormat(sf As StringFormat) As *GpStringFormat1227 If ActiveBasic.IsNothing(sf) Then1228 getNativeStringFormat = 01229 Else1230 getNativeStringFormat = sf.nativeFormat1231 End If1232 End Function1233 1234 1219 Static Function getNativeBrush(br As Brush) As *GpBrush 1235 1220 If ActiveBasic.IsNothing(br) Then 1236 1221 getNativeBrush = 0 1237 1222 Else 1238 getNativeBrush = br. nativeBrush1223 getNativeBrush = br.NativeBrush 1239 1224 End If 1240 1225 End Function
Note:
See TracChangeset
for help on using the changeset viewer.