Skip to main content
ST Migration account
ST Community Manager
August 22, 2026
Solved

I want to Get SVG ID

  • August 22, 2026
  • 1 reply
  • 16 views

This account only shares restored community content posted by members between May 22 and June 9, 2026, who did not register for the new community.


Is there a function to get the currently set ID in the SVGImage widget?

Best answer by JohanAstrup

Hello .

Currently, such a function is not implemented. However, based on your request, I will implement it targeted for TouchGFX 4.27.0.

In the meantime, you can implement it yourself quite easily by modifying the SVGImage.hpp file, since the TouchGFX widgets are open source. You can find the file here in your TouchGFX project:

  • Simulator project: touchgfxframeworkincludetouchgfxwidgetsSVGImage.hpp
  • Hardware project: MiddlewaresSTtouchgfxframeworkincludetouchgfxwidgetsSVGImage.hpp

The framework files will only be overwritten or regenerated if you manually delete them, so the change will persist.

You should implement this function in the public section of the SVGImage class:

uint16_t getSVGId() const {
return svgId; }

Best regards,
Johan

1 reply

JohanAstrupBest answer
ST Technical Moderator
August 22, 2026

Hello .

Currently, such a function is not implemented. However, based on your request, I will implement it targeted for TouchGFX 4.27.0.

In the meantime, you can implement it yourself quite easily by modifying the SVGImage.hpp file, since the TouchGFX widgets are open source. You can find the file here in your TouchGFX project:

  • Simulator project: touchgfxframeworkincludetouchgfxwidgetsSVGImage.hpp
  • Hardware project: MiddlewaresSTtouchgfxframeworkincludetouchgfxwidgetsSVGImage.hpp

The framework files will only be overwritten or regenerated if you manually delete them, so the change will persist.

You should implement this function in the public section of the SVGImage class:

uint16_t getSVGId() const {
return svgId; }

Best regards,
Johan