Share via


GetPictureFromObject method

Returns a picture (Visual Basic Picture object) of the current map view.

Applies to

Objects:  MapPointUtilities

Syntax

object.GetPictureFromObject(Source, [Width], [Height])

Parameters

Part Description
object Required. An expression that returns a MapPointUtilities object.
Source Required Object. The Map object from which to get the picture.
Width Optional Long. Width of the picture, in HIMETRIC. Minimum value is 1,100.
Height Optional Long. Height of the picture, in HIMETRIC. Minimum value is 1,100.

Remarks

For the MapPoint Control, the GetPictureFromObject method returns a picture of the map as it was last saved.

Example

  
      'Need a Visual Basic form with a Picture object on it
  ' and MapPoint must be running

  Dim WithEvents oMap As MapPoint.Map

  Private Sub Form_Load()     Set oMap = GetObject(, "MapPoint.Application").ActiveMap     DrawMap   End Sub
  Private Sub oMap_AfterViewChange()     DrawMap   End Sub
  Private Sub DrawMap()     Dim oUtil As New MapPoint.MapPointUtilities
    Dim iWidth As Integer, iHeight As Integer, iOrigScale As Integer     iWidth = Picture1.Width     iHeight = Picture1.Height     iOrigScale = Picture1.ScaleMode
    iWidth = ScaleX(iWidth, iOrigScale, vbHimetric)     iHeight = ScaleY(iHeight, iOrigScale, vbHimetric)
    Me.Picture1.Picture = oUtil.GetPictureFromObject(oMap, iWidth, iHeight)   End Sub