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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:07:57+00:00 2026-05-25T16:07:57+00:00

I am trying to do some simple image zooming and panning with Android and

  • 0

I am trying to do some simple image zooming and panning with Android and I have two simple questions.

First, when I call the animation using scale, it zooms using the upper left-hand corner of the image as the origin but I would like it to zoom from the center of the image.
The second question is once the animation is done, it resets the image to the original state and I would like it to stay at the final state.

Here is the xml I have for the scale:

<scale android:fromXScale="1.0"
    android:fromYScale="1.0"
    android:toXScale="2.0"
    android:toYScale="2.0"
    android:detachWallpaper="true"
    android:duration="3000"></scale>

and in my code:

a = AnimationUtils.loadAnimation(this, R.anim.set);
a.reset();
ImageView iv = (ImageView) findViewById(R.id.imageView1);
iv.clearAnimation();
iv.startAnimation(a);
  • 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-25T16:07:57+00:00Added an answer on May 25, 2026 at 4:07 pm

    For scaling a image from center you have to set the pivotX and pivotY

    try this code for scaling from center and retaining the state after scaling,

    <scale  xmlns:android="http://schemas.android.com/apk/res/android"
      android:fromXScale="1" 
      android:toXScale="5" 
      android:fromYScale="1" 
      android:toYScale="5" 
      android:pivotX="50%" 
      android:pivotY="50%" 
      android:duration="1000" 
      android:fillAfter="true">
    </scale>
    

    Thanks…

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

Sidebar

Related Questions

I was trying to place some simple effects on an image using HBox using
I am trying to start writing some simple jQuery plugins and for my first
I'm very new to SIMD/SSE and I'm trying to do some simple image filtering
I am facing some questions when trying to design an S3 application using ASP.NET
I'm trying to write some simple code to resize an image, and I am
I'm trying to replicate some image filtering software on the Android platform. The desktop
I am trying to do a simple crop of an image, but for some
Trying to find some simple SQL Server PIVOT examples. Most of the examples that
I am trying to do some simple formatting stuff with 'sed' in linux, and
I'm trying to make some simple XML with Java and org.w3c.dom, but I got

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.