display animated gif image

All your problems with Audio, Video and Images.

display animated gif image

Postby prachi_584 » Tue Nov 04, 2008 6:36 am

Hi,

How to display gif image? I can only see the image.. but its not getting animated..
If i see the same image in IE or firefox it is getting animated... Is there any way to show it on android phone..?

Thanking you in advance..
User avatar
prachi_584
Freshman
Freshman
 
Posts: 6
Joined: Tue Nov 04, 2008 6:28 am

Top

Postby matt.bushell » Tue Nov 04, 2008 12:27 pm

You will have to use a browser Widget and create a web page to show the GIF, im new to Android but there probably is a widget.

This is a common question asked by new game developers. I assume it is some sort of animation for a game. An animated GIF is simple a set of frames stored in a file, what you really want to do is to get a program from download.com or somewhere that can split your gif into separate files for each frame.

frame1.png
frame2.png
frame3.png
frame4.png

Load these files as an array of Bitmaps, then display them in sequence.

canvas.drawBitmap(frames[i], x, y, null);
i++;

Each time through your paint loop the next frame will be drawn.
Android developer droid v1.0 - www.bet2go.com
User avatar
matt.bushell
Freshman
Freshman
 
Posts: 2
Joined: Tue Nov 04, 2008 11:43 am

Re: display animated gif image

Postby shyama » Fri May 27, 2011 12:53 pm

It's also possible to display such an animation in an image view by splitting up the animation into different frames and then adding these frames to an android frame-by-frame animation. I've found this tutorial quite useful which describes how to use this mechanism: http://app-solut.com/2011/05/playing-an ... n-android/
shyama
Freshman
Freshman
 
Posts: 4
Joined: Fri Mar 18, 2011 2:19 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 8 guests