iPad/iPhone duplicate view and resize?
I'm working开发者_运维知识库 on an app that is similar to a Presentation application (Keynote/Powerpoint) for the iPad, that will use the VGA adapter to present on screen. However, if the presenter is using the external display for the presentation, I'm wondering if it's possible to have a miniature version of what's on the external display show up on the main iPad display (along with the presentation controls, which will take up most of the screen). In other words, I'm looking for a way with the iPhone SDK to "bake" the contents of a View (which will contain various Images and Labels in various locations) to an image (or some other static storage), resize it, and re-display it in another view.
It would need to be smaller (since I don't want the 1024x768 external display to completely overlay the iPad's main display, only a corner of it), and either live-updating (literally an instance of the other View, just scaled), or be able to be refreshed, such that when updating the external display, the "picture in picture" version of itself would be updated too.
It might be easiest to just have two instances of a view - one that is the full size on the external display and one that has its transform property set to fit in the preview window (and then update both simultaneously).
Otherwise you probably have to dive into Quartz and use the view's layer property to render it to a context (see CGBitmapContextCreate) and draw that onto a tiny view (this is all speculation of course).
精彩评论