Пример #1
0
 /* ----------------------------------------------------------------- */
 ///
 /// GetImageFile
 ///
 /// <summary>
 /// Gets the File object that represents the specified image.
 /// </summary>
 ///
 /// <param name="io">I/O handler.</param>
 /// <param name="src">Path of the image file.</param>
 ///
 /// <returns>ImageFile object.</returns>
 ///
 /* ----------------------------------------------------------------- */
 public static ImageFile GetImageFile(this FileSystem.IO io, string src)
 {
     using (var ss = io.OpenRead(src))
         using (var image = Image.FromStream(ss))
         {
             return(io.GetImageFile(src, image));
         }
 }
Пример #2
0
        /* ----------------------------------------------------------------- */
        ///
        /// GetImagePage
        ///
        /// <summary>
        /// Gets a Page object from the specified values.
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        private static Page GetImagePage(this FileSystem.IO io, string src, Image image, int index, FrameDimension dim)
        {
            image.SelectActiveFrame(dim, index);

            var x = image.HorizontalResolution;
            var y = image.VerticalResolution;

            return(new Page(
                       io.GetImageFile(src, image), // File
                       index + 1,                   // Number
                       image.Size,                  // Size
                       new Angle(),                 // Rotation
                       new PointF(x, y)             // Resolution
                       ));
        }