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 7677317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:23:44+00:00 2026-05-31T17:23:44+00:00

Im trying to create a moving back ground. My goal is to have a

  • 0

Im trying to create a moving back ground. My goal is to have a huge bitmap scrolling by itself making it seem as if its moving. but first i need to figure out how show only a part of the bitmap. Ive tried this code but have been unsucessful. Is the subset what im looking for in this situation? canvas.drawBitmap(bitmap, """subset"""src, dst, paint)

This is the method explanation
bitmap The bitmap to be drawn ======
src May be null. The subset of the bitmap to be drawn =======
dst The rectangle that the bitmap will be scaled/translated to fit into

  • 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-05-31T17:23:45+00:00Added an answer on May 31, 2026 at 5:23 pm
    Canvas.drawBitmap(Bitmap bitmap, Rect src, Rect dst, Paint paint);
    

    It allows us to specify a portion of the Bitmap to draw
    via the second parameter. The Rect class holds the top-left and bottom-right corner
    coordinates of a rectangle. When we specify a portion of the Bitmap via the src, we do it
    in the Bitmap’s coordinate system. If we specify null, the complete Bitmap will be used.
    The third parameter defines where the portion of the the Bitmap should be drawn to,
    again in the form of a Rect instance.
    This time the corner coordinates are given in the coordinate system of the target of the Canvas, though (either a View or another Bitmap).
    The big surprise is that the two rectangles do not have to be the same size. If we specify
    the destination rectangle to be smaller in size than the source rectangle, then the Canvas
    will automatically scale for us. The same is true for specifying a larger destination
    rectangle.

    Rect dst = new Rect();
    dst.set(50, 50, 350, 350);
    canvas.drawBitmap(bmp, null, dst, null);
    

    here bmp is a bitmap with an original size of 160*183 pixels. It is scaled to 250*250 pixels using Rect.

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

Sidebar

Related Questions

I am trying to create a concave moving shape using bullet physics SDK but
I'm trying to create moving text.I have crated surface view and thread for looping
I am trying to create a moving ball animation in my app everything is
Trying to create a black line in my view to separate text blocks but
Trying to create a new Dedicated Cache Role in Windows Azure but get the
I'm trying to create moving functionality to my imageView (maskPreview in the code below),
I was trying to create a 2D Animation in Java of a moving line
ok so im trying to find some tutorials on how to create a moving
I'm trying to switch back from my UIViewController to my UITableViewController but apperendly it's
I'm trying to create a randomly moving turtle here by following these steps in

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.