主题:求助,关于piantpicture的问题
各位大虾,小弟想做一个简单的动画,在一个form上放两个大小相同的picture,实现的效果是picture1逐渐从左到右覆盖picture2,但是小弟写的程序只能实现最左边第一小部分的覆盖,不能从左到右逐渐完成,各位看看有什么问题,小弟谢过了。
Private Sub Command1_Click()
Timer1.Enabled = True
Timer1.Interval = 10
h=0
t=2
End Sub
Private Sub Timer1_Timer()
If h < Picture2.ScaleWidth Then
Picture2.PaintPicture Picture1.Picture, h, 0, t, Picture2.ScaleHeight, h, 0, t, Picture1.ScaleHeight, vbSrcCopy
h=h+t
Else
Timer1.Enabled = False
End Sub
Private Sub Command1_Click()
Timer1.Enabled = True
Timer1.Interval = 10
h=0
t=2
End Sub
Private Sub Timer1_Timer()
If h < Picture2.ScaleWidth Then
Picture2.PaintPicture Picture1.Picture, h, 0, t, Picture2.ScaleHeight, h, 0, t, Picture1.ScaleHeight, vbSrcCopy
h=h+t
Else
Timer1.Enabled = False
End Sub