I am creating an Envelope with specific latitude and longitude bounds, zooming the MapView to that envelope, then exporting a BMPFormat image of the MapView. I am setting the BMPFormat to a specific height and width. What I am expecting, is an image with the full bounds of the Envelope, and only the envelope in the resulting bmp file. It seems like the resulting image is not the full bounds of the envelope, but just a portion of it. Is it possible to achieve what I want, and if so, what am I missing?
BMPFormat BMP = new BMPFormat()
{
Height = info.getResolutionHeight(),
Width = info.getResolutionWidth(),
HasWorldFile = true,
OutputFileName = MapImagePath
};MapView mapView = MapView.Active;
Envelope envelope = EnvelopeBuilderEx.CreateEnvelope(info.getLongitude(), info.getLatitude(),
info.getLongitude() + info.getLongitudeSpan(), info.getLatitude() + info.getLatitudeSpan(), ArcGIS.Core.Geometry.SpatialReferenceBuilder.CreateSpatialReference(4326));// wm:3857 , pc": 4326
mapView.ZoomTo(envelope);
// Write the bmp file to disk
if (mapView != null)
{
//Export on the worker thread
await QueuedTask.Run(() =>
{
//Check to see if the path is valid and export
if (BMP.ValidateOutputFilePath())
{
mapView.Export(BMP, mapView.Camera); //Export to BMP
}
});
}