MapWinGIS:AxMap SnapShot

This is a back-up of the WIKI.
Not all links might work
We're working on a new wiki.

Main Page | Recent changes | View source | Page history | Log in / create account |

Printable version | Disclaimers | Privacy policy

SnapShot

Takes snap shot of the contents of the map within the bounds of the specified rectangle, returning an image of the results.


VB.NET Usage

Function SnapShot(BoundBox As Object) As Object

            Parameters

BoundBox

The bounds (rectangle) to get the snapshot from.
ReturnValue An image of the contents of the map displayed inside the bounds of the specified rectangle.

Sample Code

    Private Sub SnapShot()
        Dim image As New MapWinGIS.Image()
        Dim extents As MapWinGIS.Extents
        'Set extents to be the extents of the map
        extents = CType(Map1.Extents, MapWinGIS.Extents)
        'Take a picture of what is being displayed in map1 and store it in image
        image = Map1.SnapShot(extents)
    End Sub
  

VB 6 Usage
Function SnapShot(BoundBox As Object) As Object
            Parameters

BoundBox

The bounds (rectangle) to get the snapshot from.
ReturnValue An image of the contents of the map displayed inside the bounds of the specified rectangle.

Sample Code

    Private Sub take_SnapShot()
        Dim myImage As New MapWinGIS.image
        Dim myExtents As MapWinGIS.extents
        'Set extents to be the extents of the map
        Set myExtents = Map1.extents
        'Take a picture of what is being displayed in map1 and store it in image
        Set myImage = Map1.SnapShot(myExtents)
    End Sub


C# usage
Example of getting and saving map as displayed
            Parameters

none

ReturnValue true or false as received from actual image file save method

Sample Code

   /// <summary>
   /// method to get and save current image on screen
   /// </summary> 
   private bool bGetMapImage()
   {
     bool success = false;
     MapWinGIS.Image SSimage = new MapWinGIS.Image();
     // an interface (or virtual function) class must be declared and set up for call to Save() method
     MapWinGIS.ICallback cBack = new cCallBackForImageSave();
     // file name to save (will be overwritten)
     string sSSFname = "c:\\tmp\\test.bmp";
     SSimage = (MapWinGIS.Image)m_map.View.Snapshot(m_map.View.Extents);
     success = SSimage.Save(sSSFname, false, MapWinGIS.ImageType.USE_FILE_EXTENSION, cBack);
     // return value of Save() method
     return (success);
   }

Retrieved from "http://mapwindow.org/wiki/index.php/MapWinGIS:AxMap_SnapShot"

This page has been accessed 4,023 times. This page was last modified on 15 November 2006, at 23:51.