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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:09:38+00:00 2026-06-13T12:09:38+00:00

imageView.SetRotation(theta) centerize the view around the pivot point and rotates the image around this

  • 0

imageView.SetRotation(theta) centerize the view around the pivot point and rotates the image around this pivot by theta degrees, thats nice, but how can i rotate an image view without first centerizing it around this pivot?

to clearify my question, imagine a board and an image on it, what setRotation does is sticking a pin in the middle of this image and rotate it then, what i want is to pick a pivot – say image’s bottom left stick a pin there and then rotate it.

hopefully my question is clear, and solveable!

thanks!

  • 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-13T12:09:39+00:00Added an answer on June 13, 2026 at 12:09 pm

    You can set a new pivot point using:

    setPivotY(float pivotY);
    setPivotX(float pivotX);
    

    After that, the rotation will be made using the new pivot point set by the above methods.

    –EDITED–

    I used this method to add a ImageView to my layout.

    private ImageView addImageView(RelativeLayout mainLayout, int x, int y, int width, int height, OnClickListener onClickListener){
        ImageView imageView = new ImageView(this);
        imageView.setAdjustViewBounds(false);
        RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        params.height = height;
        params.width = width;
        imageView.setLayoutParams(params);
        imageView.setScaleType(ImageView.ScaleType.FIT_XY);
        imageView.setImageDrawable(getResources().getDrawable(R.drawable.marker_red));
        params.leftMargin = x - width/2;
        params.topMargin = y - height/2;
        imageView.setOnClickListener(onClickListener);
        mainLayout.addView(imageView);
        return imageView;
    }
    

    I called the method with this parameters:

        ImageView imageView;
    
        imageView = addImageView(mainLayout, 200, 300, 200, 200, new OnClickListener() {
    
            @Override
            public void onClick(View v) {
                imageView.setPivotX(200);
                imageView.setPivotY(200);
                imageView.setRotation(45);
            }
        });
    

    Finally, you just click on the image, and the image rotates 45 degrees.

    regards

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

Sidebar

Related Questions

Table view cell imageView is working on the simulator but not on the device..
ImageView connect = (ImageView) findViewById(R.id.fconnect); connect.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { facebook.authorize(SignIn.this,
I have an ImageView that contains an image. This image is getting scaled to
ImageView something = (ImageView)findViewById(R.id.my_animated_image_view); something.setVisibility(View.INVISIBLE); ((AnimationDrawable)something.getDrawable()).stop(); // <-- Is this line redundant? In my
I have an ImageView containing an image. This image is rotated by button clicks,
I am setting an imageview to an image from the sd card. This runs
I Have Imageview with Image in my Android app. I want that the point
I have this ImageView in my layout: <ImageView android:layout_width=fill_parent android:layout_height=wrap_content android:contentDescription=@string/image_divider android:paddingBottom=8dp android:paddingTop=4dp android:scaleType=fitXY
I have an ImageView that is 1x20px. The image is a .9.png. I am
I have an Imageview(like a Magazine page).When i swype in to that image then

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.