Added takeScreenshot

This allows to choose the directory and filename used in saving the
screenshot.