Skip to main content
Tiel
Associate III
December 11, 2021
Question

[How to draw pixel, line or rectangle? ]

  • December 11, 2021
  • 3 replies
  • 1490 views

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
December 11, 2021

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

N. SANTINI
ST Employee
December 13, 2021

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
December 16, 2021

Dear N.Santini

thanks for your kind answer.

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

Best Regards,

Tiel