コード例 #1
0
        /// <summary>
        /// Makes a snapshot of the map and saves it in the image folder with the name of the example
        /// </summary>
        private void btnSnapshot_Click(object sender, EventArgs e)
        {
            TreeNode node = this.treeView1.SelectedNode;

            if (node != null && node.Tag != null)
            {
                Example ex = node.Tag as Example;
                if (ex != null)
                {
                    MapWinGIS.Image img = (MapWinGIS.Image) this.axMap1.SnapShot(this.axMap1.Extents);
                    if (img != null)
                    {
                        string filename = Path.GetDirectoryName(Application.ExecutablePath) +
                                          @"..\..\..\..\Resources\images\" + ex.function + ".png";
                        img.Save(filename, false, MapWinGIS.ImageType.USE_FILE_EXTENSION, null);
                    }
                }
            }
        }
コード例 #2
0
 public bool Save(string filename, bool writeWorldFile = false,
                  ImageFormat fileType = ImageFormat.UseFileExtension)
 {
     return(_image.Save(filename, writeWorldFile, (ImageType)fileType));
 }