Exemple #1
0
        internal PlainImage ReadPlainImage()
        {
            awt.Image img = ReadImage(_currentFrame);
            if (img == null)
            {
                return(null);
            }

            // its possible to fail to load thumbnails and metadata, but image is ok.
            awt.Image [] th = null;
#if THUMBNAIL_SUPPORTED
            try {
                th = ReadThumbnails(_currentFrame);
            }
            catch (Exception) {}
#endif

            XmlDocument md = null;
            imageio.metadata.IIOMetadata nativeMd = null;
            try {
                nativeMd = ReadImageMetadata(_currentFrame);
                md       = ConvertImageMetadata(nativeMd);
            }
            catch (Exception) {}

            float [] resolution = GetResolution(md);

            PlainImage pi = new PlainImage(img, th, ImageFormat, resolution[0], resolution[1], FormatFrameDimesion);
            pi.NativeMetadata = nativeMd;
            return(pi);
        }
Exemple #2
0
        private imageio.IIOImage GetIIOImageContainer(PlainImage pi)
        {
            java.util.ArrayList al = null;

            // prepare thumbnails list
            if (pi.Thumbnails != null)
            {
                al = new java.util.ArrayList(pi.Thumbnails.Length);
                for (int i = 0; i < pi.Thumbnails.Length; i++)
                {
                    al.add(pi.Thumbnails[i]);
                }
            }

            // prepare IIOImage container
            if (pi.NativeImage is image.BufferedImage)
            {
                imageio.IIOImage iio = new javax.imageio.IIOImage(
                    (image.BufferedImage)pi.NativeImage, al, null /*pi.NativeMetadata*/);
                return(iio);
            }
            else
            {
                // TBD: This codec is for raster formats only
                throw new NotSupportedException("Only raster formats are supported");
            }
        }
Exemple #3
0
		internal void WritePlainImage(PlainImage pi) {
			try {
				imageio.IIOImage iio = GetIIOImageContainer( pi );
				WriteImage( iio );
			}
			catch (java.io.IOException ex) {
				throw new System.IO.IOException(ex.Message, ex);
			}
		}
 public int IndexOf(PlainImage plainImage)
 {
     return(collection.IndexOf(plainImage));
 }
 public bool Contains(PlainImage plainImage)
 {
     return(collection.Contains(plainImage));
 }
 public int Add(PlainImage plainImage)
 {
     return(collection.Add(plainImage));
 }
		public void Remove(PlainImage value) {
			collection.Remove( value );
		}
		public void Insert(int index, PlainImage value) {
			collection.Insert( index, value );
		}
		public int IndexOf(PlainImage plainImage) {
			return collection.IndexOf( plainImage );
		}
		protected void Initialize (PlainImage pi, bool addToCollection) {
			if (!addToCollection)
				NativeObject.Clear();
				
			NativeObject.Add( pi );
		}
		public int Add(PlainImage plainImage) {
			return collection.Add( plainImage );
		}
		private imageio.IIOImage GetIIOImageContainer(PlainImage pi) {
			java.util.ArrayList al = null;
			
			// prepare thumbnails list
			if (pi.Thumbnails != null) {
				al = new java.util.ArrayList( pi.Thumbnails.Length );
				for (int i=0; i < pi.Thumbnails.Length; i++)
					al.add(pi.Thumbnails[i]);
			}

			// prepare IIOImage container
			if (pi.NativeImage is image.BufferedImage) {
				imageio.IIOImage iio = new javax.imageio.IIOImage(
					(image.BufferedImage)pi.NativeImage, al, null /*pi.NativeMetadata*/);
				return iio;
			}
			else
				// TBD: This codec is for raster formats only
				throw new NotSupportedException("Only raster formats are supported");
		}
		internal PlainImage ReadPlainImage() {
			awt.Image img = ReadImage( _currentFrame );
			if (img == null)
				return null;

			// its possible to fail to load thumbnails and metadata, but image is ok.
			awt.Image [] th = null;
#if THUMBNAIL_SUPPORTED
			try {
				th = ReadThumbnails( _currentFrame );
			}
			catch (Exception) {}
#endif
			
			XmlDocument md = null;
			imageio.metadata.IIOMetadata nativeMd = null;
			try {
				nativeMd = ReadImageMetadata( _currentFrame );
				md = ConvertImageMetadata( nativeMd );
			}
			catch (Exception) {}

			float [] resolution = GetResolution( md );

			PlainImage pi = new PlainImage( img, th, ImageFormat, resolution[0], resolution[1], FormatFrameDimesion );
			pi.NativeMetadata = nativeMd;
			return pi;
		}
 public void Insert(int index, PlainImage value)
 {
     collection.Insert(index, value);
 }
		public bool Contains(PlainImage plainImage) {
			return collection.Contains(plainImage);
		}
 public void Remove(PlainImage value)
 {
     collection.Remove(value);
 }
		protected Image (java.awt.Image nativeObject, ImageFormat format) {
			PlainImage pi = new PlainImage( nativeObject, null, format, 0, 0, FrameDimension.Page );
			Initialize( pi, false );
		}