Hello everyone,
I've got an issue with the GEOTIFF file extension. When I load a file in the MapSuiteExplorer, it works well.
But when I load it in my application, I've got an exception like that :
Exception: Parameter is not valid., StackTrace : at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
at System.Drawing.Bitmap..ctor(Int32 width, Int32 height)
at ThinkGeo.MapSuite.Core.ManagedGeoTiffRasterSource.x27de45cef66fd62c(Int32 x2434aab1f3e81535, Int32 xd5d735eaa7ef859e, Int32 xf0ca5ed7845b9192, Int32 xf806d545410d90c1, Int32 xdb846c58acdf5e40, Int32 xdf58594ba412eecf)
at ThinkGeo.MapSuite.Core.ManagedGeoTiffRasterSource.x4a80972f7129d9ec(Int32 x2434aab1f3e81535, Int32 xd5d735eaa7ef859e, Int32 xf0ca5ed7845b9192, Int32 xf806d545410d90c1, Int32 xdb846c58acdf5e40, Int32 xdf58594ba412eecf)
at ThinkGeo.MapSuite.Core.ManagedGeoTiffRasterSource.GetImageCore(RectangleShape worldExtent, Int32 canvasWidth, Int32 canvasHeight)
at ThinkGeo.MapSuite.Core.RasterSource.GetImage(RectangleShape worldExtent, Int32 canvasWidth, Int32 canvasHeight)
at ThinkGeo.MapSuite.Core.GeoTiffRasterSource.GetImageCore(RectangleShape worldExtent, Int32 canvasWidth, Int32 canvasHeight)
at ThinkGeo.MapSuite.Core.RasterSource.GetImage(RectangleShape worldExtent, Int32 canvasWidth, Int32 canvasHeight)
at ThinkGeo.MapSuite.Core.GeoTiffRasterSource.GetImageCore(RectangleShape worldExtent, Int32 canvasWidth, Int32 canvasHeight)
at ThinkGeo.MapSuite.Core.RasterSource.GetImage(RectangleShape worldExtent, Int32 canvasWidth, Int32 canvasHeight)
at ThinkGeo.MapSuite.Core.RasterLayer.DrawCore(GeoCanvas canvas, Collection`1 labelsInAllLayers)
at ThinkGeo.MapSuite.Core.Layer.Draw(GeoCanvas canvas, Collection`1 labelsInAllLayers)
at ThinkGeo.MapSuite.Core.GroupLayer.DrawCore(GeoCanvas canvas, Collection`1 labelsInAllLayers)
at ThinkGeo.MapSuite.Core.Layer.Draw(GeoCanvas canvas, Collection`1 labelsInAllLayers)
at ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.DrawCore(GeoCanvas canvas)
at ThinkGeo.MapSuite.DesktopEdition.Overlay.MainDraw(GeoCanvas canvas)
at ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas canvas)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x03e3d48bcfe7bb6c(IEnumerable`1 xa6f0db4f183189f1)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.xff5b27c00f9678c2(RectangleShape x178b193eec228e6e)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.xe3cee4adb9c72451()
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x9ac8c50f434f4b39(Int32 xb565f4681f05557a)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.Refresh(IEnumerable`1 redrawOverlays)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.Refresh()
That's how I load the file :
Collection<Layer> layers = new Collection<Layer>();
DirectoryInfo di = new DirectoryInfo(GeoTiffFolder);
List<FileInfo> files = di.GetFiles().Where(f => f.Extension.ToLower() == EXTENSION_TIF.ToLower()).ToList();
foreach (FileInfo file in files)
{
GeoTiffRasterLayer worldLayer = new GeoTiffRasterLayer(file.FullName);
worldLayer.LibraryType = GeoTiffLibraryType.UnmanagedLibTiff;
worldLayer.UpperThreshold = double.MaxValue;
worldLayer.LowerThreshold = 0;
worldLayer.IsGrayscale = false;
layers.Add(worldLayer);
}
GroupLayer backgroundLayer = new GroupLayer();
foreach (Layer ly in backgroundLayers)
{
backgroundLayer.Layers.Add(ly);
}
staticOverlay.Layers.Add(backgroundLayer.Name, backgroundLayer);
Have you any idea for this exception ?
Thanks by advance.
PS : I join you my TIF file : douchet-pierre-antoine.fr/fi...-tif_2.zip