Private x0, y0, x1, y1 As Int
x0 = 50
y0 = 450
x1 = 200
y1 = 450
g = "linear-gradient(from " & x0 & "px " & y0 & "px to " & x1 & "px " & y1 & "px, #ff0000 0%, 0x0000ff 100%)"
cvsScreen1.DrawLine(x0, y0, x1, y1, GetPaint(g), 10)
End Sub
'Returns the paint object according to the color string
Public Sub GetPaint(Color As String) As Paint
Private joPaint As JavaObject
joPaint = joPaint.InitializeStatic("javafx.scene.paint.Paint")
Return joPaint.RunMethod("valueOf", Array As Object(Color))
End Sub