Algorithm for screen grab

Could you please tell me if you have, or where I can get an algorithm
that gets (and at a later date returns) the attributes of a section
of the output to the screen (get screen dump).