A SVG Image have 6 icon and need to choose one?

后端 未结 3 835
余生分开走
余生分开走 2021-01-27 16:44

I have an SVG file format in which there is 5-6 icon and I need to pick icon according to the requirement not the whole Image.

In Simply you can parse the .SVG onto you

3条回答
  •  长发绾君心
    2021-01-27 17:19

    I did not try it but you may :

    • Create a Bitmap with the size of your icon
    • Create a new Canvas associated to this Bitmap
    • Draw your svg into the Canvas with an offset -- If your icon coordinates are (X1, Y1) -- Then when you draw an element substract SVG (X1, Y1)
    • Draw the Bitmap on screen.

    It is a little bit homemade solution... maybe there is some libraries doing those king of things for you.

提交回复
热议问题