Is it possible to create a mask at runtime?

Hi all… thanks to anyone who takes the time to reply to this question.

I was wondering if it was possible to create a mask at runtime. To clarify, I have an image that I would like to reveal as a user starts to draw on it.

Thanks