Added support for clipRect to allow cropping of the screenshot.