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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:26:54+00:00 2026-06-10T19:26:54+00:00

I wrote a method to change Bitmap from camera shot : public Bitmap bitmapChange(Bitmap

  • 0

I wrote a method to change Bitmap from camera shot :

public Bitmap bitmapChange(Bitmap bm) {
    /* get original image size */
    int w = bm.getWidth();
    int h = bm.getHeight();

    /* check the image's orientation */
    float scale = w / h;

    if(scale < 1) { 

        /* if the orientation is portrait then scaled and show on the screen*/
        float scaleWidth = (float) 90 / (float) w;
        float scaleHeight = (float) 130 / (float) h;
        Matrix mtx = new Matrix();
        mtx.postScale(scaleWidth, scaleHeight);
        Bitmap rotatedBMP = Bitmap.createBitmap(bm, 0, 0, w, h, mtx, true);
        return rotatedBMP;

    } else {

        /* if the orientation is landscape then rotate 90 */
        float scaleWidth = (float) 130 / (float) w;
        float scaleHeight = (float) 90 / (float) h;
        Matrix mtx = new Matrix();
        mtx.postScale(scaleWidth, scaleHeight);
        mtx.postRotate(90);
        Bitmap rotatedBMP = Bitmap.createBitmap(bm, 0, 0, w, h, mtx, true);
        return rotatedBMP;
    }
}

It works fine in another Android device, even Galaxy Nexus but in Samsung Galaxy S3, the scaled image doesn’t show on screen.

I tried to mark the bitmapChange method , let it show the original size Bitmap on screen but S3 also show nothing on screen.

The information of variables in eclipse is here.
The information of sony xperia is here.

xperia and other device is working fine.

Edit:

I got some Strange log in LogCat,

when i take a picture the LogCat show some message:

here

I never use video…

why video is started??

  • 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-10T19:26:55+00:00Added an answer on June 10, 2026 at 7:26 pm

    I searched around and it seems there might be two possible reasons:

    1) S3 has memory problems. Check out this SO Question The S3 gives problems even when scaling images!

    Solution- The solution is to make the bitmap conversion more memory-friendly as shown here and discussed in this SO question


    2) Samsung phones set the EXIF orientation tag, rather than rotating individual pixels

    Solution- Take a look at this SO question

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

Sidebar

Related Questions

I wrote a method that extracts fields from an object like this: private static
I have wrote a method to convert any layout Liner,Relative,Frame etc into Bitmap but
So I wrote a method to just get a database table and it returns
I wrote a javascript method to display an image dynamically depending on whether or
I wrote this method to check if a page exists or not: protected bool
Question: I wrote a method to retrieve a SQL result as a list of
I have and old(ish) C# method I wrote that takes a number and converts
I'm having trouble with a method I wrote to insert string words into a
Hello StackOverflow community, Using Google App Engine, I wrote a keyToSha256() method within a
I wrote a simple Util method to convert a String in Java to util.Date

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.