ThinkGeo.com    |     Documentation    |     Premium Support

RasterLayer Save

Dear All,

How to save the GdiPlusRasterLayer in local disk as a different format.

Thanks
Palani

Hi Palani,

The GdiPlusRasterLayer is a render layer, which don’t contains data just contains render logic.

That means it need a data source and only support render the data source, but not support saved to disk.

Your requirement looks need some 3rd part utility to convert data format.

Regards,

Don

Dear Don,

GdiPlusRasterLayer rasterlayer = new GdiPlusRasterLayer(@path, RectangleShape);

                    if (!rasterlayer.IsOpen)
                    {
                        rasterlayer.Open();
                    }
                    GeoImage geoimage = rasterlayer.ImageSource.GetImage(rasterlayer.GetBoundingBox(), 500,700 );
                    MapEngine mapengine = new MapEngine();
                    mapengine.DrawDynamicLayers(geoimage, GeographyUnit.DecimalDegree);

                    System.Drawing.Bitmap bt = new System.Drawing.Bitmap(geoimage.GetImageStream(mapengine.Canvas));

bt.Save(@“C:/Data/MapData/ICAO_Images/ColorImages/imagename.jpeg”);

this is the way to save the images on local drive.

Thanks
Palani

Hi Palani,

Thanks for your share.

It looks we misunderstand your target, our GdiPlusRasterLayer don’t support save the data into other format, which don’t contains image.

If you only need to save image, you can also choose open cache, it will save a group of tile images.

Regards,

Don