I want to extract all frames(images) of an animated .gif
file as bitmap
or Drawable
or any common type of image and store all images in an array in android. How i do it?
please help me.
Asked
Active
Viewed 2,293 times
7

Saeid Z
- 387
- 3
- 17
-
What do you mean by "frames"? Are you talking about animated gifs? – Code-Apprentice May 14 '17 at 15:11
-
@Code-Apprentice Yes i mean is animated gif. and frames is all image that show in animated gif file. – Saeid Z May 14 '17 at 15:23
-
1`android.graphics.Movie` – pskink May 14 '17 at 15:24
-
1@pskink please explain me clearly what i do it? Thanks. – Saeid Z May 14 '17 at 15:26
-
1use `Movie` class for decoding and drawing your animated gif content – pskink May 14 '17 at 15:28
-
1@pskink I have to read 'android.graphics.Movie' documentation in android.com? only read that documentation enough? – Saeid Z May 14 '17 at 15:37
-
1What do you want to do with the frames of an animated gif? Are you just going to show them? – Code-Apprentice May 14 '17 at 15:40
-
1If you want to display an animated gif in your app, I suggest [googling for it](https://www.google.com/search?q=android+animated+gif&oq=android+animated&aqs=chrome.1.69i57j0l3.8734j0j4&client=ms-android-verizon&sourceid=chrome-mobile&ie=UTF-8#xxri=4). – Code-Apprentice May 14 '17 at 15:44
-
1@Code-Apprentice I want to get all frames of an animated gif and save that frames in an array and show it manually by next and previous buttons. – Saeid Z May 14 '17 at 15:47
-
1You either need to find a library that will do this or learn about the gif format and write your own. – Code-Apprentice May 14 '17 at 15:58
-
1@Code-Apprentice thanks. – Saeid Z May 14 '17 at 16:01
-
1so after reading `android.graphics.Movie` documentation, what problems did you get in your code? – pskink May 14 '17 at 16:38
-
1@pskink I don't understand Movie class from this main documantation [android.graphics.Movie](https://developer.android.com/reference/android/graphics/Movie.html) it is very summarized! – Saeid Z May 14 '17 at 17:13
-
1what you did not understand? how to create a `Movie` object? how to draw it? – pskink May 14 '17 at 17:34
-
1@pskink How to i get frames after decode my gif file to an **Movie** object? – Saeid Z May 14 '17 at 17:39
-
1simply draw them – pskink May 14 '17 at 17:40
-
1@pskink how to draw them? draw want canvas? how to i create canvas? – Saeid Z May 14 '17 at 17:51
-
1@pskink draw want canvas? how to i create canvas? – Saeid Z May 14 '17 at 18:04
-
1by calling `new Canvas()` constructor? did you read `android.graphics.Canvas` documentation? – pskink May 14 '17 at 18:05
-
1I know I'm super late to this party, but this stackoverflow thread may help: https://stackoverflow.com/questions/8933893/convert-each-animated-gif-frame-to-a-separate-bufferedimage – Ryan Pfister Dec 11 '18 at 13:20