谁能把这段代码详细解释下??谢谢

来源:百度知道 编辑:UC知道 时间:2024/05/18 02:29:05
Sub MoveForm(Begin As Long, XEnd As Long, Fuhao As String, Zhou As String)
Dim i As Single, LS As Single
Picture1.Cls
If Zhou = "y" Then
For i = Begin To XEnd Step Fuhao
BitBlt Picture1.hdc, 0, i, Picture1.Width, _
Picture1.Height, Hmemdc, 0, 0, vbSrcCopy
'延时
delay 0.005
Next i
End If

If Zhou = "x" Then
For i = Begin To XEnd Step Fuhao
BitBlt Picture1.hdc, i, 0, Picture1.Width, _
Picture1.Height, Hmemdc, 0, 0, vbSrcCopy
'延时
delay 0.005
Next i
End If

DeleteObject Hmemdc
DeleteObject OldDc
End Sub
这是段sub声明的东西

Sub MoveForm(Begin As Long, XEnd As Long, Fuhao As String, Zhou As String)
Dim i As Single, LS As Single
Picture1.Cls 'picture1定义为画布
If Zhou = "y" Then '判断参数为y
For i = Begin To XEnd Step Fuhao
BitBlt Picture1.hdc, 0, i, Picture1.Width, _
Picture1.Height, Hmemdc, 0, 0, vbSrcCopy '在目标bit图中每列每隔Fuhao点复制为Hmemdc中的0,0点
'延时
delay 0.005
Next i
End If

If Zhou = "x" Then '判断参数为x
For i = Begin To XEnd Step Fuhao
BitBlt Picture1.hdc, i, 0, Picture1.Width, _
Picture1.Height, Hmemdc, 0, 0, vbSrcCopy '在目标bit图中每行每隔Fuhao点复制为Hmemdc中的0,0点
'延时
delay 0.005
Next i
End If

DeleteObject Hmemdc
DeleteObject OldDc '删除对象
End Sub
'BitBlt 目标hDC, 目标X, 目标Y, 图像高, 图像宽, 源hDC, 源X, 源Y, 光栅运算常数

vb