Skip to main content
Lars Laborious
Legend
February 15, 2013
Question

drawViewPortToBitmapData in AIR 3.5/3.6 vs. lower

  • February 15, 2013
  • 4 replies
  • 1114 views

Hi all.

I notice that when I use drawViewPortToBitmapData (to draw a stageWebView), and publish using AIR 3.5 or AIR 3.6, the bitmap (or rather the view portion of the bitmap) scales down to half it's size when I view it on a iPhone4 S or iPhone5. But if I use AIR 3.4 the bitmap fills the stage. I assume this has to do with the viewport not being retina size, but don't know for sure. I don't have a non-retina iPhone to test with , so the question is: Is it safe to use AIR 3.5 or AIR 3.6 and simply scale the bitmap up so that it fills a retina iPhone, or will that make the bitmap to large for a non-retina iPhone?

This topic has been closed for replies.

4 replies

Lars Laborious
Legend
February 15, 2013

One more thing. In recent posts on this forum some suggested that there is a bug in AIR 3.5 where drawViewPortToBitmapData is capturing the screen at non-retina resolution. But I'm not sure if it really is a bug since it still behaves this way in AIR 3.6...

Inspiring
February 15, 2013

For my project, I have to use two different rect dimensions for capturing shots; one for retina, one for non-retina. I set up rect vars on app launch and then use these throughout the project. This way, if Adobe or Darkredz (for the UIWebView ANE I use) changes something in the API in regards to this issue, I only have to change the rect numbers once.

Lars Laborious
Legend
February 15, 2013

Ok, do you use drawViewPortToBitmapData()?

I have only been able to use height and width of the viewPort when creating the bitmapData:

var bmd:BitmapData = new BitmapData(webView.viewPort.width, webView.viewPort.height);

webView.drawViewPortToBitmapData(bmd);

var bitmap:Bitmap = new Bitmap(bmd);

Then when I have the bitmap I can scale it up (it draws the viewport half the size of the retina screen and if I set transparent to false and a fillcolor - in the bitmapData object - I see color on the right side and below). But this only happens in AIR 3.5+