<?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 export map image in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/export-map-image/m-p/27389#M725</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i need to create map images by opening an Mxd file and export an image.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i use IMapServer::ExportMapImage(...) to create a map image,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in general this works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But how can i set a SpatialReference for the images which is different from Mxd file ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;All exported images should be created in esriSRGeoCSType::esriSRGeoCS_WGS1984&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This code will not work:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ISpatialReferenceFactoryPtr sRefEnv(CLSID_SpatialReferenceEnvironment);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IGeographicCoordinateSystemPtr pGeoSys;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;esriSRGeoCSType egt = esriSRGeoCSType::esriSRGeoCS_WGS1984;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sRefEnv-&amp;gt;CreateGeographicCoordinateSystem(egt,&amp;amp;pGeoSys);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ISpatialReferencePtr pSrc = pGeoSys;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//pMapDesc is type of IMapDescription interface&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pMapDesc-&amp;gt;putref_SpatialReference(pSrc); &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//if i set putref_SpatiaReference like above, this call crashes&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// pMapServer is type of IMapServer interface&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pMapServer-&amp;gt;ExportMapImage(...) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;any idea what is wrong ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 15 Sep 2012 13:12:04 GMT</pubDate>
    <dc:creator>konradenzensberger</dc:creator>
    <dc:date>2012-09-15T13:12:04Z</dc:date>
    <item>
      <title>export map image</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/export-map-image/m-p/27389#M725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i need to create map images by opening an Mxd file and export an image.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i use IMapServer::ExportMapImage(...) to create a map image,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in general this works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But how can i set a SpatialReference for the images which is different from Mxd file ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;All exported images should be created in esriSRGeoCSType::esriSRGeoCS_WGS1984&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This code will not work:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ISpatialReferenceFactoryPtr sRefEnv(CLSID_SpatialReferenceEnvironment);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IGeographicCoordinateSystemPtr pGeoSys;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;esriSRGeoCSType egt = esriSRGeoCSType::esriSRGeoCS_WGS1984;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sRefEnv-&amp;gt;CreateGeographicCoordinateSystem(egt,&amp;amp;pGeoSys);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ISpatialReferencePtr pSrc = pGeoSys;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//pMapDesc is type of IMapDescription interface&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pMapDesc-&amp;gt;putref_SpatialReference(pSrc); &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//if i set putref_SpatiaReference like above, this call crashes&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// pMapServer is type of IMapServer interface&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pMapServer-&amp;gt;ExportMapImage(...) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;any idea what is wrong ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Sep 2012 13:12:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/export-map-image/m-p/27389#M725</guid>
      <dc:creator>konradenzensberger</dc:creator>
      <dc:date>2012-09-15T13:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: export map image</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/export-map-image/m-p/27390#M726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On Server the projection is "locked" to the first layer in the mxd list and all other dynamic layers are automatically reprojected&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;to that projection. So I think it's a dead end street.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What might work is open your MXD in mapcontrol (or in memory) like you would in ArcMap;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;change the projection there and create an image from that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;David&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2012 15:11:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/export-map-image/m-p/27390#M726</guid>
      <dc:creator>DavidLednik</dc:creator>
      <dc:date>2012-10-05T15:11:24Z</dc:date>
    </item>
  </channel>
</rss>

