How can I close the file used by the GdiPlusRasterLayer? I try removing the overlays from the map but the file is still locked so I can't overlay or replace the file. I am using desktop edition 4.0.
Closing a file using GdiPlusRasterLayer
Gregory,
I am afraid I am probably misunderstanding something; I did the following test it works fine.
After executing the following statement, the raster tif file (world.tif) can be deleted without any problem.
GdiPlusRasterLayer worldImageLayer = new GdiPlusRasterLayer(@"..\..\SampleData\Data\world.tif");
worldImageLayer.UpperThreshold = double.MaxValue;
worldImageLayer.LowerThreshold = 0;
worldImageLayer.IsGrayscale = false;
worldImageLayer.Open();
float widht = worldImageLayer.GreenTranslation;
worldImageLayer.Close();
Any more questions please feel free to let me know.
Thanks.
Yale
My bad! I was doing something in the background to the file and that is where the problem occurred. Thanks for your help!
Gregory,
We’re glad it’s working with you.
Please let us know if you have more questions
Thanks
James