ArcObjects Library Reference  (Carto)    

IMap.ClipBorder Property

An optional border drawn around ClipGeometry.

[Visual Basic 6.0]
Property ClipBorder As IBorder
[Visual Basic .NET]
Public Property ClipBorder As IBorder
[C#]
public IBorder ClipBorder {get; set;}
[Java]
public  getClipBorder (
    IBorder Border
)
[Java]
public void setClipBorder(
    IBorder Border
)
throws
    IOException,
    AutomationException
[C++]
HRESULT get_ClipBorder(
  IBorder** Border
);
[C++]
HRESULT put_ClipBorder(
  IBorder* Border

);

[C++]

Parameters

Border [out, retval]

  Border is a parameter of type IBorder

Border [in]

  Border is a parameter of type IBorder

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

If a ClipGeometry has been set, you have the option of drawing a border around the clipped map.  Use the ClipBorder propety to specify the type of border drawn.

Use the ClipGeometry property to shape the area the Map is drawn in.  For example, if you had a map of the United States that contained many layers, you could set the Map's ClipGeometry equal to the geometry of a particular state thereby telling the map to only draw the map data falling within the particular state's area.

By default there is no clip geometry or clip border.

[Visual Basic 6.0]

The following VBA scripts demonstrates this.  To use this script create and select a polygon graphic on the map, I created a graphic that looks like a star.  Next, run the script and delete or move the graphic.  The graphic cookie-cuts the map so that only the area of the map that was beneath the graphic is drawn.

Sub ClipMapWithGraphic()
    Dim pMxDocument As IMxDocument
    Dim pMap As IMap
    Dim pViewManager As IViewManager
    Dim pEnumElement As IEnumElement
    Dim pElement As IElement
    Dim pActiveView As IActiveView
    Dim pBorder As IBorder
   
    Set pMxDocument = Application.Document
    Set pMap = pMxDocument.FocusMap
   
    Set pViewManager = pMap 'QI
    Set pEnumElement = pViewManager.ElementSelection
    pEnumElement.Reset
    Set pElement = pEnumElement.Next
    If pElement Is Nothing Then
        MsgBox "No element selected"
        Exit Sub
    End If
    If pElement.Geometry.GeometryType = esriGeometryPolygon Then
        Set pBorder = New SymbolBorder 'Use default line symbol
        pMap.ClipGeometry = pElement.Geometry
        pMap.ClipBorder = pBorder
        Set pActiveView = pMap
        pActiveView.Refresh
    End If
End Sub

See Also

IMap Interface | IMap.ClipGeometry Property

 


Feedback Send feedback on this page