<?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 Re: C# ExportFormat xWidth, yHeight dimensions from MapView.Active.Extent in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/c-exportformat-xwidth-yheight-dimensions-from/m-p/867700#M5031</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Charles.&amp;nbsp; .GetViewSize() is what I needed, but I still had to implement the 'cheat' above to get anything that resembled the actual mapview aspect ratio without truncating it.&amp;nbsp; (This interface won't let me attach images above 1920x1080.)&amp;nbsp; I believe this method would ALSO work if the user merely wanted a low-res screenshot--just delete the *3 multipliers from resolution, height, width. Here's where I ended up:&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;private async void Xprt_mv_Click(object sender, EventArgs e)&lt;BR /&gt; {&lt;BR /&gt; await ActMap();&lt;/P&gt;&lt;P&gt;if (File.Exists(GVar.DL + @"temp\MapView.tiff"))&lt;BR /&gt; {&lt;BR /&gt; File.Delete(GVar.DL + @"temp\MapView.tiff");&lt;BR /&gt; }&lt;BR /&gt; if (File.Exists(GVar.DL + @"temp\MapView.tfw"))&lt;BR /&gt; {&lt;BR /&gt; File.Delete(GVar.DL + @"temp\MapView.tfw");&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;await QueuedTask.Run(() =&amp;gt;&lt;BR /&gt; {&lt;BR /&gt; MapView activeMapView = MapView.Active;&lt;BR /&gt; var mvs = activeMapView.GetViewSize(); //get active mapview size&lt;BR /&gt; double mvsh = (mvs.Height)*3; //set height variable *3 for printable resolution&lt;BR /&gt; double mvsw = (mvs.Width)*3; //set width variable *3 for printable resolution&lt;BR /&gt; int ResoMultiplied = 96 * 3; //native System display resolution 96ppi *3 for printable resolution&lt;/P&gt;&lt;P&gt;if (activeMapView != null)&lt;BR /&gt; {&lt;BR /&gt; TIFFFormat Tiff = new TIFFFormat()&lt;BR /&gt; {&lt;BR /&gt; Resolution = ResoMultiplied, //use resolution multiplied&lt;BR /&gt; Height = mvsh, //use height variable&lt;BR /&gt; Width = mvsw, //use width variable&lt;BR /&gt; HasWorldFile = true,&lt;BR /&gt; OutputFileName = GVar.DL + @"temp\MapView.tiff"&lt;BR /&gt; };&lt;/P&gt;&lt;P&gt;//Export active map view&lt;BR /&gt; if (Tiff.ValidateOutputFilePath())&lt;BR /&gt; {&lt;BR /&gt; activeMapView.Export(Tiff);&lt;BR /&gt; }&lt;BR /&gt; try&lt;BR /&gt; {&lt;BR /&gt; string filepath = GVar.DL + @"temp\";&lt;BR /&gt; Process.Start(filepath);&lt;BR /&gt; }&lt;BR /&gt; catch (Exception)&lt;BR /&gt; {&lt;BR /&gt; MessageBox.Show("Could not open the image's containing folder because it does not exist.", " Missing FilePath",&lt;BR /&gt; MessageBoxButtons.OK,&lt;BR /&gt; MessageBoxIcon.Warning,&lt;BR /&gt; MessageBoxDefaultButton.Button1,&lt;BR /&gt; MessageBoxOptions.DefaultDesktopOnly);&lt;BR /&gt; return;&lt;BR /&gt; }&lt;BR /&gt; // emf, eps, gif, jpeg, pdf, png, svg, tga, tiff formats also available for export&lt;BR /&gt; }&lt;BR /&gt; });&lt;BR /&gt; }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Sep 2018 12:59:20 GMT</pubDate>
    <dc:creator>MikeRatcliffe</dc:creator>
    <dc:date>2018-09-04T12:59:20Z</dc:date>
    <item>
      <title>C# ExportFormat xWidth, yHeight dimensions from MapView.Active.Extent</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/c-exportformat-xwidth-yheight-dimensions-from/m-p/867697#M5028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd like to get the pixel width and height from the MapView.Active.Extent or Camera&amp;nbsp;or Geometry to feed ExportFormat's Height/Width.&amp;nbsp; I do this so the exported dimensions of the Tiff etc. match the MapView Extent as the user might expect.&lt;/P&gt;&lt;P&gt;Reference:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://github.com/Esri/arcgis-pro-sdk/wiki/ProSnippets-Layouts#export-the-active-mapview" title="https://github.com/Esri/arcgis-pro-sdk/wiki/ProSnippets-Layouts#export-the-active-mapview"&gt;ProSnippets Layouts · Esri/arcgis-pro-sdk Wiki · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2018 17:40:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/c-exportformat-xwidth-yheight-dimensions-from/m-p/867697#M5028</guid>
      <dc:creator>MikeRatcliffe</dc:creator>
      <dc:date>2018-08-27T17:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: C# ExportFormat xWidth, yHeight dimensions from MapView.Active.Extent</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/c-exportformat-xwidth-yheight-dimensions-from/m-p/867698#M5029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can cheat to get usable (printable) results from ExportFormat&amp;nbsp;with the parameter settings formula below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(96ppi resolution, 1080p height, 1920 width)*3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yields:&lt;/P&gt;&lt;P&gt;Resolution = 288,&lt;/P&gt;&lt;P&gt;Height = 3240,&lt;/P&gt;&lt;P&gt;Width = 5760,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exporting a .tiff&amp;nbsp;produces a 1MB file that does not truncate the mapview if the native resolution of your monitor is 1920x1080.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a cheat, not a real solution to the question above.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2018 14:20:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/c-exportformat-xwidth-yheight-dimensions-from/m-p/867698#M5029</guid>
      <dc:creator>MikeRatcliffe</dc:creator>
      <dc:date>2018-08-30T14:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: C# ExportFormat xWidth, yHeight dimensions from MapView.Active.Extent</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/c-exportformat-xwidth-yheight-dimensions-from/m-p/867699#M5030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this what you are looking for?&lt;/P&gt;&lt;P&gt;&lt;A href="http://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic17213.html"&gt;mapView.GetViewSize()&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2018 20:35:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/c-exportformat-xwidth-yheight-dimensions-from/m-p/867699#M5030</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2018-08-31T20:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: C# ExportFormat xWidth, yHeight dimensions from MapView.Active.Extent</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/c-exportformat-xwidth-yheight-dimensions-from/m-p/867700#M5031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Charles.&amp;nbsp; .GetViewSize() is what I needed, but I still had to implement the 'cheat' above to get anything that resembled the actual mapview aspect ratio without truncating it.&amp;nbsp; (This interface won't let me attach images above 1920x1080.)&amp;nbsp; I believe this method would ALSO work if the user merely wanted a low-res screenshot--just delete the *3 multipliers from resolution, height, width. Here's where I ended up:&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;private async void Xprt_mv_Click(object sender, EventArgs e)&lt;BR /&gt; {&lt;BR /&gt; await ActMap();&lt;/P&gt;&lt;P&gt;if (File.Exists(GVar.DL + @"temp\MapView.tiff"))&lt;BR /&gt; {&lt;BR /&gt; File.Delete(GVar.DL + @"temp\MapView.tiff");&lt;BR /&gt; }&lt;BR /&gt; if (File.Exists(GVar.DL + @"temp\MapView.tfw"))&lt;BR /&gt; {&lt;BR /&gt; File.Delete(GVar.DL + @"temp\MapView.tfw");&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;await QueuedTask.Run(() =&amp;gt;&lt;BR /&gt; {&lt;BR /&gt; MapView activeMapView = MapView.Active;&lt;BR /&gt; var mvs = activeMapView.GetViewSize(); //get active mapview size&lt;BR /&gt; double mvsh = (mvs.Height)*3; //set height variable *3 for printable resolution&lt;BR /&gt; double mvsw = (mvs.Width)*3; //set width variable *3 for printable resolution&lt;BR /&gt; int ResoMultiplied = 96 * 3; //native System display resolution 96ppi *3 for printable resolution&lt;/P&gt;&lt;P&gt;if (activeMapView != null)&lt;BR /&gt; {&lt;BR /&gt; TIFFFormat Tiff = new TIFFFormat()&lt;BR /&gt; {&lt;BR /&gt; Resolution = ResoMultiplied, //use resolution multiplied&lt;BR /&gt; Height = mvsh, //use height variable&lt;BR /&gt; Width = mvsw, //use width variable&lt;BR /&gt; HasWorldFile = true,&lt;BR /&gt; OutputFileName = GVar.DL + @"temp\MapView.tiff"&lt;BR /&gt; };&lt;/P&gt;&lt;P&gt;//Export active map view&lt;BR /&gt; if (Tiff.ValidateOutputFilePath())&lt;BR /&gt; {&lt;BR /&gt; activeMapView.Export(Tiff);&lt;BR /&gt; }&lt;BR /&gt; try&lt;BR /&gt; {&lt;BR /&gt; string filepath = GVar.DL + @"temp\";&lt;BR /&gt; Process.Start(filepath);&lt;BR /&gt; }&lt;BR /&gt; catch (Exception)&lt;BR /&gt; {&lt;BR /&gt; MessageBox.Show("Could not open the image's containing folder because it does not exist.", " Missing FilePath",&lt;BR /&gt; MessageBoxButtons.OK,&lt;BR /&gt; MessageBoxIcon.Warning,&lt;BR /&gt; MessageBoxDefaultButton.Button1,&lt;BR /&gt; MessageBoxOptions.DefaultDesktopOnly);&lt;BR /&gt; return;&lt;BR /&gt; }&lt;BR /&gt; // emf, eps, gif, jpeg, pdf, png, svg, tga, tiff formats also available for export&lt;BR /&gt; }&lt;BR /&gt; });&lt;BR /&gt; }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2018 12:59:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/c-exportformat-xwidth-yheight-dimensions-from/m-p/867700#M5031</guid>
      <dc:creator>MikeRatcliffe</dc:creator>
      <dc:date>2018-09-04T12:59:20Z</dc:date>
    </item>
  </channel>
</rss>

