Languages

Menu
Sites
Language
Drawing in response to touch input

When the user touches the screen and then moves around I want to be able to update the screen by copying a picture at the changing position of the touch.

I get the touch input in the OnTouchMoved event handler and then adjust the picture position and call RequestRedraw to refresh the screen.

The problem is that the Canvas drawing routines cannot draw as fast as the touch move events are fired and so it is not possible to respond by redrawing the screen each time the touch moves.

One solution I tried was only redrawing the screen when the touch moves a minimum of x pixels in any direction and also when the touch is released. This works but I am sure there must be better solutions.

Would it be possible to put the drawing in some kind of thread that would receive drawing requests from the main thread and only process the last request when the current drawing operation is completed?

If anyone has experience handling this kind of situation, could you please post some code snippets on how to make this work in a smooth and responsive way?

Thank you for your help.

Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

1 Replies
john Smith
Hi, You are trying in emulator or device, if it is emulator there might be little bit slow, and if it is in target, you have to install open gl.