Hi guys, I'm trying to write a function that will wrap an image (scroll it in one direction and wrap it around to the other side).
I've got this:
But it's slow as molasses in January.
Is there a way to speed this code up?
I've got this:
Function WrapImage(img:TImage, frame = 0, stepsize = 20, dir = 1) Local w:Int = img.Width Local h:Int = img.Height Local tStep:TImage Local tOther:Timage Cls DrawImage img,0,0,0 Select dir Case 1 'Left to Right tStep = CreateImage(stepsize,h) tOther = CreateImage(w - stepsize,h) GrabImage(tStep,w - stepsize,0) GrabImage(tOther,0,0) Cls DrawImage tStep,0,0 DrawImage tOther,stepsize,0 GrabImage(img,0,0) End Select End Function
But it's slow as molasses in January.
Is there a way to speed this code up?