Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9019831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:52:03+00:00 2026-06-16T04:52:03+00:00

I have an image with different frame to be displayed, like the following: As

  • 0

I have an image with different frame to be displayed, like the following:

Multiframe gif

As you can see that image has three frames, the full heart, half heart and empty space.

Now i need to only one frame of the three. I’m just wondering if there is a method to do that using a single gif in android sdk.
For example in several language there is a method like:

canvas.drawImage(xpos,ypos,xwidth,xheight,gifx,gify,gifwidth,gifheight)

where gifx,gify,gifwidth,gifheight are the coordinates and size of the selected frame.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:52:04+00:00Added an answer on June 16, 2026 at 4:52 am

    Ok i answer myself, i just found a solution.

    In order to draw a multiframe image the following method can be used:

    public void drawBitmap (Bitmap bitmap, Rect src, RectF dst, Paint paint)
    

    Where:

    • Bitmap bitamp is the Bitmap resource obtained with BitmapFactory.decodeResource (or via your preferred method).
    • Rect src is the frame to be shown (it can be null)
    • Rect dst rhe rectangle that the bitmap will be scaled/translated to fit into (it can be null)
    • Paint paint used to draw the bitmap (it can be null)

    Another way (that i didn’t tested) could be using BitmapRegionDecoder first of all a new instance of the object must be created using BitmapRegionDecoder.newInstance(…)
    and then the selected region of bitmap to be shown could be obtained with the method:

    public Bitmap decodeRegion (Rect rect, BitmapFactory.Options options)
    

    Where rect is the selected region to be shown. For more info on BitmapRegionDecoder:
    http://developer.android.com/reference/android/graphics/BitmapRegionDecoder.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an image in WPF that I would like to have display different
I have searched on the web for software that batch convert image at different
I have several different content type nodes (videos, image galleries, stories...) that I would
I have written this code to see different image states... UIButton *btnComment = [UIButton
I have the following GIF image file: I want to extract its frames (using
I have image A and image B. They are located in the different places
I have applied Two different Image Enhancement Algorithm on a particular Image and got
I have an image map with two different area shape attributes. I want to
i have one image in my html and i have 5 different link, i
I have this code to identify two different image map shape attributes. What I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.