Using svg images for icons has a big advantage over jpg and png images because it allows to scall the image without losing quality. That’s why I prefer to use svg images in the canvas apps I create.
PowerPoint has a very rich set of icons. Much richer than the default icon set available in canvas apps.
Below, the steps are given on how to convert a PowerPoint icon to a svg icon to use in your canvas apps.
- Open PowerPoint
- The “Microsoft 365 Apps for business” version of PowerPoint is used while creating the steps.
- Insert the icon you want to convert.
- Right-click on the image and select “Save as Picture…”
- Save the image on a local disk and make sure the type is: Scalable Vector Graphics (*.svg)
- Close PowerPoint.
- Open Windows Explorer and go to the folder you saved the image in.
- Right-click on the image and open the file with Notepad.
- Replace all double-quotes with single quotes.
- Replace width=’96’ height=’96’ with viewBox = ‘0 0 96 96’.
- Add the following code to all <path> elements: fill='{{FILL}}’
- {{FILL}} will be replaced in your canvas app with the color you want to use. You can use your own replacement tag.
- Do not skip the extra space at the beginning (before “fill”)..
- Open a canvas app.
- Add an image control. Add the following logic to its property “Image”:
- “data:image/svg+xml;utf8, ” & EncodeUrl(Substitute(“<<SVG>>”, “{{FILL}}” , “#FF7700”))
- <<SVG>> is all the text from Notepad.
- “#FF7700” is a color code example.
- “data:image/svg+xml;utf8, ” & EncodeUrl(Substitute(“<<SVG>>”, “{{FILL}}” , “#FF7700”))