<?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: Clipping the Data Frame by ArcObjects in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/clipping-the-data-frame-by-arcobjects/m-p/126964#M3332</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I believe IDisplay.ClipGeometry is what you're looking for but I've never tried it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Jan 2011 13:25:22 GMT</pubDate>
    <dc:creator>NeilClemmons</dc:creator>
    <dc:date>2011-01-21T13:25:22Z</dc:date>
    <item>
      <title>Clipping the Data Frame by ArcObjects</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/clipping-the-data-frame-by-arcobjects/m-p/126963#M3331</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;SPAN&gt;I would like to implement map clipping functionality. There is a simple way to do it &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s90000000q000000.htm"&gt;in ArcMap as described here&lt;/A&gt;&lt;SPAN&gt;. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you now what is the right ArcObjects interface which sets the clipping shape? I have been looking the documentation back and forth but I can't find it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jan 2011 05:49:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/clipping-the-data-frame-by-arcobjects/m-p/126963#M3331</guid>
      <dc:creator>PetrPokorny</dc:creator>
      <dc:date>2011-01-21T05:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping the Data Frame by ArcObjects</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/clipping-the-data-frame-by-arcobjects/m-p/126964#M3332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I believe IDisplay.ClipGeometry is what you're looking for but I've never tried it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jan 2011 13:25:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/clipping-the-data-frame-by-arcobjects/m-p/126964#M3332</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2011-01-21T13:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping the Data Frame by ArcObjects</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/clipping-the-data-frame-by-arcobjects/m-p/126965#M3333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Neil, thanks for your idea. I will try it ASAP.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By the time I have found out &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/ClipGeometry_Property/001200000m91000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;IMap.ClipGeometry&lt;/A&gt;&lt;SPAN&gt;. I don't know how I could miss it for the first time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However I am not able to get it working. Whatever geometry I set, the returned image is still the same and no clipping is applied. Does any one know what else needs to be done? Unfortunately the documentation promises example but doesn't provide any.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the important piece of my code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
ESRI.ArcGIS.Carto.&lt;SPAN style="color:&amp;quot;DeepSkyBlue&amp;quot;;"&gt;IMapServer &lt;/SPAN&gt;mapServer = (ESRI.ArcGIS.Carto.&lt;SPAN style="color:&amp;quot;DeepSkyBlue&amp;quot;;"&gt;IMapServer&lt;/SPAN&gt;)serverContext.ServerObject;
ESRI.ArcGIS.Carto.&lt;SPAN style="color:&amp;quot;DeepSkyBlue&amp;quot;;"&gt;IMapServerObjects2 &lt;/SPAN&gt;mapServerObjects = (ESRI.ArcGIS.Carto.&lt;SPAN style="color:&amp;quot;DeepSkyBlue&amp;quot;;"&gt;IMapServerObjects2&lt;/SPAN&gt;)mapServer;
&lt;SPAN style="color:&amp;quot;Blue&amp;quot;;"&gt;string &lt;/SPAN&gt;mapName = mapServer.DefaultMapName;
ESRI.ArcGIS.Carto.&lt;SPAN style="color:&amp;quot;DeepSkyBlue&amp;quot;;"&gt;IMap &lt;/SPAN&gt;map = mapServerObjects.get_Map(mapName);
map.ClipGeometry = GetClippingGeometry();
mapServerObjects.RefreshServerObjects();

ESRI.ArcGIS.Carto.&lt;SPAN style="color:&amp;quot;DeepSkyBlue&amp;quot;;"&gt;IImageType &lt;/SPAN&gt;imageType = serverContext.CreateObject(&lt;SPAN style="color:&amp;quot;DarkRed&amp;quot;;"&gt;"esriCarto.ImageType"&lt;/SPAN&gt;) &lt;SPAN style="color:&amp;quot;Blue&amp;quot;;"&gt;as &lt;/SPAN&gt;ESRI.ArcGIS.Carto.&lt;SPAN style="color:&amp;quot;DeepSkyBlue&amp;quot;;"&gt;IImageType&lt;/SPAN&gt;;
ESRI.ArcGIS.Carto.&lt;SPAN style="color:&amp;quot;DeepSkyBlue&amp;quot;;"&gt;IImageDescription &lt;/SPAN&gt;imageDescription = serverContext.CreateObject(&lt;SPAN style="color:&amp;quot;DarkRed&amp;quot;;"&gt;"esriCarto.ImageDescription"&lt;/SPAN&gt;) &lt;SPAN style="color:&amp;quot;Blue&amp;quot;;"&gt;as &lt;/SPAN&gt;ESRI.ArcGIS.Carto.&lt;SPAN style="color:&amp;quot;DeepSkyBlue&amp;quot;;"&gt;ImageDescription&lt;/SPAN&gt;;
ESRI.ArcGIS.Carto.&lt;SPAN style="color:&amp;quot;DeepSkyBlue&amp;quot;;"&gt;IImageDisplay &lt;/SPAN&gt;imageDisplay = serverContext.CreateObject(&lt;SPAN style="color:&amp;quot;DarkRed&amp;quot;;"&gt;"esriCarto.ImageDisplay"&lt;/SPAN&gt;) &lt;SPAN style="color:&amp;quot;Blue&amp;quot;;"&gt;as &lt;/SPAN&gt;ESRI.ArcGIS.Carto.&lt;SPAN style="color:&amp;quot;DeepSkyBlue&amp;quot;;"&gt;ImageDisplay&lt;/SPAN&gt;;

imageType.Format = ESRI.ArcGIS.Carto.&lt;SPAN style="color:&amp;quot;DeepSkyBlue&amp;quot;;"&gt;esriImageFormat&lt;/SPAN&gt;.esriImagePNG;
imageType.ReturnType = ESRI.ArcGIS.Carto.&lt;SPAN style="color:&amp;quot;DeepSkyBlue&amp;quot;;"&gt;esriImageReturnType&lt;/SPAN&gt;.esriImageReturnMimeData;
imageDisplay.Height = 800;
imageDisplay.Width = 60;
imageDisplay.DeviceResolution = 96;
imageDescription.Display = imageDisplay;
imageDescription.Type = imageType;

ESRI.ArcGIS.Carto.&lt;SPAN style="color:&amp;quot;DeepSkyBlue&amp;quot;;"&gt;IMapServerInfo &lt;/SPAN&gt;mapServerInfo = mapServer.GetServerInfo(mapServer.DefaultMapName);
ESRI.ArcGIS.Carto.&lt;SPAN style="color:&amp;quot;DeepSkyBlue&amp;quot;;"&gt;IMapDescription &lt;/SPAN&gt;aoMapDescription = mapServerInfo.DefaultMapDescription; 
ESRI.ArcGIS.Carto.&lt;SPAN style="color:&amp;quot;DeepSkyBlue&amp;quot;;"&gt;IImageResult &lt;/SPAN&gt;mapImage = mapServer.ExportMapImage(aoMapDescription, imageDescription);
&lt;SPAN style="color:&amp;quot;Blue&amp;quot;;"&gt;return &lt;/SPAN&gt;mapImage.MimeData;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:12:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/clipping-the-data-frame-by-arcobjects/m-p/126965#M3333</guid>
      <dc:creator>PetrPokorny</dc:creator>
      <dc:date>2021-12-11T07:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping the Data Frame by ArcObjects</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/clipping-the-data-frame-by-arcobjects/m-p/126966#M3334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Do you know how to easily use IDisplay to affect the image exported from IMapServer? I can see that it only works with IImageDisplay which doesn't have any property like IDisplay.ClipGeometry.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Btw. I would like to add a small comment to the code in my previous post.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I specify the clipping geometry in ArcMap and publish the service then the images are clipped by that geometry. Of course I have to drop these two lines of code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;map.ClipGeometry = GetClippingGeometry();
mapServerObjects.RefreshServerObjects();&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;But if I do not set the clipping geometry via ArcMap, create the service and uncomment those two lines then the clipping is not applied.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This makes me believe that the drawing part is correct and the problem is in those two lines.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:03:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/clipping-the-data-frame-by-arcobjects/m-p/126966#M3334</guid>
      <dc:creator>PetrPokorny</dc:creator>
      <dc:date>2021-12-12T16:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping the Data Frame by ArcObjects</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/clipping-the-data-frame-by-arcobjects/m-p/126967#M3335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey there,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;just in order to complete the thread:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Clipping the data frame works fine for me passing an IPolygon object to IMap.ClipGeometry using pMxDoc.ActiveView.Refresh() afterwards.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;pmap = pMxDoc.FocusMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pmap.ClipGeometry = pClipGeom&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pMxDoc.ActiveView.Refresh()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Johannes&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 May 2012 10:22:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/clipping-the-data-frame-by-arcobjects/m-p/126967#M3335</guid>
      <dc:creator>johannesuhl</dc:creator>
      <dc:date>2012-05-21T10:22:02Z</dc:date>
    </item>
  </channel>
</rss>

