Skip navigation
Currently Being Moderated

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

Apr 2, 2012 8:16 AM

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

 
Replies
  • Currently Being Moderated
    Apr 2, 2012 9:49 AM   in reply to Applauz78

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 2, 2012 9:56 AM   in reply to iBr3nt

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 2, 2012 10:41 AM   in reply to Applauz78

    That wasn't what I was suggesting. What Rect do you use when creating socialWebView? Can't you set the bitmap to occupy the same rect? The viewPort.width will vary depending on whether it's Retina or not, but surely the stageWebView rect you use will remain the same.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 2, 2012 10:59 AM   in reply to Applauz78

    Still not what I was saying. Leave the rect as 1024x664, when you get the bitmap, set its scaleX to 1024/stageWebView.viewPort.width and its scaleY to 664/stageWebView.viewPort.height. That should have no effect on the iPad 2, but ought to scale the image to the right size on the new iPad.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 2, 2012 7:54 PM   in reply to Applauz78

    What are you using to build this, Flash CS5.5 or Flash Builder? Let me try something...

     

    iBrent

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 3, 2012 2:06 PM   in reply to Applauz78

    So far I've been able to replicate the problem.

     

    For some reason the image created from the SWV is zoomed in. I see it on

    my Xoom tablet as well as the iPad. Still looking into possible

    workarounds...

     

    iBrent

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 8, 2012 7:28 PM   in reply to Applauz78

    Hi,

     

    I've tried a number of things and can't get it to work on the new iPad at the retina display. I don't know if it's an AIR defect, or if it's something with the way UIWebView (the native SDK implementation) is returning incorrect information.

     

    If you're looking to release now, I'd suggest releasing without new iPad retina support, then when it's been fixed in AIR (hopefully) then release an update to address the issue.

     

    Sorry,

     

    iBrent

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 31, 2013 12:55 PM   in reply to Applauz78

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

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points