openlayers in webview format in xamarin problem

MagicMagic Member

We implemented openlayers in webview format in xamarin. And when I capture by adding capture function to xamarin,
the map part of openlayers is white and there is no response to xamarin when I use openlayer's export-png function.
I need help with this problem

capture andriod use

public async Task<byte[]> CaptureScreenAsync()
{
var activity = Xamarin.Forms.Forms.Context as MainActivity;
if (activity == null)
{
return null;
}
var view = activity.Window.DecorView;
view.DrawingCacheEnabled = true;
Bitmap bitmap = view.GetDrawingCache(true);
byte[] bitmapData;
using (var stream = new MemoryStream())
{
bitmap.Compress(Bitmap.CompressFormat.Png, 0, stream);
bitmapData = stream.ToArray();
}
return bitmapData;
}

Sign In or Register to comment.