cancel
Showing results for 
Search instead for 
Did you mean: 

I want to Get SVG ID

yutajeng
Associate

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

1 ACCEPTED SOLUTION

Accepted Solutions
JohanAstrup
ST Employee

Hello @yutajeng.

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: \touchgfx\framework\include\touchgfx\widgets\SVGImage.hpp
  • Hardware project: \Middlewares\ST\touchgfx\framework\include\touchgfx\widgets\SVGImage.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

View solution in original post

1 REPLY 1
JohanAstrup
ST Employee

Hello @yutajeng.

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: \touchgfx\framework\include\touchgfx\widgets\SVGImage.hpp
  • Hardware project: \Middlewares\ST\touchgfx\framework\include\touchgfx\widgets\SVGImage.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