I tried to load file by using map suite engine 2.0 and it worked .But when i use Map Suite Edition 3.0 it didn't work and give me this error
"Out of memory." at mapEngine.OpenAllLayers(); line ,and those are the codes:
Working code using Map Suite Engine 2.0:
//*****************************************************
private void Form1_Load(object sender, EventArgs e)
...
...
ImageLayer imageLayer = new ImageLayer(@"C:\1\san_81.jpg");
mMapEngine.ImageLayers.Add(imageLayer);
DrawMap();
private void DrawMap()
{
Bitmap bitMap = new Bitmap(pictureBox1.Width, pictureBox1.Height);
Graphics g = Graphics.FromImage(bitMap);
mMapEngine.GetMap(g, mCurrentExtent, bitMap.Width, bitMap.Height, MapLengthUnits.DecimalDegrees, 0);
pictureBox1.Image = bitMap;
g.Dispose();
}
//*****************************************************
not working code using Map Suite Desktop 3.0
//-------------------------------------------------------------------------------
private void Form1_Load(object sender, EventArgs e)
{
...
...
GdiPlusRasterLayer worldImageLayer = new GdiPlusRasterLayer(@"C:\1\san_81.jpg");
worldImageLayer.UpperThreshold = double.MaxValue;
worldImageLayer.LowerThreshold = 0;
mapEngine.StaticLayers.Add("WorldImageLayer", worldImageLayer);
DrawImage();
}
private void DrawImage()
{
mapEngine.OpenAllLayers();
mapEngine.DrawStaticLayers(bitmap, GeographyUnit.DecimalDegree);
mapEngine.CloseAllLayers();
map.Image = bitmap;
}
//----------------------------------------------------------------------------------
I want to know why it works by using 2.0 and how to make it to work by using 3.0 because i want to be map suite 3.0 expert and buy it.
Also when i worked with 3.0 all information and codes work as i wanted except load image air(jpg).