How to delete a raster colormap


This sample shows how to delete a raster colormap of a given raster dataset. The raster dataset can be file-based raster dataset or geodatabase raster dataset.

How to use

  1. Call this procedure from VBA.
[VBA]
Sub delete_colormap(pRasterDs As IRasterDataset)
    
    ' Delete raster colormap for the input raster dataset
    
    Dim pRasterDatasetEdit As IRasterDatasetEdit2
    ' QI for IRasterRasterDatasetEdit2
    Set pRasterDatasetEdit = pRasterDs
    ' Delete colormap
    pRasterDatasetEdit.DeleteColormap
    ' Cleanup
    Set pRasterDatasetEdit = Nothing
    
End Sub