Hi, I am trying to figure out what is returned by the StrectchStats call as seen in the following help file: IRasterStretch2.StretchStats Reference It returns an IArray, but I can't figure out what to cast the elements of the array as. In other words, in the snippet of code below, what should "ISomething" be? IRasterStretch2 irs = irrgbr as IRasterStretch2; IArray ia = irs.StretchStats; ISomething value = ia.get_Element(0) as ISomething; // What should "ISomething" be?
... View more
Hi, I've been having a problem getting the pyramid layers of a raster that has been modified to rebuild. The raster has had some pixels that have been changed, but I can't get the pyramids to work. The following piece of code throws an exception along the lines of "Failed to build pyramid" when I hit the DeletePyramid command: /* Convert the ILayer to an IRasterLayer. Note that ApplicationState.CurrentExtractionRasterLayer is an ILayer in my application. */ IRasterLayer irl = ApplicationState.CurrentExtractionRasterLayer as IRasterLayer; // Rebuild the pyramid layers. IRasterPyramid3 irp3 = (irl.Raster as IRaster2).RasterDataset as IRasterPyramid3; irp3.DeletePyramid(); // Exception thrown here! If I instead call irp3.Create(); in place of DeletePyramid(), no exception is thrown, but only the bottom layer of the pyramid is correct! Any ideas on where I've gone wrong? I thought that it could be the case that Arc is somehow not allowing itself to overwrite the .ovr file it created when the layer is loaded, but I really have no idea. Thanks! -Patrick
... View more