VB工程--百例43--图形绘制

Option Explicit

Private Sub Command1_Click()
picture1.Cls
picture1.Line (picture1.ScaleLeft + 100, picture1.ScaleTop + 100)- _
(picture1.ScaleWidth - 100, picture1.ScaleHeight - 100), , B 以对角坐标绘制矩形
End Sub要绘制矩形,需要有参数B或BF,其中的B表示对角坐标绘制矩形,BF表示用矩形边框的颜色来填充矩形内部

Private Sub Command2_Click() 绘制三角形
picture1.Cls
picture1.Line (picture1.ScaleWidth / 2, 0)- _
(0, picture1.ScaleHeight / 2)
picture1.Line (picture1.ScaleWidth / 2, 0)- _
(picture1.ScaleWidth, picture1.ScaleHeight / 2)
picture1.Line (0, picture1.ScaleHeight / 2)- _
(picture1.ScaleWidth, picture1.ScaleHeight / 2)

End Sub

Private Sub Command3_Click() 绘制直线
picture1.Cls
picture1.Line (picture1.ScaleLeft, picture1.ScaleTop)- _
(picture1.ScaleWidth, picture1.ScaleHeight)
End Sub

VB工程--百例43--图形绘制VB工程--百例43--图形绘制VB工程--百例43--图形绘制

你可能感兴趣的:(vb)