Skip to main content
December 12, 2011
Answered

Screenshot of iOS NativeExtension view

  • December 12, 2011
  • 2 replies
  • 2147 views

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 has been closed for replies.
Correct answer Tyler Egeto

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.

2 replies

Known Participant
October 28, 2017

the link provided in example is offline.

please share if you have sources     

itlancer
Inspiring
October 28, 2017
Tyler EgetoCorrect answer
Participant
December 13, 2011

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.

December 14, 2011

Thx Tyler, that's exactly what I needed!