问题
I have series of images for animation, say Image 1 to 1000.
I plan to show these images in a sequence at uniform rate to show animation.
I want to know if there is a way by which I can accelerate the animation? Can I accelerate the rate of showing images?
Please let me know.
回答1:
Use GIF
images to play animation. Playing GIF files with OpenGLES is the good practice and I believe it is the best way to play animation.
Follow the Git Link: https://github.com/jamesu/glgif
:)
回答2:
There is so many way but simplest way is to Pass image array to UIImageView
property animationImages
. then call start Animating
to start the animation and stopAnimating
method of UIImageView
to stop the animation.
UIImageView also has the property animationDuration
which allow to set the duration for every Images.
you can also render Images using OpenGL which is much faster compare to UIImageView. because OpenGL use the GPU.
回答3:
The solution is to skip frames of the animation. So, if you want to double the speed you will draw the 0,2,4,6 frames or 1,3,5,7 of the animation sequence. If you want to triple the speed you will draw 0,3,6,9 etc and so on. This is frame skipping :)
来源:https://stackoverflow.com/questions/8652471/how-do-we-accelerate-animation-if-we-are-using-images-in-iphone-sdk