Skip to main content
Dec 12, 2011 4:21 PM UTC
Answered

Screenshot of iOS NativeExtension view

Context:

I need to add UI-elements on top of some native views.

When adding native components on screen (Native Alerts, SMS compose-view, Email compose-view, MapKit, etc.) they are layered over the entire AIR application.

I have no control over this layering and so I can not put AIR UI-elements above these views.

So... what I'm trying to do is:

- take a screenshot (bitmapdata) of the component (eg.: MapKit, or even the entire screen)

- hide the actual native component

- add the bitmapdata to the AIR displaylist

- add the neccesary UI-elements over that bitmap

- presto

But native components aren't part of the displaylist, so I can't take bitmapdata from them...

So my second plan was to capture the bitmapdata natively as a UIImage, convert that to a bytearray and pass it to AIR.

Then in actionscript convert the bytearray back to an image, etc.

This seems like an awful lot of work (I'm not even sure it would work) to get a screenshot of a native view or the entire screen.

Actual question:

How can I take a screenshot of my iDevice and use it in flash?

And please don't tell me to use the cameraroll, I don't want to store dozens of UI screenshots on the users device.

This topic is closed to new replies. Start a new post to keep the conversation going.
Tyler EgetoCorrect answer
Participant
Dec 13, 2011 5:27 PM UTC

Hi Brandov, I've posted an example of this on my website. It might require some tweaking for you specific case, but I'm successfully doing just this.

See the source here: http://tyleregeto.com/drawing-ios-uiviews-to-as3-bitmapdata-via-air

I hope that helps.

4 replies

Known Participant
Oct 28, 2017 12:14 AM UTC

the link provided in example is offline.

please share if you have sources     

Translate
itlancer
Inspiring
Oct 28, 2017 12:22 PM UTC
Tyler EgetoCorrect answer
Participant
Dec 13, 2011 5:27 PM UTC

Hi Brandov, I've posted an example of this on my website. It might require some tweaking for you specific case, but I'm successfully doing just this.

See the source here: http://tyleregeto.com/drawing-ios-uiviews-to-as3-bitmapdata-via-air

I hope that helps.

Translate
Dec 14, 2011 7:50 AM UTC

Thx Tyler, that's exactly what I needed!

Translate