求助各位大虾,关于图片运算的小动画
小弟新手,刚接触vb,想做一个简单的动画,就是一个form中放两个picture,均为黑白bmp图像,然后让其中一个图片缓缓滑向另一个图片,从开始重叠到完全重叠的过程中重叠部分的像素间进行异或运算,以下是自己的代码,但是只能移动到刚接触,重合的动作不能完成,各位高手看看是什么问题,或者哪位大侠知道怎么写告诉我下,以下是代码:Private Sub Command1_Click()
Timer1.Enabled = True
Timer1.Interval = 10
Picture1.Move 0, 0
End Sub
Private Sub Timer1_Timer()
Static x As Single
Static y As Single
Picture1.Move x, y
x = x + 10: y = y
If x = 1740 Then
Timer1.Enabled = False
Timer2.Enabled = True
End If
End Sub
Private Sub Timer2_Timer()
Dim t As Single
Dim h As Single
h = 0
t = 10
Timer2.Interval = 10
If h < Picture2.ScaleWidth Then
Picture2.PaintPicture Picture1.Picture, h, 0, t, Picture2.ScaleHeight, h, 0, t, Picture1.ScaleHeight, vbSrcInvert
h = h + t
Else
Timer2.Enabled = False
End Sub