I'm trying to copy the image from Picture2 to Picture1 using PaintPicture method. I call PaintPicture several times to copy from Picture2 which changes it's picture each time I make the call. The 1st time the call works and the picture from Picture2 is copied to Picture1 but the 2nd time I call it fails on Run time error 5 - Invalid procedure call or argument.
Picture 1 is 216 pixels wide and Picture2 is 3 pixels wide. I draw some lines on Picture2. Now I want to copy this drawing over to Picture1 each time offsetting the copied image from Picture2 to Picture1 by 3 pixels (xPtr) so that each picture I draw on Picture2 is copied to Picture1 positioned to the right of the previous picture until Picture1 has all 72 3-pixel wide drawings to make one single picture.
If it works the first time what could be happening to make it fail the next time?
EDIT: Never mind. I see the problem. I have xPtr in the wrong argument
Code:
Static xPtr as Integer
'
'
Picture1.PaintPicture Picture2.Image, 0, 0, 3, 71, xPtr, 0, 3, 71, vbSrcCopy
'
'
xPtr = xPtr + 3
If it works the first time what could be happening to make it fail the next time?
EDIT: Never mind. I see the problem. I have xPtr in the wrong argument