cancel
Showing results for 
Search instead for 
Did you mean: 

How to write/draw something in my screen by touchGFX?

Junde
Senior II

Hello there,

I want to recognize the digital and character written by hand with STM32F429BI.

I think there must be split into the following steps:

1. user input(write something in the screen by finger); (what widget I can use?)

2. transfer the screen pixel data to MCU from touchGFX; (How to get the partial pixel data in certain areas?)

3. MCU recognizes the content with some lib; (Can some Lib be used from ST?)

4. MCU sends the result to the screen for display; (I know how to do this only 😂)

Any advice and links are expected.

Thanks for your help.

15 REPLIES 15

Hello @Junde ,

 

In your project you are using a single line.
When you click "Generate line" you are actually changing your current line.
Therefore, when you set the new position of the line to be 100-0 and 200-300, you invalidate that area.
If you also do line.invalidate() at the beginning of the addline method, you will see only one line a the time.

Same thing for the delete line.
You are actually resizing the line and then invalidating. But since you set the since to be 0, when you invalidate, you invalidate an area of 0 pixels so nothing appears to change.

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

Can you share the last project please?

Gaetan Godart
Software engineer at ST (TouchGFX)

Hi @GaetanGodart 

Thanks for your help, see the project in the attachment.

You might want to have a look at this thread (and especially my last answer) : adding-containers-widgets-not-declared-in-screenview-hpp 

 

Another option would be to avoid adding widgets completely by using a bitmap instead.
The advantage is that you would not add a single widget at runtime and therefore won't risk memory problems.
On the other hand, you will have to directly change the data of the bitmap which is not hard to do but you will have to track the last finger position and the most recent one (as I mentioned earlier) to create a custom line which will have to be your own code.

Gaetan Godart
Software engineer at ST (TouchGFX)

When you use one line object and change start end, image forget old line info and draw only new. Result is as your, but isnt overwriten. Right steps is set line to invisible invalidate change start end and back visible invalidate.

Junde
Senior II

Hi @MM..1 @GaetanGodart 

Many thanks for your pieces of advice and support.

Finally, I get the way!

The canvas line needs too much RAM, so I give it up.

I returned to the LTDC second layer(I think it's similar to the TouchGFX bitmap)

After some tries, it finally worked well.

I uploaded the project HERE for anyone wanting to have a reference.