ImageView Quality Not Smooth On Edges - android

I have an ImageView which I display on screen, the quality on the edges is not smooth, this is on emulator and on real device.
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/temp_9" />
I have attached a picture to show the difference with the image on the left being from emulator (sharp edges) and the image on the right is the original PNG image (smooth edges).
I have placed image in raw instead of drawable - not working
I have moved the image across the different drawable folders - not working
I have created a generic 'drawable' folder and placed image inside - not working
I have created a 9 path image - not working
I have reduced the image size using GIMP - not working

Related

Android Jpg + png images display as white color

Some of my resource images display as white color and I have no idea why.
- I'm using a drawable importer plugin to import my images in multiple densities.
- Image displays if I set it as Background resource but then I can't control it's dimensions:
used src, compatSrc attributes and nothing changes.
tried to load the image using glide and nothing changes.
xml
<ImageView
android:layout_width="match_parent"
android:layout_height="320dp"
android:scaleType="centerCrop"
android:src="#drawable/graphic_map"/>
Expmple png image Layout in xml preview vs in emulator
Example jpg Image Location

Wrong 9 patch init size while displays

Created nine patch image via Android Studio from png file. Set patch image as background on ImageView, but ImageView shows with greater size as expected. Studio shows that image has size 117*95, but on display imageView shows with size near 334*266.
Please, help how to fix it. Png and screens attached.
<ImageView android:background="#drawable/new_sent_bubble_edit1" android:layout_width="wrap_content" android:layout_height="wrap_content" />
nine patch view in studio
Found solution. Just need to put 9 patch file to some density drawable folder. When put picture to xxhdpi-drawable folder and image has been drawn as expected.

Android displaying a crisp image after zooming

Currently I have a set of images which has resolution of 480x640 each.
When I zoom the image using an image displayer library I got from googling (TouchImageView), the image got a bit blurry.
Is it possible to use higher resolution image so that the image will not be blurry when zoomed?
As far as I know, images will be scaled in terms of width in Android, but the height will not be scaled, right?
Here's my code for the image displayer :
<com.km.parkit.TouchImageView
android:id="#+id/overview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:contentDescription="#string/imageDesc"
android:scaleType="matrix"
android:src="#drawable/parkinglot" />

showing image of sixe 64 X 64 on any size imageview without loosing its quality

I am retrieving image from server and setting it to image view.The image size is 64 X 64 .
But I want it to suppport all size image views. If I use imageview of size 150dp X 150dp
it gets blurred out,it stretches.Is there any method so that my image maintains its quality even on bigger size imageview?I had heard to use ninepatch images in drawable but here i'm downloading it from server and image size is fixed 64 X 64 .
Plz Help!!!!
NinePatch is for stretching images, usually only for background images with a single color or a gradient in one direction. So that is not your answer.
As to showing your 64x64 image as 150x150.. no. It's just as if you'd do image enlargement in an image editor - the information is not there. Although it shouldn't be that bad.
Check this to see if any alternative fits your needs:
http://developer.android.com/reference/android/widget/ImageView.ScaleType.html
Typically used:
<ImageView
android:id="#+id/image1"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:layout_height="wrap_content"
android:layout_width="0dp"
/>
I am afraid it can't be done...Not with all image types at least. There are images called VECTOR images which retains quality at significant level of image resizes. So you should try using some vector kinda images which could be of .PNG images, etc.
Because shrinking a larger image works most of the time, but enlarging smaller images will always under distortion.

Android - changing ImageView drawable after scales & translate animation

I have an app that shows thumbnails of images presented as ImageViews. You tap on an image, it animates to fill the screen (rotating 90 degrees on the way if it's not a portrait image). Once it's full screen I want to switch the underlying bitmap in the ImageView with a higher res version that I'm downloading off the internet.
The problem is that after the ImageView has been scaled, the new bitmap image appears on top of the old one and at the size of the thumbnail.
Any ideas?

Categories

Resources