2022-05-30 04:16 PM
I'm using TouchGFX 4.19.1. My speedometer gauge worked fine originally, for a 390x390 display. I need it to work on a 480x480 display so scaled up the background image and needle image and resized the gauge widget. Now I struggle to centre the needle, and the actual image (in simulator and on target) differs from what TouchGFX displays. Changes to the needle rotation centre are not reflected in the simulator/target. This must be related to the relationship between image and widget sizes. Attached is a snip of the simulator (LHS) versus the TouchGFX image (RHS). Has anyone else experienced this?
Gauge widget size is 480 x 260. Needle and background images supplied.
2022-05-31 12:24 AM
Hello @OLync.1 ,
Could you please share your whole project or at least the UI ?
To do that, you can create a new TouchGFX project, and then click on Edit > Import GUI.
That could be very helpful to try to reproduce the issue.
Thanks,
/Yoann
2022-05-31 01:06 AM
2022-05-31 05:16 AM
Hello,
Your issue come from these functions, located in RunningScreenView.cpp :
I don't know what you are trying to do with that, but it apparently shifts your gauge background and needle, and then those widgets look misplaced on the display. After commenting these lines, both the needle and the gauge were displayed on simulator exactly like in the TouchGFXDesigner Canvas menu.
I also added a new screen to the project to check if everything worked fine if you add a default gauge to your project, which is the case, and I corrected the positioning of the needles in the Running Screen.
I will share the updated project back.
Let me know if that solved your issue,
/Yoann
2022-05-31 03:48 PM
Thanks @Yoann KLEIN , that fixed it - I have inherited the project and did not notice that code. I have a follow up question regarding the needle rendering algorithm:
When Nearest Neighbor is chosen the moving needle has ragged edges. However when Bilinear Interpolation is chosen the moving needle has clean lines but there are occasional flickers of white in some pixels the gauge black background. Is there any way to remove these?
2022-05-31 11:46 PM
Hello,
It's probably related to your board performances. Which one are you using ?
/Yoann
2022-05-31 11:54 PM
2022-06-01 05:29 PM
2022-06-02 02:39 AM
Hello,
That's related to performance issues.
If you want to get better graphics with this kind of animations, you could try to use a more powerful MCU.
I ran the Gauge Demo from TouchGFX 4.19.1 on a STM32F769I discovery board, and everything worked fine.
/Yoann
2022-06-02 03:52 AM