Beispiel #1
0
		/// <summary>Creates a converted copy of the image (wmp formatted).</summary>
		public static byte[] ConvertTo_WmpByteArray(this BitmapSource input)
		{
			var encoder = new WmpBitmapEncoder();
			//TODO include Options
			return input.ConvertTo_UsingEncoder(encoder);
		}
Beispiel #2
0
		/// <summary>Creates a converted copy of the image (tiff formatted).</summary>
		public static byte[] ConvertTo_TiffByteArray(this BitmapSource input, TiffCompressOption compressOption = TiffCompressOption.None)
		{
			var encoder = new TiffBitmapEncoder {Compression = compressOption};
			return input.ConvertTo_UsingEncoder(encoder);
		}
Beispiel #3
0
		/// <summary>Creates a converted copy of the image (png formatted).</summary>
		public static byte[] ConvertTo_PngByteArray(this BitmapSource input, PngInterlaceOption interlace = PngInterlaceOption.Default)
		{
			var encoder = new PngBitmapEncoder {Interlace = interlace, };
			return input.ConvertTo_UsingEncoder(encoder);
		}
Beispiel #4
0
		/// <summary>Creates a converted copy of the image (bmp formatted).</summary>
		public static byte[] ConvertTo_BmpByteArray(this BitmapSource input)
		{
			var encoder = new BmpBitmapEncoder();
			return input.ConvertTo_UsingEncoder(encoder);
		}
Beispiel #5
0
		/// <summary>Creates a converted copy of the image (jpg formatted).</summary>
		public static byte[] ConvertTo_JpgByteArray(this BitmapSource input, int qualityLevel = 100)
		{
			var encoder = new JpegBitmapEncoder {QualityLevel = qualityLevel};
			return input.ConvertTo_UsingEncoder(encoder);
		}