How to draw a point on the screen

This article shows how to draw a point on the screen. In this example, the point will not persist on the screen but will be removed after the next screen refresh.

Drawing a point on the screen

The following code draws a point on the screen in the ActiveView where the mouse is clicked. The x,y coordinates come from a mousedown click event when the user interacts with the application.
static void drawPoint(IActiveView activeView, int x, int y)throws Exception{
    IScreenDisplay screenDisplay = activeView.getScreenDisplay();

    // Constant.
    screenDisplay.startDrawing(screenDisplay.getHDC(), (short)
    ISimpleMarkerSymbol simpleMarkerSymbol = new SimpleMarkerSymbol();

    ISymbol symbol = (ISymbol)simpleMarkerSymbol;
    IDisplayTransformation displayTransformation =

    // X and y are in device coordinates.
    IPoint point = displayTransformation.toMapPoint(x, y);


See Also:

How to draw a polyline on the screen
How to draw a polygon on the screen
How to draw a rectangle on the screen

Development licensingDeployment licensing
ArcGIS for Desktop BasicArcGIS for Desktop Basic
ArcGIS for Desktop StandardArcGIS for Desktop Standard
ArcGIS for Desktop AdvancedArcGIS for Desktop Advanced
Engine Developer KitEngine