fixed memory leak. removed usage of save/restoreGraphicsState

restoreGraphicsState caused screen freezes, probably due to the way it
works when capturing entire screen.