cancel
Showing results for 
Search instead for 
Did you mean: 

how to generate custom scale having marks & texts for a gauge in touchgfx ?

sanjeev majumdar
Associate III
 
5 REPLIES 5
Bob Bailey
Senior

I believe you need to start with a bitmap of your gauge face that has no ticks or texts, then add these items yourself. I added a second needle to the gauge by using the existing code as a guide.

did you want the ticks to be variable, externally controlled?

Bob

sanjeev majumdar
Associate III

Hello Bob,

Thank you for your response. i have already implemented the gauge face using custom container having circular progress bar and a circle, i need to populate variable no. of ticks and numeric value corresponding to it based on for which purpose the gauge is used. can you please let me know how i can draw point / pixel wise and generate the text like we can do in emwin using GUI_DrawPoint, GUI_DispStringHCenterAt.

does touchgfx has api similar to that above?

Hello Bob,

Thank you for your response. i have already implemented the gauge face using custom container having circular progress bar and a circle, i need to populate variable no. of ticks and numeric value corresponding to it based on for which purpose the gauge is used. can you please let me know how i can draw point / pixel wise and generate the text like we can do in emwin using GUI_DrawPoint, GUI_DispStringHCenterAt.

does touchgfx has api similar to that above?

Bob Bailey
Senior

I've not used emWin, but it did seem to have more of these user functions built in.

in our case we need to add them

another user on here was doing custom gauge stuff (Jim Fouch?), he posted a small snippet and I remember

his ticks were drawn as shapes similar to how the needle is drawn.

draw a tick at 0 degrees (straight up), with its center at the center of your gauge, then rotate it to where you want it, and then add. do this in a loop based on how many ticks.

for the text I would add text+wildcard items where you want the labels,

Bob

thanks i will try the same.