So, I thought I would test it in MapSuite Explorer. I was surprised to see that the image was distorted in different ways depending on whether I made the Explorer window size bigger vertically or horizontally.
Why would Explorer do this? Surely the map shouldn't change shape just because I want to see more of it? Instead it stretches out the data to fit the larger area instead of showing me more of the data. 2 examples below:
I think your problem should because the information in TWF record different projection with your map using.
Could you make sure the projection of your TWF file?
I think the stretching in exporler because our Explorer don’t load projection, so it will direction load image file and after that the image will stretching together with the map control.
As far as I can determine, the tfw is fine - these files are from a reputable supplier. Also, as can be seen from the 2 screen dumps below, Manifold has no problem both showing an image that is not "ripped" and is geolocated properly.
As for Map Suite Explorer not loading the projection with the tiff file, that seems like a deficiency to me - the Explorer is basically acting like a simple image viewer rather than a raster map viewer.
So, any ideas? I can send a copy of the TIF/TWF file if needed.
Thanks for point this problem, I am sure we will improve our Explorer better in future.
Your iamge files for test or a simple sample contains your images will helpful for us, please upload that to our FTP or sent that to support@thinkgeo.com and tell him forward to me.
And have you tried to load the files in some other data viewer for test? If you did could you please also sent the result to me.
Ok, I changed my code and this appears to have fixed the problem on my development machine. However, I installed the new app (after rebuilding the setup) on a test machine and I get the following when trying to load in the TIF file:
13/04/2012 00:22:59: Form1_Shown(): GetVersion=MapSuiteCore:5.5.0.91;DesktopEdition:5.5.0.91 13/04/2012 00:22:59: PopulateTab_Map(): BackgroundType=Raster 13/04/2012 00:23:00: MakeRasterMap(): Start. RasterMap=C:\Countries\71027img.tif 13/04/2012 00:23:00: MakeRasterMap(): Exception. Message=GDI+ threw a status error code. 13/04/2012 00:23:00: MakeRasterMap(): Exception. StackTrace= at ThinkGeo.MapSuite.Core.UnsafeHelper.FastLoadImageFromFile(String pathFileName) at ThinkGeo.MapSuite.Core.GdiPlusRasterSource.OpenCore() at ThinkGeo.MapSuite.Core.RasterSource.Open() at ThinkGeo.MapSuite.Core.RasterLayer.OpenCore() at ThinkGeo.MapSuite.Core.Layer.Open() at ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.DrawCore(GeoCanvas canvas) at ThinkGeo.MapSuite.DesktopEdition.Overlay.kBQ=(GeoCanvas kRQ=) at ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas canvas) at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.0xM=(IEnumerable`1 rhc=) at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.0RM=(RectangleShape rRc=) at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.HBQ=() at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.GBQ=(Int32 4Bc=) at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.Refresh() at MVMControl3.Form1.MakeRasterMap()
I tried searching these forums for “GDI+ threw a status error code” but the search functionality doesn’t like the “+” sign in the middle so even though I didn’t find any answer, there may be something hidden that I didn’t see. Any ideas what might cause this?
This exception is our custom exception, could you review whether the file “C:\Countries\71027img.tif” existing in your test machine and the application have security to read it?
If you make sure everything gose well there, I think you can did some query about GdipLoadImageFromFile function from gdiplus.dll.
Here is how we load the tiff image code for reference:
[DllImport(“gdiplus.dll”, CharSet = CharSet.Unicode)] public static extern int GdipLoadImageFromFile(string filename, out IntPtr image);
IntPtr loadingImage = IntPtr.Zero;
GdipLoadImageFromFile(pathFileName, out loadingImage)
If the result don’t equal zero, you will get the exception.
I am still working on this - I can open the file on this test machine using IrfanView but not Paint or MS Picture Viewer. So I am actually a little more confused now. Also, browsing around I can see I have about 7 gdiplus.dll files on these computers, with 3 or 4 different versions. Which instance of gdiplus.dll does ThinkGeo use?
None of the gdiplus.dll files that I can see appear to be in places where I would expect ThinkGeo to look - most of them are in application directories for other applications. I am trying to see if there is some way I can tell which version of gdiplus.dll ThinkGeo is using on each computer.
So far all indications are that it only works on Windows 7...... 5 computers tested and all Windows 7 computers work but XP and Vista both fail with the "GDI+ threw a status error code." exception.
Also I should note that I can OCCASIONALLY and not reproducibly get the exception in my development machine (Win 7 64 bit with 6GB of RAM) if I try to include about 2.2GB of raster images and physical memory usage goes up past 95%.
On the non Win 7 machines the error occurs immediately and before memory usage goes up significantly.
Are you utilizing our MergeModule when you are installing your application?
This MergeModule includes all the necessary 'system32' dlls that your client machines need to display all the Map Suite supported raster types.
Check out the following link for more information on what needs to be included when deploying your Map Suite Desktop Edition application: wiki.thinkgeo.com/wiki/Map_S...ment_Guide
I wasn’t using MergeModule…but I tried adding \Developer Reference\Merge Module\MapSuiteGeoTiffX86.msm and I still get the “GDI+ threw a status error code.” exception on the same machines… Do I need to add any more modules?
So I am clear, did you create an installer for your application using the MapSuiteGeoTiffX86.msm and then run that installer on each of your test machines?
Also are you loading your Tiff file using the Library type of ManagedLibTiff (default option) or the UnmanagedLibTiff?
The link you provided to a code sample is using the ManagedLibTiff (default), so we need to verify the LibraryType you are actually using.
As mentioned in the deployment guide (wiki.thinkgeo.com/wiki/Map_S...ment_Guide) MapSuiteGeoTiffX64.msm and MapSuiteGeoTiffX86.msm are not required if the GeoTiffRasterSource's LibraryType is ManagedLibTiff (default).