Using an offscreen frame buffer to take a screenshot