Swipe Tool


The code in this project demonstrates how to redraw a portion of the screen based on a box drawn out by the user. The redrawn portion of the screen includes all the visible layers minus one layer specified by the user. The purpose is to get a temporary view of the data without the specified layer. For instance, I may have two images loaded in my map that overlap. If I want to see an area of the map without the top image, then I can use this tool to redraw the area minus the image I specify. This gives the impression that the user is actually swiping the layer away.

How to use:
  1. Start ArcMap and add some layers to the map.
  2. Browse and select the Swipe.dll using the 'Add From File' button on the customization dialog.
  3. Activate the Swipe Toolbar.
  4. Select a layer from the combo box on the toolbar that you want to 'swipe' away.
  5. Activate the Swipe tool and rubberband a box on the screen.


Requires: Map Layers

Difficulty: Advanced

Visual Basic
File Description
frmSwipeLayers.frm Form containing the combo box for holding the available layers.
basSwipe.bas Basic module for defining global variables and routines.
ErrorHandling.bas Error Handling routines generated by the standard Add-In.
clsPopupMenu.cls Custom class for generating the context menu for the tool.
clsSwipe.cls Class containing the code for the Swipe tool.
clsSwipeSelectableLayers.cls Class containing the code for the combo box of available layers.
clsSwipeToolbar.cls Class containing the code for the Swipe toolbar.

Key CoClasses: Map, ScreenDisplay
Key Interfaces: IActiveView, IMap, IScreenDisplay
Key Members: IActiveView::Output, IMap::Layers, IScreenDisplay::DisplayTransformation, IScreenDisplay::hwnd