TWR-LCD eGUI 3.00 & LABEL LIVE UPDATE

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

TWR-LCD eGUI 3.00 & LABEL LIVE UPDATE

671 Views
Eric_t
Contributor III

Hi

I am using TWR-LCD and eGUI 3.00.

I am tring to display live data using the D4D_LabelSetText.

The code is the follow:

// Screen "Main" function called periodically in each D4D_poll runs
static void myScreenAbout_OnMain()
{
D4D_TCHAR buff[10];

//(void) sprintf(buff, "%lx", k);
buff[1] = 0;

if (k < 1000) buff[0] = '1';
else if (k < 2000) buff[0] = '2';
else if (k < 3000) buff[0] = '3';
else if (k < 4000) buff[0] = '4';
else if (k < 5000) buff[0] = '5';
else k=0;

D4D_LabelSetText(&my_label, buff);
}

The problem is that the values are overwritten instead of only display the last value 

If I switch transparency off (#define D4D_FNT_PRTY_TRANSPARENT_NO_MASK), I am not able to draw label's text and have the same background color.

Does anyone know how I can redraw the label text, erasing the old text and keep background color?

thank you.  

0 Kudos
3 Replies

484 Views
TomE
Specialist II

I am not familiar with that graphics software on that unit, but I am familiar with other graphics systems.

The normal approach is to have a "drawing window" in memory that the pixels are "painted" to.

Drawing starts with clearing this, filling in the background, drawing buttons and text.

Then that memory is copied to or swapped with the actual "video buffer memory" that is being displayed on the screen.

Then, periodically (20 Hz, 25Hz, 60Hz or when a graphics element changes) the whole process is done again, with a new background/widget/text and so on.

So the WHOLE THING is redrawn, from scratch, every time through some sort of timed loop, or (as an optimisation), only if some data has changed that requires something on the screen to change - different text, number, colour of something, position of a needle and so on.

Otherwise, if you aren't "redrawing the whole thing", then you have to wipe out or repaint the areas that are changing. That would involve a rectangle around the text-box you're drawing. That rectangle needs to be cleared (to the background colour or the background of the text box) and then the new text is drawn. I don't know how many of those actions the "D4D_LabelSetText()" function performs for you, but it may assume something else painted over the previous next so the new text could be literally "drawn on a blank canvas".

Have you read the guide in this post, and the link to the Reference manual?

https://community.nxp.com/docs/DOC-330064

The above points to this, and I note the following comment, which means SOMETHING has to be called to redraw the screen:

The macros with _INRAM postfix creates complete graphic objects in RAM memory and thus all parameters can change runtime, but the screen must be redrawn manually after each change.

http://gargy007.github.io/egui_doc/egui_description.html

Tom

0 Kudos

484 Views
miduo
NXP Employee
NXP Employee

Hi,

Please let me know what main board you used with the TWR-LCD, the ColdFire boarrd or the Kinetis?

0 Kudos

484 Views
Eric_t
Contributor III

Hi

I am using the ColdFire board & codewarrior 6.3

 

0 Kudos