Copy link to clipboard
Copied
fixed on AIR 3.8 for IOS
https://bugbase.adobe.com/index.cfm?event=bug&id=3161013
Adobe AIR 3.8 relase notes, notable bug fixes:
StageWebView.drawViewPortToBitmapData draws incorrect bitmap on retina devices(3558603)
But this is still an issue on AIR 13.0.0.42 at Galaxy S3 (Android 4.3)
How to solve this problem?
There is an example test file (.fla) at zip: Link
here is the code:
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.events.MouseEvent
import flash.geom.Rectangle;
import flash.media.StageWebView;
var webView:StageWebView = new StageWebView();
webView.viewPort = new Rectangle(0,0,stage.stageWidth,stage.stageHeight-100);
webView.stage = this.stage;
webView.loadURL("http://labs.adobe.com/");
var webViewBitmap:Bitmap;
addBitmap.addEventListener(MouseEvent.CLICK, addBitmapClickHandler);
removeBitmap.addEventListener(MouseEvent.CLICK, removeBitmapClickHandler);
function addBitmapClickHandler(event:MouseEvent):void
{
var rect:Rectangle = webView.viewPort;
var bitmapData:BitmapData = new BitmapData(rect.width,rect.height,true,0xff0000);
webView.drawViewPortToBitmapData(bitmapData);
webViewBitmap = new Bitmap(bitmapData);
webView.stage = null;
addChild(webViewBitmap);
}
function removeBitmapClickHandler(event:MouseEvent):void
{
if (contains(webViewBitmap))
removeChild(webViewBitmap);
webView.stage = this.stage;
}
Copy link to clipboard
Copied
I am waiting for reply.
Thanks.
Copy link to clipboard
Copied
Thanks for reporting the issue, could you please try putting in “NO_SCALE” in your code as following?
stage.scaleMode = StageScaleMode.NO_SCALE;
Regards,
Jitender
Adobe AIR Team
Copy link to clipboard
Copied
Yes, it is working fine, thanks.
But i should publish the mobile application for IOS/Android with the code as following:
stage.scaleMode = StageScaleMode.EXACT_FIT
So how can i do to draw the correct bitmap from webview?
Or how can i calculate to the correct viewport from webview?
Copy link to clipboard
Copied
There are many cases where no_scale would not be appropriate, so it doesn’t really help if it solves the issue here.
Also, what is a mobile use case for exact_fit? As that would distort the stage, it could well be the cause of the problems you’re having.
How do things look if you use the default of show_all or you use no_border?
Copy link to clipboard
Copied
I have been testing on Galaxy S3 and encountering same issue which is 2x zoomed snapshot when i use StageScaleMode.SHOW_ALL, StageScaleMode.NO_BORDER or StageScaleMode.EXACT_FIT.
I have been getting correct result when i use StageScaleMode.NO_SCALE but this time StageWebview seems near the middle of the device.
What can i do in this case?
Copy link to clipboard
Copied
İ have been checking this issue but still an issue on AIR 13.0.0.55 which publised on labs page at 6 March.
Copy link to clipboard
Copied
any updates?