public static SaveMapImage GetInstance(AxMap mapControl)
 {
     if (_instance == null)
     {
         _instance = new SaveMapImage(mapControl);
     }
     return(_instance);
 }
 public static SaveMapImage GetInstance(string filename, double dpi, AxMap mapControl)
 {
     if (_instance == null)
     {
         _instance = new SaveMapImage(filename, dpi, mapControl);
     }
     return(_instance);
 }
 public static SaveMapImage GetInstance()
 {
     if (_instance == null)
     {
         _instance = new SaveMapImage();
     }
     return(_instance);
 }
        public string SaveTempMapToImage(double dpi = 96)
        {
            string fileName = string.Empty;

            _saveMapImage = new SaveMapImage(axMap);
            _saveMapImage.MapLayersHandler = _mapLayersHandler;
            if (_saveMapImage.SaveToTempFile(dpi))
            {
                fileName = _saveMapImage.TempMapFileName;
                _saveMapImage.Dispose();
                _saveMapImage = null;
            }
            return(fileName);
        }
        public bool SaveMapToImage(double dpi, string fileName, bool Preview = true, bool maintainOnePointLineWidth = false)
        {
            var success = false;

            _saveMapImage = new SaveMapImage(fileName, dpi, axMap);
            //_saveMapImage = SaveMapImage.GetInstance(axMap, dpi);
            //_saveMapImage = SaveMapImage.GetInstance();
            //_saveMapImage.MapControl = axMap;
            //_saveMapImage.FileName = fileName;
            _saveMapImage.PreviewImage              = Preview;
            _saveMapImage.MapLayersHandler          = _mapLayersHandler;
            _saveMapImage.MaintainOnePointLineWidth = maintainOnePointLineWidth;
            _saveMapImage.PointSizeExceed100Error  += OnPointSizeRenderError;
            success = _saveMapImage.Save(_grid25MajorGrid != null);
            try
            {
                _saveMapImage.Dispose();
            }
            catch
            {
                //ignore
            }
            return(success);
        }