this line was copied from CScreenShot::TakeScreenshot()