UIImage textures, stretching and masking

Andrey Chevozerov delivers some handy UIImage processing examples in Tips for Using UIImage:

Today, I’m going to suggest several unusual ways of using UIImage to fill an area with a texture, create a stretchable UI element, changing and masking an image.