cancel
Showing results for 
Search instead for 
Did you mean: 

[How to draw pixel, line or rectangle? ]

Tiel
Associate II

Does TouchGFX also have similar functions that can replace StemWin's functions such as GUI_DrawBitmap, GUI_FillRect, and GUI_DrawLine?

And is there any example of how to use it if there are? ( very difficult to find example code snippet like STemWin's.)

Best Regards,

Tiel

3 REPLIES 3
MM..1
Chief II

Place one of each on screen in designer and read generated screen code.

N. SANTINI
ST Employee

Hi,

There is no exact one-to-one mapping in the TouchGFX framework since it is a object-based or scene rendering approach (see Graphics Engine | TouchGFX Documentation).

If you aim at converting an STemWin GUI into a TouchGFX one you must first detail you UI in terms of visual objects (i.e. line, bitmap, box/rectangle) and then setup you screen adding each of these elements, using the corresponding widgets :

0693W00000HoPv5QAF.pngThen the TouchGFX library rendering engine will take care of updating their appearance on display depending on the GUI logic so GUI_DrawLine will internally mean to redraw the line widget.

In terms of feature :

  • a fixed-color rectangle is a Box widget
  • a line is a Line widget (or a 1 height/width pixel box for an horizontal/vertical line)
  • a bitmap is an Image widget

Best regards,

Nicolas

Tiel
Associate II

Dear N.Santini

thanks for your kind answer.

let me consider new ui form based on touchgfx conditions as above.

Best Regards,

Tiel