Screenshot Function

I found this to be the best solution for taking screenshots via button click.