xml - How to improve resolution of image on Android -


i have uploaded image on 3000 3000 pixel onto android studios.

when try add image application, image not sharp.

enter image description here

here xml code

 <imageview    android:layout_width="match_parent"    android:layout_height="200dip"    android:scaletype="fitcenter"    android:contentdescription=""    android:layout_margintop="20dip"    android:layout_marginbottom="28dip"    android:src="@mipmap/login_logo" /> 

i believe image should big enough image view. can advise me on how increase resolution of image?

updated

when uploaded image, 4 different versions of image created automatically in system

enter image description here

the problem creating icon set, wich not have 3000 3000 pixel. check it.

the application using more appropiate size (hdpi, xhdpi, etc). resizing manually. that's why icon not sharp in screen.

when create manual image asset, real size depending on screen size. assistan takes original image , resizze it.

ldpi (low) ~120dpi mdpi (medium) ~160dpi hdpi (high) ~240dpi xhdpi (extra-high) ~320dpi xxhdpi (extra-extra-high) ~480dpi xxxhdpi (extra-extra-extra-high) ~640dpi 

in pixels:

36x36 (0.75x) low-density 48x48 (1.0x baseline) medium-density 72x72 (1.5x) high-density 96x96 (2.0x) extra-high-density 144x144 (3.0x) extra-extra-high-density 192x192 (4.0x) extra-extra-extra-high-density 

you can solve it, creating custom image asset following instructions:

ldpi - 0.75x mdpi - original size want show hdpi - 1.5x xhdpi - 2.0x xxhdpi - 3x xxxhdpi - 4.0x 

https://developer.android.com/guide/practices/screens_support.html

or can use external library, picasso, load original image , fit it. result more professional far can dynamically fit, use placeholders, errorimage, etc.

https://www.google.es/?ion=1&espv=2#q=picasso%20android

picasso.with(getactivity())     .load(new file("path-to-file/file.png"))     .into(imageview); 

Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -