Create custom map png from bounding box

274
2
Jump to solution
02-12-2024 02:30 PM
estz2
by
New Contributor II

Hi everyone! I am working with an ArcGIS add-in that generates reports. One component of the report is a map image contextualizing the rest of the report. The way I have it set up now is that the add-in will take a "screenshot" of the current map view and use that as the image in the report.

I have run into a few problems with this approach, like the size of the image depending on the size of their open ArcGIS window, as well as a lack of legends/north directional indicator. 

Is there a way in the ArcGIS Pro SDK to give like a bounding box and generate a map image with preset dimensions, included layers, legend, etc. from that? I would love to standardize this step of the process more than it is right now. Let me know your thoughts! Thank you

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
CharlesMacleod
Esri Regular Contributor

For the map view _only_ there is mapView.CaptureThumbnail(width, height) https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic19522.html but it sounds like u might already be using this?

 

For a legend, northarrow, other marginalia, etc. u r basically describing the purpose of a Layout. https://pro.arcgis.com/en/pro-app/latest/help/layouts/layouts-in-arcgis-pro.htm Layouts can be exported to a variety of different formats including various image formats and pdf.

https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic22445.html - u will also find some code examples on this reference page.

 

View solution in original post

2 Replies
CharlesMacleod
Esri Regular Contributor

For the map view _only_ there is mapView.CaptureThumbnail(width, height) https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic19522.html but it sounds like u might already be using this?

 

For a legend, northarrow, other marginalia, etc. u r basically describing the purpose of a Layout. https://pro.arcgis.com/en/pro-app/latest/help/layouts/layouts-in-arcgis-pro.htm Layouts can be exported to a variety of different formats including various image formats and pdf.

https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic22445.html - u will also find some code examples on this reference page.

 

estz2
by
New Contributor II

Hi @CharlesMacleod layouts look great! I have been able to create the layout I want and look at it through the CreateLayoutPaneAsync function. But run into errors when I export it. Has this bug really been resolved in 3.2? BUG-000157092 for ArcGIS Pro SDK for .NET (esri.com)

0 Kudos