Answer the question
In order to leave comments, you need to log in
How to make rectangle resize on MouseMove without performance loss in WPF?
I'm writing a screenshot app. There should be a function: select part of the screen. Tried various implementations - when moving the mouse, the selection starts to change in size in jerks (larger selection size - more jerks). Especially noticeable on multiple monitors.
Can you advise how to get rid of jerks?
Answer the question
In order to leave comments, you need to log in
On top of the elements you create a Canvas, on it is a Rectangle that will display the selection.
By pressing the mouse button, you make the Rectangle visible and fix one point. By MouseMove you set the second one. Redrawing is handled by WPF itself, no new elements appear on MouseMove and there are no jerks.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question