.NET MAUI › Graphics & Drawing
How do you handle touch/gesture input on a GraphicsView for interactive drawing?
AdvancedAnswer
Attach gesture recognizers (PanGestureRecognizer, TapGestureRecognizer) or handle pointer events, translate the touch points into your drawable's coordinate space, update model state, and call Invalidate. For freehand drawing, accumulate points on pan and render them as a path.
var pan = new PanGestureRecognizer();
pan.PanUpdated += (s, e) =>
{
_points.Add(new PointF((float)e.TotalX, (float)e.TotalY));
graphicsView.Invalidate();
};
graphicsView.GestureRecognizers.Add(pan);Real-world example A signature-capture control records pan points and repaints the stroke live as the user signs.