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

  • Home
  • SEARCH
  • 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 8022051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:09:45+00:00 2026-06-04T22:09:45+00:00

I have an image path that I decode into a bitmap. I found that

  • 0

I have an image path that I decode into a bitmap. I found that that Bitmap is to big and tried to resize it. It didn´t work (the image stayed too big), is my code ok?

ImageButton myImage = (ImageButton) findViewById(R.id.image);

Bitmap myBitmap = BitmapFactory.decodeFile(selectedImagePath);
Bitmap.createScaledBitmap(myBitmap, NEW_WIDTH, NEW_HEIGHT, true);

myImage.setImageBitmap(myBitmap);
  • 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-04T22:09:46+00:00Added an answer on June 4, 2026 at 10:09 pm
    Bitmap myBitmap = BitmapFactory.decodeFile(selectedImagePath);
    Bitmap scaledBitmap = Bitmap.createScaledBitmap(myBitmap, NEW_WIDTH, NEW_HEIGHT, true);
    myBitmap.recycle();
    myBitmap = null;
    

    It’s designed to not change the original bitmap. You’re not capturing the reference so it’s just being thrown away.

    Keep in mind that creating a bitmap in this format takes up more memory because you’re creating a new bitmap while still holding on to the old one. If you’re doing this very often and not throwing away the old reference, then your heap will grow massive real quick.

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

Sidebar

Related Questions

I have tried to get the bitmap image from the path of the image.
I have this PHP code that resizes images perfectly: smart_resize_image(path/to/image.jpg); Now I want to
I currently have a varchar(255) column that stores the path to a small image
<input src=LOGO.JPG type=image name=imagem> I have an xml element that contains the image path
I have written a procedure that shows me the image path from picture table
i have pear's phpunit installed (see image) I have that path in the include
i have the following: <s:Image source={path}/imageName/> how can i determine that path to load
I have got an image path that I want to store in the shared
I have a problem with reading the image path of a string like ->
I have this piece of code: <table style=background-image: url(path/to_image.png)> And when I load it

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.