Пример #1
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();
                }
            }
        }
Пример #2
0
        public void WritePixels()
        {
            Erdas74Pixel8 pixel = new Erdas74Pixel8();

            ErdasImageFile
                image = new ErdasImageFile(outputGisImagePath,
                                           new Dimensions(10, 10),
                                           1,
                                           System.TypeCode.Byte,
                                           null);

            byte[] bytes = new byte[1];
            bytes[0] = 1;

            pixel[0].SetBytes(bytes, 0);

            int pixCount = image.Dimensions.Rows * image.Dimensions.Columns;

            for (int i = 0; i < pixCount; i++)
            {
                image.WritePixel(pixel);
            }

            image.Close();
        }
        public void WritePixels()
        {
            Erdas74Pixel8 pixel = new Erdas74Pixel8();
            
            WritableImage image = new WritableImage(outputGisImagePath,
                                       new Dimensions(10,10),
                                       1,
                                       System.TypeCode.Byte,
                                       null);

            byte[] bytes = new byte[1];
            bytes[0] = 1;
            
            pixel[0].SetBytes(bytes,0);
            
            int pixCount = image.Dimensions.Rows * image.Dimensions.Columns;
            
            for (int i = 0; i < pixCount; i++)
            {
                image.WritePixel(pixel);
            }
            
            image.Close();
            
        }
        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();
        }
        public void WritePixels()
        {
            WritableImage image = new WritableImage(gisImagePath);
            OutputRaster <Erdas74Pixel8> raster = new OutputRaster <Erdas74Pixel8>(image);
            Erdas74Pixel8 pixel8    = new Erdas74Pixel8();
            int           totPixels = raster.Dimensions.Rows * raster.Dimensions.Columns;

            for (int i = 0; i < totPixels; i++)
            {
                raster.WritePixel(pixel8);
            }
            raster.Close();
        }
 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 WriteTooManyPixels()
 {
     try {
         WritableImage image = new WritableImage(gisImagePath);
         OutputRaster <Erdas74Pixel8> raster = new OutputRaster <Erdas74Pixel8>(image);
         using (raster) {
             Erdas74Pixel8 pixel8    = new Erdas74Pixel8();
             int           totPixels = raster.Dimensions.Rows * raster.Dimensions.Columns;
             for (int i = 0; i < totPixels; i++)
             {
                 raster.WritePixel(pixel8);
             }
             // write one too many
             raster.WritePixel(pixel8);
         }
     }
     catch (System.Exception exc) {
         Data.Output.WriteLine(exc.Message);
         throw;
     }
 }
Пример #8
0
        public void WriteTooManyPixels()
        {
            ErdasImageFile image = null;

            try {
                Erdas74Pixel8 pixel = new Erdas74Pixel8();

                image = new ErdasImageFile(outputGisImagePath,
                                           new Dimensions(10, 10),
                                           1,
                                           System.TypeCode.Byte,
                                           null);

                byte[] bytes = new byte[1];
                bytes[0] = 1;

                pixel[0].SetBytes(bytes, 0);

                int pixCount = image.Dimensions.Rows * image.Dimensions.Columns;

                for (int i = 0; i < pixCount; i++)
                {
                    image.WritePixel(pixel);
                }

                // one too many
                image.WritePixel(pixel);
            }
            catch (System.Exception exc) {
                Data.Output.WriteLine(exc.Message);
                throw;
            }
            finally {
                if (image != null)
                {
                    image.Close();
                }
            }
        }
     public void WriteTooManyPixels()
     {
         WritableImage image = null;
         try {
             Erdas74Pixel8 pixel = new Erdas74Pixel8();
             
             image = new WritableImage(outputGisImagePath,
                                 new Dimensions(10,10),
                                 1,
                                 System.TypeCode.Byte,
                                 null);
 
             byte[] bytes = new byte[1];
             bytes[0] = 1;
             
             pixel[0].SetBytes(bytes,0);
             
             int pixCount = image.Dimensions.Rows * image.Dimensions.Columns;
 
             for (int i = 0; i < pixCount; i++)
             {
                 image.WritePixel(pixel);
             }
             
             // one too many
             image.WritePixel(pixel);
         }
         catch (System.Exception exc) {
             Data.Output.WriteLine(exc.Message);
             throw;
         }
         finally {
             if (image != null)
                 image.Close();
         }
         
     }
Пример #10
0
        public void WriteToReadable()
        {
            ErdasImageFile image = null;

            try {
                image = new ErdasImageFile(Data.MakeOutputPath("junk.gis"),
                                           RWFlag.Read);

                Erdas74Pixel8 pixel = new Erdas74Pixel8();

                // write after opening for Read
                image.WritePixel(pixel);
            }
            catch (System.Exception exc) {
                Data.Output.WriteLine(exc.Message);
                throw;
            }
            finally {
                if (image != null)
                {
                    image.Close();
                }
            }
        }
Пример #11
0
 public void NewPix8()
 {
     Erdas74Pixel8 pix8 = new Erdas74Pixel8();
 }
 public void NewPix8()
 {
     Erdas74Pixel8 pix8 = new Erdas74Pixel8();
 }
 public void WriteToReadable()
 {
     ErdasImageFile image = null;
     try {
         image = new ErdasImageFile(Data.MakeOutputPath("junk.gis"),
                                    RWFlag.Read);
         
         Erdas74Pixel8 pixel = new Erdas74Pixel8();
         
         // write after opening for Read
         image.WritePixel(pixel);
     }
     catch (System.Exception exc) {
         Data.Output.WriteLine(exc.Message);
         throw;
     }
     finally {
         if (image != null)
             image.Close();
     }
 }
     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();
         }
     }