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));
 }