Cropping a Canvas Before Returning From OnDraw

Nathan Sokalski 4,116 Reputation points
2022-04-28T19:43:48.99+00:00

I have a custom View in which I override the OnDraw method. Before returning the Canvas, I want to crop it, but I cannot find a way to do this. SetViewport does not work, and none of the .Clip* methods seem to do anything. How can I control what part of the Canvas is actually used?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,296 questions
{count} votes