As a startingpoint for your experiments:
|
Jabaco Source
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
Option Explicit
Import java#awt
Import java#awt#geom
Public Sub Command1_Click()
' Picture1 is a control of type PictureBox
myPaint Picture1.Parent.getGraphics()
End Sub
Public Sub myPaint(g As Graphics)
Dim g2 As Graphics2D = Cast(g, Graphics2D)
Call g2.setStroke(New BasicStroke(2.0))
Call g2.draw(New Rectangle2D$Double(5, 5, 50, 20))
Call g2.setStroke(New BasicStroke(4.0))
Call g2.draw(New RoundRectangle2D$Double(5, 30, 50, 20, 5, 5))
Call g2.setStroke(New BasicStroke(2.0))
Call g2.draw(New Arc2D$Double(5, 55, 50, 20, 90, 135, Arc2D.OPEN))
Call g2.draw(New Ellipse2D$Double(5, 80, 50, 20))
End Sub
|
Jabaco had problems with nested classes in the beginning.
Look
here for how to solve that.
The syntax is java#awt#geom#Rectangle2D$Double . Note the "$" sign as separator for nested classes.
You might want to use the search facility of this forum to find the other Graphics2D and Cast samples.
Happy experimenting!
A1880