Draw.Line (gb.qt4)
Static Sub Line ( X1 As Integer, Y1 As Integer, X2 As Integer, Y2 As Integer )
画一条线。
Examples
' 该示例会在窗体上绘制一条红线。
' 开始一个新的图形工程并在窗体上放置一个按钮来试验这个示例。
PUBLIC SUB Button1_Click()
Draw.Begin(ME)
Draw.LineWidth = 20
Draw.ForeColor = Color.Red
Draw.Line(50, 100, 200, 150)
Draw.End
END
' 该示例将用白色绘制一个'X'。
' 开始一个新的图形工程并在窗体上放置一个按钮来试验这个示例。
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
' 该示例将在窗体上绘制一个红黄线交替的式样。
' 开始一个新的图形工程并在窗体上放置一个按钮来试验这个示例。
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
}