public void ReadTooManyPixels() { ErdasImageFile image = null; try { image = new ErdasImageFile(inputLanImagePath, RWFlag.Read); FredLanPixel pixel = new FredLanPixel(); int pixCount = image.Dimensions.Rows * image.Dimensions.Columns; for (int i = 0; i < pixCount; i++) { image.ReadPixel(pixel); } // one too many image.ReadPixel(pixel); } catch (System.Exception exc) { Data.Output.WriteLine(exc.Message); throw; } finally { if (image != null) image.Close(); } }
public void ReadFromWritable2() { ErdasImageFile image = null; try { image = new ErdasImageFile(Data.MakeOutputPath("junk.gis"), RWFlag.Write); Erdas74Pixel8 pixel = new Erdas74Pixel8(); // read after opening for Write image.ReadPixel(pixel); } catch (System.Exception exc) { Data.Output.WriteLine(exc.Message); throw; } finally { if (image != null) image.Close(); } }
public void ReadPixels() { ErdasImageFile image = new ErdasImageFile(inputLanImagePath, RWFlag.Read); FredLanPixel pixel = new FredLanPixel(); int pixCount = image.Dimensions.Rows * image.Dimensions.Columns; for (int i = 0; i < pixCount; i++) { image.ReadPixel(pixel); } image.Close(); }