<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Graphics not seen in exported image in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/graphics-not-seen-in-exported-image/m-p/1069042#M6751</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have some graphics (using a sketch tool, polyline) that I want to be shown in a PNG image export. I have added these graphics as overlay graphics as they are temporary only.&lt;/P&gt;&lt;P&gt;However when I try to export the PNG - they do not show up in the exported image.&lt;/P&gt;&lt;P&gt;Please help - but I'm guessing I have to use a proper graphics layer and have it added to the TOC - I didn't really want to do this as it is a temporary sketch and adding a graphics layers seem a bit more persisted.&lt;/P&gt;&lt;P&gt;The code below is showing how I create the export image:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; public static Task&amp;lt;bool&amp;gt; ExportMapToImage(Geometry geometry, string fileName)
        {
            return QueuedTask.Run(() =&amp;gt;
            {
                MapView map = MapView.Active;

                string tempPath = GeneralUtils.GetTempPath();
                string filePath = System.IO.Path.Combine(tempPath, fileName);
                if (File.Exists(filePath))
                {
                    File.Delete(filePath);
                }
                //Create PNG format with appropriate settings
                PNGFormat PNG = new PNGFormat();
                PNG.Resolution = 150;
                PNG.Height = 500;// geometry.Extent.Height;
                PNG.Width = 800;// geometry.Extent.Width; 
                PNG.OutputFileName = filePath;

                //Export active map view
                if (PNG.ValidateOutputFilePath())
                {
                    map.Export(PNG);
                }
                return true;
            });
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code shows how I am adding the graphics to the overlay:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;_graphicList.Add(mapView.AddOverlay(polyline, SymbolFactory.Instance.ConstructLineSymbol(ColorFactory.Instance.CreateRGBColor(0, 0, 0), 2, SimpleLineStyle.Solid).MakeSymbolReference()));&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 16 Jun 2021 18:51:39 GMT</pubDate>
    <dc:creator>Vidar</dc:creator>
    <dc:date>2021-06-16T18:51:39Z</dc:date>
    <item>
      <title>Graphics not seen in exported image</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/graphics-not-seen-in-exported-image/m-p/1069042#M6751</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have some graphics (using a sketch tool, polyline) that I want to be shown in a PNG image export. I have added these graphics as overlay graphics as they are temporary only.&lt;/P&gt;&lt;P&gt;However when I try to export the PNG - they do not show up in the exported image.&lt;/P&gt;&lt;P&gt;Please help - but I'm guessing I have to use a proper graphics layer and have it added to the TOC - I didn't really want to do this as it is a temporary sketch and adding a graphics layers seem a bit more persisted.&lt;/P&gt;&lt;P&gt;The code below is showing how I create the export image:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; public static Task&amp;lt;bool&amp;gt; ExportMapToImage(Geometry geometry, string fileName)
        {
            return QueuedTask.Run(() =&amp;gt;
            {
                MapView map = MapView.Active;

                string tempPath = GeneralUtils.GetTempPath();
                string filePath = System.IO.Path.Combine(tempPath, fileName);
                if (File.Exists(filePath))
                {
                    File.Delete(filePath);
                }
                //Create PNG format with appropriate settings
                PNGFormat PNG = new PNGFormat();
                PNG.Resolution = 150;
                PNG.Height = 500;// geometry.Extent.Height;
                PNG.Width = 800;// geometry.Extent.Width; 
                PNG.OutputFileName = filePath;

                //Export active map view
                if (PNG.ValidateOutputFilePath())
                {
                    map.Export(PNG);
                }
                return true;
            });
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code shows how I am adding the graphics to the overlay:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;_graphicList.Add(mapView.AddOverlay(polyline, SymbolFactory.Instance.ConstructLineSymbol(ColorFactory.Instance.CreateRGBColor(0, 0, 0), 2, SimpleLineStyle.Solid).MakeSymbolReference()));&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 16 Jun 2021 18:51:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/graphics-not-seen-in-exported-image/m-p/1069042#M6751</guid>
      <dc:creator>Vidar</dc:creator>
      <dc:date>2021-06-16T18:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Graphics not seen in exported image</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/graphics-not-seen-in-exported-image/m-p/1069074#M6752</link>
      <description>&lt;P&gt;Overlay graphics are not included in image exports in ArcGIS Pro.&amp;nbsp; I know, because I ran into the exact same issue.&amp;nbsp; This has been conformed by ESRI.&lt;/P&gt;&lt;P&gt;It is unclear if this will be added in the future.&amp;nbsp; The alternative is to use the graphics layer instead.&lt;/P&gt;&lt;P&gt;Kris&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 19:55:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/graphics-not-seen-in-exported-image/m-p/1069074#M6752</guid>
      <dc:creator>KrisCulin</dc:creator>
      <dc:date>2021-06-16T19:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: Graphics not seen in exported image</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/graphics-not-seen-in-exported-image/m-p/1069086#M6753</link>
      <description>&lt;P&gt;Overlay graphics that are only adding graphics to the MapView.&amp;nbsp; Overlay graphics is meant to help with Interactive MapView feedback.&amp;nbsp; &amp;nbsp;Like Chris said above you have to use a graphics layer instead.&lt;/P&gt;&lt;P&gt;I used this community sample code in the past for copy/paste inheritance:&amp;nbsp;&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Authoring/GraphicsLayers" target="_blank" rel="noopener"&gt;arcgis-pro-sdk-community-samples/Map-Authoring/GraphicsLayers at master · Esri/arcgis-pro-sdk-community-samples (github.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you download the 'Practical Dockpane' / '2021 Palm Springs' Dev Summit slides and sample code (&lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/tech-sessions" target="_blank"&gt;Tech Sessions · Esri/arcgis-pro-sdk Wiki (github.com)&lt;/A&gt;) you can also look the 'CompReporter' sample that is included.&amp;nbsp; The code creates a graphics layer on the fly and uses it in a layout view (and export).&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 20:41:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/graphics-not-seen-in-exported-image/m-p/1069086#M6753</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2021-06-16T20:41:59Z</dc:date>
    </item>
  </channel>
</rss>

