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. Help for Socket Programming with Android device.

Hi,

I have developed an application using J2ME CLDC technology and this
application talks to a server (a regular VB server) using TCP/IP or
Socket programming. I used the J2Me SDK Toolkit to develop the client.
With its simulator I am able to run and communicate to the server. But
when I convert the JAR into APK file for android phone and launch it I
see junk characters going to my server. Can anyone help me in giving
more information regarding this? What is it I am missing here. The
data that I am sending is a compressed format (the compression is my
customized format). I am not getting that buffer same on the server
end. Please help.

Thanks
Padma

-- 

2. layout_gravity

OK, I'm obviously missing something fundamentally simple here.
I have a LinearLayout containing 2 buttons.
I've coloured the layout background red so I can see that it has
expanded to fill its parent.
I wanted the {*filter*}utton to center horizontally within the layout and
the OtherButton to be right justified.
But both buttons are on the left of the layout.

What have I done wrong?

<LinearLayout android:id="@+id/buttonBlock"
   android:orientation="horizontal"
   android:background="#ff0000"
   android:layout_width="fill_parent"
   android:layout_height="wrap_content">

  <Button android:id="@+id/{*filter*}utton"
       android:text="Boo"
       android:layout_gravity="center_horizontal"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"/>

  <Button android:id="@+id/otherButton"
       android:text="Other"
       android:layout_gravity="right"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"/>
 </LinearLayout>

-- 

3. How to set screen bright "immediate" in "service"(not in activity)?

4. BONDI in Andorid

5. Linking external libraries (JJIL)

6. How to capture long press of menu button

7. Drag and drop an image from a Gridview