Simulator Cropping Update

Quoting myself:

You may want to extract screenshots from the iPhone simulator, e.g. for submission to the iTunes store. If you take a screenshot of the iPhone simulator’s window (with, say, Cmd-Shift-4 + Space + Left-Click), you end up with an image of an iPhone wrapped around the application that you’re actually interested in.

Since I wrote the post from which that riveting prose comes, AAPL has released the 4.2 SDK, which includes the 4.2 Simulator, which relocates the screen relative to the original simulator. The new origin for the 320×480 screen is (38, 126). The origin for the 640×960 screen (introduced a few SDKs back) remains (56, 28).

If you wanted to pull the simulated device’s screen out of simulator screenshots, you could use the Python Imaging Library thusly:

Image.open('lores_full.png').crop((38,126,358,606)).save('lores_cropped.png')
Image.open('hires_full.png').crop((56,28,696,988)).save('hires_cropped.png')
Share and Enjoy:
  • Twitter
  • Facebook
  • Digg
  • Reddit
  • HackerNews
  • del.icio.us
  • Google Bookmarks
  • Slashdot
This entry was posted in iPhone. Bookmark the permalink.

Comments are closed.