Skip to main content
Jack li1
Associate III
February 19, 2019
Question

How to draw a line with finger?

  • February 19, 2019
  • 3 replies
  • 851 views

Hi,How can i draw a line on my display touchscreen with my finger.I have used Graph widget before,but the coordinate point must be monotone increasing。Could i use the method for QrCode,and could you write an example for this。Thanks�?�?�?

Best regards

This topic has been closed for replies.

3 replies

Martin KJELDSEN
Principal III
February 19, 2019

Hi @Jack li​,

You could create a custom widget (Like the QrCode) that hooks into the ::draw() method and simply draw into the framebuffer at the relative location of your finger (hook into ::handleClickEvent() and ::handleDragEvent() to get these coordinates. You will not have the antialiasing that the Graph gives you, but you have more freedom here.

Does that make sense?

Best regards,

Martin

Jack li1
Jack li1Author
Associate III
February 22, 2019

Hello,@Martin KJELDSEN​ 

Thanks for you help ,but i can understand that .First i can't understand how to use ::draw() method ,maybe on touchgfx.com have Tutorial,l can't find it.so could you tell me through the entire process step by step or how can i do this .

Thank you very much !!!!

Best regards

Jack li

Jack li1
Jack li1Author
Associate III
February 19, 2019

:beaming_face_with_smiling_eyes: