comp • gb.qt4 • draw • line

Draw.Line (gb.qt4)

Static Sub Line ( X1 As Integer, Y1 As Integer, X2 As Integer, Y2 As Integer )

Draws a line.

Examples


' This example will draw a red line on the form. To try out this example,
' start a new graphics project and place a Button on the Form.

Public Sub Button1_Click()
Draw.Begin(Me)
Draw.LineWidth = 20
Draw.ForeColor = Color.Red
Draw.Line(50, 100, 200, 150)
Draw.End
End

' This example will draw a 'X' in white color. To try out this example,
' start a new graphics project and place a Button on the Form.

Public Sub Button1_Click()
Draw.Begin(Me)
Draw.LineWidth = 10
Draw.ForeColor = &hFFFFFF
Draw.Line(50, 50, 200, 200)
Draw.Line(50, 200, 200, 50)
Draw.End
End

' This example will draw a pattern of alternating red and yellow
' lines on the form. To try out this example, start a new graphics
' project and place a Button on the Form.

Public Sub Button1_Click()

Dim i, Bottom As Integer
Bottom = Me.Height

Draw.Begin(Me)
Draw.LineWidth = 4

For i = 0 To Bottom Step 8
Draw.ForeColor = Color.Yellow
Draw.Line(0, i, Me.Width, i)
Draw.ForeColor = Color.Red
Draw.Line(0, i + 4, Me.Width, i + 4)
Next
Draw.End

End

}