GetFormat() статический приватный Метод

static private GetFormat ( ImageFormat format ) : MagickFormat
format System.Drawing.Imaging.ImageFormat
Результат MagickFormat
Пример #1
0
        /// <summary>
        /// Converts this instance to a <see cref="Bitmap"/> using the specified <see cref="ImageFormat"/>.
        /// Supported formats are: Bmp, Gif, Icon, Jpeg, Png, Tiff.
        /// </summary>
        /// <param name="imageFormat">The image format.</param>
        /// <returns>A <see cref="Bitmap"/> that has the specified <see cref="ImageFormat"/></returns>
        public Bitmap ToBitmap(ImageFormat imageFormat)
        {
            Format = MagickFormatInfo.GetFormat(imageFormat);

            MemoryStream memStream = new MemoryStream();

            Write(memStream);
            memStream.Position = 0;
            /* Do not dispose the memStream, the bitmap owns it. */
            return(new Bitmap(memStream));
        }
Пример #2
0
        /// <summary>
        /// Converts this instance to a <see cref="Bitmap"/> using the specified <see cref="ImageFormat"/>.
        /// Supported formats are: Bmp, Gif, Icon, Jpeg, Png, Tiff.
        /// </summary>
        /// <param name="imageFormat">The image format.</param>
        /// <param name="bitmapDensity">The bitmap density.</param>
        /// <returns>A <see cref="Bitmap"/> that has the specified <see cref="ImageFormat"/>.</returns>
        public Bitmap ToBitmap(ImageFormat imageFormat, BitmapDensity bitmapDensity)
        {
            Format = MagickFormatInfo.GetFormat(imageFormat);

            MemoryStream memStream = new MemoryStream();

            Write(memStream);
            memStream.Position = 0;

            /* Do not dispose the memStream, the bitmap owns it. */
            var bitmap = new Bitmap(memStream);

            SetBitmapDensity(bitmap, bitmapDensity);

            return(bitmap);
        }
Пример #3
0
 private void SetFormat(ImageFormat format)
 {
     SetFormat(MagickFormatInfo.GetFormat(format));
 }