I have been looking at moving our app from using the MapWinGIS OCX over to using DotSpatial. I am using a very large TIFF file for my base map layer and although it works fine in the OCX, it seems to choke DotSpatial.
I pulled down the DotSpatial source and the problem seems to be that in DotSpatial.Data, InRamImageData.cs, a Bitmap is used to store the image for the layer. In my case, the size of the image is 28203 x 45794 and something that size can't be stored in a Bitmap.
In the Open() method, I modified the line:
using (Image temp = Image.FromStream(stream)
using (Image temp = Image.FromStream(stream, true, false))
to avoid an Overflow exception from the validation of the Image.FromStream, but then it simply dies with a "Parameter is not valid" exception when it reaches:
_myImage = new Bitmap(temp.Width, temp.Height, PixelFormat.Format32bppArgb);
So I am left with the thought that perhaps the inability to create the _myImage bitmap means that perhaps the whole approach is not going to work for a file of this size.
Anyway, for now I am going to have to drop back to using the MapWinGIS OCX but I do hope that perhaps this can be corrected in the future... especially if this is going to be considered as a replacement for the OCX. If y'all would like to test attempts to get around this I would be happy to test it for you. I'd also be interested in hearing from y'all if you have any ideas about work arounds I can try. Thanks!