how to display image in map,Vision 1.3?

Aug 14, 2012 at 12:37 AM
Edited Aug 14, 2012 at 12:40 AM

I use the following  code to display an image in map, but it's not work,please help

            IImageData data = new ImageData();
            data.Filename = Application.StartupPath + @"\dwg.tif";
            data.Open();
            IMapImageLayer layer = new MapImageLayer(data);
            data.Projection = map1.Projection;
            map1.Layers.Add(layer);
            map1.ZoomToMaxExtent();

no exception,but there is no image in map

thanks!

 

Aug 14, 2012 at 11:00 AM
Edited Aug 14, 2012 at 11:32 AM
     The following code is right, I have address this problem.
     IDataManager manager=new DataManager();
     IImageData image=manager.OpenImage(Application.StartupPath + @"\dwg.tif");
     image.Projection=map1.Projection;
     map1.Layers.Add(image);
     map1.ZoomToMaxExtent();