This document is archived and information here might be outdated.  Recommended version.


IVectorization.Vectorize Method (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (ArcScan)  

IVectorization.Vectorize Method

Find the geometries in the target raster.

[Visual Basic .NET]
Public Sub Vectorize ( _
    ByVal useSelection As Boolean, _
    ByVal extent As IEnvelope, _
    ByVal callbackGeom As INotifyGeometryFound, _
    ByVal cancel As ITrackCancel, _
    ByVal stepProgressor As IStepProgressor _
)
[C#]
public void Vectorize (
    bool useSelection,
    IEnvelope extent,
    INotifyGeometryFound callbackGeom,
    ITrackCancel cancel,
    IStepProgressor stepProgressor
);

Product Availability

Available with ArcGIS Desktop. Requires ArcScan Extension.

Remarks

This method is called by the Generate Features command and the Generate Features Inside Area tool.

 

[C#]

The following code shows an example of this method in C#.

//You can get app from ICommand :: OnCreate() hook parameter
public void Vectorize(IApplication app)
{
  if (app != null)
  {
    IVectorization vectorization=app.FindExtensionByName("ESRI ArcScan Tools") as IVectorization;
    IMxDocument mxDoc=app.Document as IMxDocument;
    INotifyGeometryFound notifyGeom=new FoundGeom();
    vectorization.Vectorize(false, mxDoc.ActiveView.Extent, notifyGeom, null, null);
  }
}

Also create a new class (FoundGeom) with the following code. This provides the callback mechanism for the returned geometry.

public class FoundGeom : INotifyGeometryFound
{
  public FoundGeom()
  { 
  }
  #region INotifyGeometryFound Members
  void INotifyGeometryFound.AddGeometry(IGeometry shape, double LineWidth)
  {
    System.Windows.Forms.MessageBox.Show("Found geometry type " + shape.GeometryType);
  }
  #endregion
}

See Also

IVectorization Interface