Esempio n. 1
0
        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();
                }
            }
        }
Esempio n. 2
0
        public void ReadFromWritable1()
        {
            ErdasImageFile image = null;

            try {
                image = new ErdasImageFile(Data.MakeOutputPath("junk.gis"),
                                           new Dimensions(10, 10),
                                           1,
                                           System.TypeCode.Byte,
                                           null);

                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();
                }
            }
        }
Esempio n. 3
0
        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();
        }