Skip to main content
Tiel
Associate III
Dec 11, 2021 7:35 AM UTC
Question

[How to draw pixel, line or rectangle? ]

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

This topic has been closed for replies.

3 replies

MM..1
Super User
Dec 11, 2021 1:27 PM UTC

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

N. SANTINI
ST Employee
Dec 13, 2021 1:54 PM UTC

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
TielAuthor
Associate III
Dec 16, 2021 12:26 AM UTC

Dear N.Santini

thanks for your kind answer.

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

Best Regards,

Tiel