Image Pixelation (PNG)

by nimph » Sat, 05 Sep 2009 09:44:16 GMT


Sponsored Links
 I'm trying to load a PNG image into an ImageView using the following
code:

    mImageView.setImageBitmap(BitmapFactory.decodeStream(getClass().
           getResourceAsStream("file_name.png")));

The images are displayed just fine, but they are badly pixelated.

Putting the images in 'res/drawables' works fine, I only see this with
images loaded from the file-system.

What am I doing wrong?  Let me know if you need more info.

Thanks,
--~--~---------~--~----~------------~-------~--~----~



Image Pixelation (PNG)

by String » Sat, 05 Sep 2009 11:35:07 GMT


 I've had this problem if the size of the ImageView doesn't exactly
match the dimensions of the bitmap in the file.

String



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Image Pixelation (PNG)

by nimph » Sun, 06 Sep 2009 12:46:43 GMT


 Thanks, had not tried that, but...  No luck...

I tried adding the following to the ImageView.

    android:maxHeight="32px" android:maxWidth="32px"
android:minHeight="32px"
                android:minWidth="32px"

Are these the attributes you set?

//




--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Questions about adding an external shared library to Android image (donut)

Hi, questions about extending/modifying the platform should go to
android-porting.  Thanks!






-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~

2. What is the name of the browser inside of Android?

It does not have a name, it's just "Browser".





Hi,

What is the name of the browser inside of Android?

"Android Browser" ?

"Android Chrome"?

-Audrey


--~--~---------~--~----~------------~-------~--~----~

3. Not loading Phone.apk on emulator

4. How to specify parameters used in XML, in code instead?

5. Populating Listview....

6. How update TextView?

7. Dynamically enable menu items