Android5.0 vector animation-[initial recognition of Vector Graphics SVG and VectorDrawable],

Source: Internet
Author: User

Android5.0 vector animation-[initial recognition of Vector Graphics SVG and VectorDrawable],

Android5.0 + advanced animation Development describes how to use VectorDrawable technology, besell curve technology, and PathMeasure technology to achieve cool animation. What are the points worth learning about Frame Animation, intercept animation, and attribute animation compared to the previously learned frame animation? Why does Android introduce VectorDrawable technology after 5.0? Why does Shen Xu recommend and share these technologies? Now, let's record the key knowledge points in the Section [getting started with Vector Graphics SVG and VectorDrawable.

Knowledge Point 1:

There are two types of images used on the network. One is a grid image (.jpeg. gif. png) and the other is a vector image (SVG), which is distorted when the Raster image is enlarged, but not distorted when the vector image is enlarged, for example:

 

Knowledge Point 2:

SVG-Scalable Vector Graphics is a language recommended by W3C to describe two-dimensional Vector Graphics. The purpose is to provide a flexible and practical graphic format that is presented in XML. SVG feature sets include nested conversions, editing paths, feather masks, grating filter effects, template objects, and scalability, supports animation, zoom view, various graphic primitives, groups, hyperlinks, structured metadata, CSS, and DOM extension sets, and can be easily embedded into other XML documents. It is generally used on Web terminals.

Rect label: Indicates drawing a rectangle, circle label: Indicates drawing a graph, polyline label: Indicates drawing a line, line label: Indicates drawing a line

 

Knowledge Point 3:

VectorDrawable is a vector graph in Android. It only extracts Path labels from SVG to draw all images, improving the loading and parsing efficiency of vector graphs in Android systems. Common VectorDrawable Syntax:

 

M = moveto (m x, Y): Move the paint brush to the specified Coordinate Position

L = lineto (l x, Y): draws a straight line to the specified Coordinate Position

Z = closepath (): Close the path

H = horizontal lineto (h x): draws a horizontal line to the specified X coordinate position

V = vertical lineto (v y): Draw a vertical line to the specified Y coordinate position

 

Knowledge Point 4:

Vector Graphics SVG online production tool-SVG Editor (http://editor.method.ac)

 


SVG to VectorDrawable online tool (https://inloop.github.io/svg2android)

 

 

 

AndroidStudio also provides conversion tools, and the reason why SVG can be converted to VectorDrawable is that the SVG syntax is relatively fixed. All SVG images are paths, while VectorDrawable extracts the Path in SVG.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.