Hi,
I wrote the below code to load Rasterfile(Tif,BMP,JPG,PNG,...):
Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
// Show open file dialog box
Nullable<bool> result = dlg.ShowDialog();
// Process open file dialog box results
if (result == true)
{
wpfMap1.MapUnit = GeographyUnit.DecimalDegree;
GdalRasterLayer worldLayer = new GdalRasterLayer(dlg.FileName);
worldLayer.LowerThreshold = 0;
worldLayer.UpperThreshold = double.MaxValue;
worldLayer.Open();
wpfMap1.CurrentExtent = worldLayer.GetBoundingBox();
worldLayer.Close();
LayerOverlay worldOverlay = new LayerOverlay();
worldOverlay.Layers.Add(Guid.NewGuid().ToString(), worldLayer);
wpfMap1.Overlays.Add(Guid.NewGuid().ToString(), worldOverlay);
wpfMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean);
try
{
wpfMap1.Refresh();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
1- It just work fine with 'world.tif' file that is located on 'Programfil\ThinkGeo\..\sample data' folder. and for the other files the control just show 'Exception has been thrown by the target of an i...'(just this part of the message is visable).
2- It seems that Map Suit explorer has this problem too!
3-I change the 'Procesors Affinity' too (only one CPU selected), but the problem did not solve.
4-I could not find any sample project/code that shows how we can open FDO Extension files (Except Tab Extension). it will be great if you create sample project at least for very important extensions like:
CSV, TIFF-LZW, Raster (Various image files), DXF, MID/MIF, NTF
Regards,
Ben