谁帮我解释下这个VB是怎么画图的?

来源:百度知道 编辑:UC知道 时间:2024/05/17 18:05:52
请高手帮看下下面这VB程序~~~没看懂是怎么是实现画图的~~~高手解释下~~~谢谢~~~
Private Sub colorPic(x1 As Integer, x2 As Integer, Y1 As Double, Y2 As Double, dblArr() As Double, intArr() As Integer)
Picture1.Cls
Picture1.ForeColor = Picture1.BackColor
Picture1.Line (x2 + 1, Y2 + 0.25 * (Y2 - Y1))-(x1 - 1, -50), , BF
Picture1.ForeColor = black
Picture1.Visible = True

Picture1.Scale (x2 + 1, Y2 + 0.25 * (Y2 - Y1))-(x1 - 1, -50)

Dim dblArrTm As Double
For intI = Int(x1) To Int(x2)
dblArrTm = dblArr(1, intI)

Picture1.FillStyle = 0
If intArr(intI) = 1 Then
Picture1.Font = "Arial Narrow"
Picture1.CurrentX = intI + 0.2
Picture1.CurrentY = dblArrTm + 0.07 * (Y2 - Y1)
Picture1.Print "n=" & intI

Picture1.Line (intI - 0.2, 0)-(intI + 0.2, dblArrTm), , B
Picture1.FillStyle = 0

一句句解释啊?
楼主你是不是一点都没看?
scale是设置坐标系,因为picture控件的坐标系是和普通迪卡尔坐标系不同的,需要设置到我们常用的格式.
line就是画线了
其余的代码基本上都是设置picture控件的格式,颜色等等.
你看看相关的知识,这个代码很简单的.

没看明白呀

啥地方没看懂?