Screen Mirroring on iPad

The iPad supports an external display with the

UIScreen
and
UIScreenMode
classes as described in the What's New in iPhone OS document. This is intended for applications to present two different views on two different windows. For example presentation slides on the external display and notes on the iPad screen or video and images on the external display and controls on the iPad.

Sometimes it can be useful to mirror the iPad screen on the external display. This is not directly supported but luckily I found the iphoneos screen mirroring project by Francois Proulx on Google Code. It essentially sets up window and view on the external display and then uses the "blessed" UIGetScreenImage to periodically copy an image over from the internal display.

The easiest way to use it is to add it to your project, add the

-ObjC -all_load
other linker flags and include the header.

    #import "UIApplication+ScreenMirroring.h"

Then when you are ready to start mirroring just call.

    [[UIApplication sharedApplication]  setupScreenMirroring];

When you are ready to stop call

    [[UIApplication sharedApplication] disableScreenMirroring];

It is not a perfect solution as it is no where near as fast as you might like, and it is particularly slow for games, but it is easy to set up and incredibly useful for demos and presentations.

Also, I do not know how or if this would affect the approval process. It seems to be using legal methods in an unconventional unintended way and you never know.

To date, I have used it only for demos and it has been a lifesaver. Let me know how it works for you.

Comments

Will iphoneos screen mirroring code mirror any application that is running? Or is it intended to only mirror the application that calls [[UIApplication sharedApplication] setupScreenMirroring]? Thank you for any help.

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.