public void ReadTooManyPixels() { try { ReadableImage image = new ReadableImage(gisImagePath); InputRaster <Erdas74Pixel8> raster = new InputRaster <Erdas74Pixel8>(image); using (raster) { Erdas74Pixel8 pixel8 = new Erdas74Pixel8(); int totPixels = raster.Dimensions.Rows * raster.Dimensions.Columns; for (int i = 0; i < totPixels; i++) { pixel8 = raster.ReadPixel(); } //one too many pixel8 = raster.ReadPixel(); } } catch (System.Exception exc) { Data.Output.WriteLine(exc.Message); throw; } }
public void ReadPixels() { ReadableImage image = new ReadableImage(gisImagePath); InputRaster <Erdas74Pixel8> raster = new InputRaster <Erdas74Pixel8>(image); Erdas74Pixel8 pixel8 = new Erdas74Pixel8(); int totPixels = raster.Dimensions.Rows * raster.Dimensions.Columns; for (int i = 0; i < totPixels; i++) { pixel8 = raster.ReadPixel(); } raster.Close(); }