fr de es it nl pl pt pt_BR mk sq ca ar fa vi ja ru zh zh_TW eo
Home > comp > gb.qt > draw > line
 
Previous  Next  Edit  Rename  Undo  Refresh  Search  Administration 
-> 3.0
 
Documentation
History
 
Draw.Line (gb.qt)
Syntax
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