简体   繁体   中英

Android Vector drawable size

I am using svgs to generate VectorDrawable for android app ,and i read Considerations for SVG and PSD files

The initial loading of a vector drawable can cost more CPU cycles than the corresponding raster image. Afterward, memory use and performance are similar between the two. We recommend that you limit a vector image to a maximum of 200 x 200 dp; otherwise, it can take too long to draw.

but i have question , what is the recommended size of svgs and what size when use in menu items with Pixel ?

For your question in the comments regarding height, width and viewportHeight and viewportWidth:

The ratio of Height to Width should be same as viewportHeight to viewportWidth . Otherwise aspect ratio of the image changes ie, either it will be too wide or too tall.

If you increase the viewport size while you keep the same pathdata it results in scaling down of the image.(Also the image gets translated). You can learn better by experimenting with these figures. Viewport is viewport. Imagine your picture starts at extreme left. and goes 100dp right. If your viewport is 50dp wide then half of your image gets truncated.

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