<?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 RasterLayerClass won't release lock on image file when AxMapControl is disposed. in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/rasterlayerclass-won-t-release-lock-on-image-file/m-p/426179#M11507</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;Using VB.Net 2008 and ArcGIS Engine 2010 SP1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am dynamically downloading a *.jpeg file from &lt;/SPAN&gt;&lt;A href="http://msrmaps.com/"&gt;http://msrmaps.com/&lt;/A&gt;&lt;SPAN&gt; (used to be terraserver.usa) and&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;have no problem adding it as raster layer using the RasterLayerClass and CreateFromFilePath method (image shows up just fine on the map), however I want to delete the *.jpeg file when I'm done with it (after the the map control is disposed and AOUninitialize is called - the image is no longer needed).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried deleting the file after the form that contained the map control was disposed but was unable to do so.&amp;nbsp; Once I shutdown the entire application I can manually delete the file, but I want to delete the file automatically in code once I'm done with it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a better way to use the tempory image file rather than with RasterLayerClass and CreateFromFilePath so I can delete the image when I'm done with it, or perhaps there is a method to load the image directly into the default scratch workspace (which gets automatically deleted when the map closes) and then delete the source *.jpeg file?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Doug.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 May 2011 14:19:53 GMT</pubDate>
    <dc:creator>DougMarquardt</dc:creator>
    <dc:date>2011-05-17T14:19:53Z</dc:date>
    <item>
      <title>RasterLayerClass won't release lock on image file when AxMapControl is disposed.</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/rasterlayerclass-won-t-release-lock-on-image-file/m-p/426179#M11507</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;Using VB.Net 2008 and ArcGIS Engine 2010 SP1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am dynamically downloading a *.jpeg file from &lt;/SPAN&gt;&lt;A href="http://msrmaps.com/"&gt;http://msrmaps.com/&lt;/A&gt;&lt;SPAN&gt; (used to be terraserver.usa) and&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;have no problem adding it as raster layer using the RasterLayerClass and CreateFromFilePath method (image shows up just fine on the map), however I want to delete the *.jpeg file when I'm done with it (after the the map control is disposed and AOUninitialize is called - the image is no longer needed).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried deleting the file after the form that contained the map control was disposed but was unable to do so.&amp;nbsp; Once I shutdown the entire application I can manually delete the file, but I want to delete the file automatically in code once I'm done with it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a better way to use the tempory image file rather than with RasterLayerClass and CreateFromFilePath so I can delete the image when I'm done with it, or perhaps there is a method to load the image directly into the default scratch workspace (which gets automatically deleted when the map closes) and then delete the source *.jpeg file?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Doug.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2011 14:19:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/rasterlayerclass-won-t-release-lock-on-image-file/m-p/426179#M11507</guid>
      <dc:creator>DougMarquardt</dc:creator>
      <dc:date>2011-05-17T14:19:53Z</dc:date>
    </item>
  </channel>
</rss>

