added a method to get screen shot with rect