Select to view content in your preferred language

mosaic dataset add colormap

1217
0
07-25-2011 09:43 AM
gisscconsulting
Emerging Contributor
This function add colormap to rasterdataset. Does mosaic dataset support similar methods in ArcObjects API? There is an insert colormap function in mosaic function in arccatalog. 

// Load a color map from a .clr file to a raster dataset.
        // .clr string example: "C:\colormap\MyColormap.clr"
        public static void LoadColormap(IRasterDataset rasDs, string clrPathAndName)
        {
            // Use the IRasterDatasetEdit interface to change the dataset color map.
            IRasterDatasetEdit rasEdit = (IRasterDatasetEdit)rasDs;
            // Create a color map.
            IRasterColormap3 rasColor3 = new RasterColormapClass();
            // Load the color map from the .clr file.
            rasColor3.LoadFrom(clrPathAndName);
            // Change the color map of the dataset.
            rasEdit.AlterColormap((IRasterColormap)rasColor3);
        }
0 Kudos
0 Replies