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

前端之家收集整理的这篇文章主要介绍了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

原文链接:https://www.f2er.com/vb/260417.html

猜你在找的VB相关文章