Open user790235692 opened 2 years ago
This may be the long way around the barn...but I've been using the FromStream option to do this without any problem.
string overlayIndex = "1" //Manage this as you see fit - just and example
_Overlay = new GroundOverlay()
{
Bounds = new Bounds(new Position(46.32, 5.51), new Position(46.45, 5.61)),
Icon = BitmapDescriptorFactory.FromStream(ToStream(bitmap_path), id:overlayIndex),
//Icon = BitmapDescriptorFactory.FromBundle("DJI_0962.jpg"),
Tag = "THE GROUNDOVERLAY",
ZIndex = 2
};
Then I built a little helper function to read the image into a stream...
public Stream ToStream(SkiaSharp.SKBitmap image) { var data = image.Encode(SkiaSharp.SKEncodedImageFormat.Png, 100); var myStream = new System.IO.MemoryStream(); data.SaveTo(myStream); return myStream; }
So into a stream and then out to the BitmapDescriptorFactory.
All the best!
VERSIONS
PLATFORMS
ACTUAL BEHAVIOR
ACTUAL SCREENSHOTS/STACKTRACE
I want to ground overlay an image taken by my DJI on the map where is place in the drawable folder of my app. I search a lot but I'm stuck. If soemone have a solution or a lead I wourld be grateful.