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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:25:16+00:00 2026-06-17T16:25:16+00:00

I have a trouble with scaling bitmap and then draw on it in Android.

  • 0

I have a trouble with scaling bitmap and then draw on it in Android. From the beginning, I have a custom view, with onDraw method, I’m drawing something on it’s canvas. Now, I want to scale that drawing smoothly (still on canvas) and then draw something on that canvas, without clearing it (over that scaled drawing). How to accomplish this?

I have tried scaling whole view with build-in animation mechanism. Scaling is smooth, but it is not the way, because it is scaling whole component, not only the drawing. Is there any way to scale drawing smoothly and then draw on it?

Thanks in advance.

  • 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-17T16:25:18+00:00Added an answer on June 17, 2026 at 4:25 pm

    You could implement the scaling animation by yourself. You could call invalidate() as long as you need to scale and measure the time between the onDraw() calls and calculate the amount of scaling you need. The scaling itself would be simply done by a call to canvas.drawBitmap(bitmap, matrix, paint) where your matrix must represent the scaling.

    Another method would be to use ScaleAnimation where the Transformation contains a matrix you could use, too.

    Drawing over the bitmap is simply done: just draw on the same canvas in onDraw() after you have drawn the scaled image. As only the image scales, the new drawn stuff is not scaled.

    A third solution might be a bit more complex. You could, instead of scaling the bitmap, just scale the canvas. Scale down the canvas, draw the bitmap on it and restore the canvas. After that you can draw the rest.

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

Sidebar

Related Questions

I have trouble deserializing the result from my WCF webservice. The method returns a
I have trouble putting together a delete statement in my Android application (I am
I have trouble figuring out what's wrong with my obj file parser for android,
I have trouble to parse and show events from Bands in Town´s API in
I'm having trouble drawing a UIImage in front of a CAShapeLayer . I have
I have trouble printing simple text from a <h1> element: require 'nokogiri' doc =
I have trouble to call following web service in android application. http://seba:pl,%5Dd77@www.bjadi.com/administrator/components/com_ivmstore/ivmwebservices/vmcategory.php I am
I have trouble to convert from decimal to hex. Here is my code: select
I have trouble understanding the differences between the Image class and the Bitmap class.
I have trouble passing a variable from inside a loop. Code: # find all

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.