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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T23:52:58+00:00 2026-05-21T23:52:58+00:00

Picture looks blurry when I get it from gallery. I resize to 250w*300h using

  • 0

Picture looks blurry when I get it from gallery. I resize to 250w*300h using the following code:

        if(bm!=null)
        {
            int width = bm.getWidth();
            int height = bm.getHeight();
            float scaleWidth = ((float) newWidth) / width;
            float scaleHeight = ((float) newHeight) / height;
            // create a matrix for the manipulation
            Matrix matrix = new Matrix();
            // resize the bit map
            matrix.postScale(scaleWidth, scaleHeight);
            // recreate the new Bitmap
            resizedBitmap = Bitmap.createBitmap(bm, 0, 0, width, height, matrix,true); 
        }
    }
    catch(Exception e)
    {
        e.printStackTrace();
    }
}

How can I solve this?.

  • 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-21T23:52:59+00:00Added an answer on May 21, 2026 at 11:52 pm

    You don’t need matrix manipulation just use

    resizedBitmap = Bitmap.createScaledBitmap(bm, w, h, true);
    

    I am not sure how do you calculate newWidth and newHeight, but it could be that your new scaled bitmap is too small and then streaches in a view hence blurred.

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

Sidebar

Related Questions

My page looks like this: http://ink-12.terc.edu/index.cfm I want to get the picture (kids' drawings)
I'm using GridBagLayout to make a StatusBar which looks like in the picture. I
It looks like I cant create an album for my picture producing app in
Look at the following picture, which is showing a smart tag for DataGridView. DataGridView
first take a look on this picture from localScope app : i have 2
I'm trying to upload a picture to a specific website using php cURL but
I have a table that looks like this: (so you can picture it visually)
At first my programm looks like this: But when i am moving the picture
If I have an XML file that looks like this: <properties> <property> <picture>http://example.com/image1.jpg</picture> <picture>http://example.com/image2.jpg</picture>
In my image gallery all link looks like this: <a class=fancybox href=http://my.domain/gallery/?i=001></a> Fancybox can't

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.