Skip to main content
Inspiring
April 2, 2012
Question

Uh Oh... Major problem with iPad3 and BitmapData [HELP]

  • April 2, 2012
  • 2 replies
  • 3906 views

So.. I have some stageWebView elements that use BitMapData to capture a screenshot of the browser to allow for other elements to animate ontop of the browser ( sharing options, etc ).

When I capture this on the new iPad ... and add the bitmap to the stage the bitmap is zoomed in twice the size it should be.  Its not capturing the true viewport.  its zoomed in.

This is what I'm using to capture the bitmap.

     SocialbitmapData = new BitmapData(socialWebView.viewPort.width, socialWebView.viewPort.height);

          

     socialWebView.drawViewPortToBitmapData(SocialbitmapData);

     socialViewBitmap = new Bitmap(SocialbitmapData);

     addChild(socialViewBitmap);

Any help is appreciated

This topic has been closed for replies.

2 replies

July 31, 2013

I'm trying my luck by asking if any of you found a solution for this issue?

Applauz78Author
Inspiring
April 2, 2012

Just thinking here.

Is there a way instead of drawing viewport to bitmap data .. I draw the stage to bitmap data.. then crop the image produced. ?  Maybe this would get around the problem ?

iBr3nt
Inspiring
April 2, 2012

Hi,

What you're seeing is expected behavior. The reason is, is that the StageWebView viewport is returning the actual dimensions of the new iPad view. Since SWV is actually using the native UIWebView, it's returning the high res result.

I'm guessing you didn't build the app with retina support, i.e. commandline compile with -platformsdk pointing to iOS 5.1 SDK. What you're seeing then is an image from the native browser returned at twice the resolution of what the app is returning, because the app isn't set to retina, but the browser is. To fix this, compile the app for retina display, then the image returned will be the correct proportion.

Try that and let us know.

iBrent

Colin Holgate
Inspiring
April 2, 2012

Or, can't you set the width and height of the bitmap to the width and height of the stageview that you created? That should scale it to 100% on the older iPads, and 50% on the new one.