简体   繁体   中英

Android - Vector images losing quality?

I have images from my designer that are Vector images that should be able to scale to all sizes and look good or whatever(im a developer not a designer). My problem is when I add it to my app using Bitmap's, the image loses quality.

(The M has jagged lines)

在此输入图像描述

Does android support Vector images? Is it because I am rendering them as a bitmap? What is it?

Vector image has no guaranty to be sharp after rasterizing. There are a lot of reasons that could cause quality losing. Main reason is in point coordinates in vector files for example you have vector image 100x100 pixels and you want to show it in 100x100 ImageView and come of points in vector image would have coordinates like 23,5; 67,5 it won't be sharp, but if you'll increase ImageView size to 200x200 the real coordinates would be 47; 135 so in this situation image would be sharp.

Also you could use SVG Android or Android-SVG for displaying SVG images in android.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM