How DevEco Studio converts SVG files to XML files (basic knowledge of HarmonyOS development)

How DevEco Studio converts SVG files to XML files

SVG (Scalable Vector Graphics) is an image file format. Currently, because the HarmonyOS graphics rendering engine does not support the rendering of SVG format pictures, developers need to convert SVG format picture files to XML format files, and then reference the converted XML files in the layout file. In this way, the image file can be rendered normally when running the application on the simulator/previewer or device. The conversion method is as follows:

1. Select the application module, click the right mouse button, and select New>Svg To Xml.

image.png

2. Select the svg file to be converted, name it, and click the OK button to start the conversion.

image.png

3. After the conversion is successful, you can find the converted xml file under resources> base> graphic file, and refer to the xml file name in the layout file to complete the reference to the icon file.


For more technical exchanges, please join the QQ group

Group name: harmonyos Hongmeng Technology Exchange
Group number: 856567895


Start from scratch to learn HarmonyOS Hongmeng 2.0 development

Guess you like

Origin blog.csdn.net/iCloudEnd/article/details/108587638