C# Class Cimbalino.Phone.Toolkit.Extensions.WriteableBitmapExtensions

Provides a set of static (Shared in Visual Basic) methods for WriteableBitmap instances.
Show file Open project: Cimbalino/Cimbalino-Phone-Toolkit

Public Methods

Method Description
SaveJpeg ( this writeableBitmap, Stream outputStream, int quality ) : void

Encodes a WriteableBitmap object into a JPEG stream, with parameters for setting the target quality of the JPEG file.

SaveJpeg ( this writeableBitmap, Stream outputStream, int targetWidth, int targetHeight, int quality ) : void

Encodes a WriteableBitmap object into a JPEG stream, with parameters for setting the target width, height, and quality of the JPEG file.

SaveJpegAsync ( this writeableBitmap, Stream outputStream, int quality ) : System.Threading.Tasks.Task

Encodes a WriteableBitmap object into a JPEG stream, with parameters for setting the target quality of the JPEG file.

SaveJpegAsync ( this writeableBitmap, Stream outputStream, int targetWidth, int targetHeight, int quality ) : System.Threading.Tasks.Task

Encodes a WriteableBitmap object into a JPEG stream, with parameters for setting the target width, height, and quality of the JPEG file.

SaveJpegAsync ( this writeableBitmap, Stream outputStream, int targetWidth, int targetHeight, int orientation, int quality ) : System.Threading.Tasks.Task

Encodes a WriteableBitmap object into a JPEG stream, with parameters for setting the target width, height, orientation, and quality of the JPEG file.

SavePng ( this writeableBitmap, Stream outputStream ) : void

Encodes a WriteableBitmap object into a PNG stream.

SavePng ( this writeableBitmap, Stream outputStream, CompressionLevel compressionLevel ) : void

Encodes a WriteableBitmap object into a PNG stream, using the specified output compression.

SavePng ( this writeableBitmap, Stream outputStream, WriteableBitmapSavePngParameters parameters ) : void

Encodes a WriteableBitmap object into a PNG stream, using the specified output WriteableBitmapSavePngParameters.

SavePngAsync ( this writeableBitmap, Stream outputStream ) : System.Threading.Tasks.Task

Encodes a WriteableBitmap object into a PNG stream.

SavePngAsync ( this writeableBitmap, Stream outputStream, CompressionLevel compressionLevel ) : System.Threading.Tasks.Task

Encodes a WriteableBitmap object into a PNG stream, using the specified output compression.

SavePngAsync ( this writeableBitmap, Stream outputStream, WriteableBitmapSavePngParameters parameters ) : System.Threading.Tasks.Task

Encodes a WriteableBitmap object into a PNG stream, using the specified output WriteableBitmapSavePngParameters.

Private Methods

Method Description
CreateChunk ( ) : byte[]
CreateChunkFromInt ( int value ) : byte[]
CreateChunkFromString ( string value ) : byte[]
CreateChunkFromUint ( uint value ) : byte[]
WriteChunk ( Stream outputStream, string type, byte data ) : void
WriteDataChunks ( Stream outputStream, System.Windows.Media.Imaging.WriteableBitmap writeableBitmap, WriteableBitmapSavePngParameters parameters ) : void
WriteFooter ( Stream outputStream ) : void
WriteGamma ( Stream outputStream, WriteableBitmapSavePngParameters parameters ) : void
WriteHeader ( Stream outputStream, System.Windows.Media.Imaging.WriteableBitmap writeableBitmap ) : void
WritePhysics ( Stream outputStream, WriteableBitmapSavePngParameters parameters ) : void

Method Details

SaveJpeg() public static method

Encodes a WriteableBitmap object into a JPEG stream, with parameters for setting the target quality of the JPEG file.
public static SaveJpeg ( this writeableBitmap, Stream outputStream, int quality ) : void
writeableBitmap this The WriteableBitmap object.
outputStream Stream The image data stream.
quality int This parameter represents the quality of the JPEG photo with a range between 0 and 100, with 100 being the best photo quality. We recommend that you do not fall lower than a value of 70. because JPEG picture quality diminishes significantly below that level.
return void

SaveJpeg() public static method

Encodes a WriteableBitmap object into a JPEG stream, with parameters for setting the target width, height, and quality of the JPEG file.
public static SaveJpeg ( this writeableBitmap, Stream outputStream, int targetWidth, int targetHeight, int quality ) : void
writeableBitmap this The WriteableBitmap object.
outputStream Stream The image data stream.
targetWidth int The target width of the file.
targetHeight int The target height of the file.
quality int This parameter represents the quality of the JPEG photo with a range between 0 and 100, with 100 being the best photo quality. We recommend that you do not fall lower than a value of 70. because JPEG picture quality diminishes significantly below that level.
return void

SaveJpegAsync() public static method

Encodes a WriteableBitmap object into a JPEG stream, with parameters for setting the target quality of the JPEG file.
public static SaveJpegAsync ( this writeableBitmap, Stream outputStream, int quality ) : System.Threading.Tasks.Task
writeableBitmap this The WriteableBitmap object.
outputStream Stream The image data stream.
quality int This parameter represents the quality of the JPEG photo with a range between 0 and 100, with 100 being the best photo quality. We recommend that you do not fall lower than a value of 70. because JPEG picture quality diminishes significantly below that level.
return System.Threading.Tasks.Task

SaveJpegAsync() public static method

Encodes a WriteableBitmap object into a JPEG stream, with parameters for setting the target width, height, and quality of the JPEG file.
public static SaveJpegAsync ( this writeableBitmap, Stream outputStream, int targetWidth, int targetHeight, int quality ) : System.Threading.Tasks.Task
writeableBitmap this The WriteableBitmap object.
outputStream Stream The image data stream.
targetWidth int The target width of the file.
targetHeight int The target height of the file.
quality int This parameter represents the quality of the JPEG photo with a range between 0 and 100, with 100 being the best photo quality. We recommend that you do not fall lower than a value of 70. because JPEG picture quality diminishes significantly below that level.
return System.Threading.Tasks.Task

SaveJpegAsync() public static method

Encodes a WriteableBitmap object into a JPEG stream, with parameters for setting the target width, height, orientation, and quality of the JPEG file.
public static SaveJpegAsync ( this writeableBitmap, Stream outputStream, int targetWidth, int targetHeight, int orientation, int quality ) : System.Threading.Tasks.Task
writeableBitmap this The WriteableBitmap object.
outputStream Stream The image data stream.
targetWidth int The target width of the file.
targetHeight int The target height of the file.
orientation int This parameter is not currently used by this method. Use a value of 0 as a placeholder.
quality int This parameter represents the quality of the JPEG photo with a range between 0 and 100, with 100 being the best photo quality. We recommend that you do not fall lower than a value of 70. because JPEG picture quality diminishes significantly below that level.
return System.Threading.Tasks.Task

SavePng() public static method

Encodes a WriteableBitmap object into a PNG stream.
public static SavePng ( this writeableBitmap, Stream outputStream ) : void
writeableBitmap this The writeable bitmap.
outputStream Stream The image data stream.
return void

SavePng() public static method

Encodes a WriteableBitmap object into a PNG stream, using the specified output compression.
public static SavePng ( this writeableBitmap, Stream outputStream, CompressionLevel compressionLevel ) : void
writeableBitmap this The writeable bitmap.
outputStream Stream The image data stream.
compressionLevel CompressionLevel The image compression level.
return void

SavePng() public static method

Encodes a WriteableBitmap object into a PNG stream, using the specified output WriteableBitmapSavePngParameters.
public static SavePng ( this writeableBitmap, Stream outputStream, WriteableBitmapSavePngParameters parameters ) : void
writeableBitmap this The writeable bitmap.
outputStream Stream The image data stream.
parameters WriteableBitmapSavePngParameters The image save parameters.
return void

SavePngAsync() public static method

Encodes a WriteableBitmap object into a PNG stream.
public static SavePngAsync ( this writeableBitmap, Stream outputStream ) : System.Threading.Tasks.Task
writeableBitmap this The writeable bitmap.
outputStream Stream The image data stream.
return System.Threading.Tasks.Task

SavePngAsync() public static method

Encodes a WriteableBitmap object into a PNG stream, using the specified output compression.
public static SavePngAsync ( this writeableBitmap, Stream outputStream, CompressionLevel compressionLevel ) : System.Threading.Tasks.Task
writeableBitmap this The writeable bitmap.
outputStream Stream The image data stream.
compressionLevel CompressionLevel The image compression level.
return System.Threading.Tasks.Task

SavePngAsync() public static method

Encodes a WriteableBitmap object into a PNG stream, using the specified output WriteableBitmapSavePngParameters.
public static SavePngAsync ( this writeableBitmap, Stream outputStream, WriteableBitmapSavePngParameters parameters ) : System.Threading.Tasks.Task
writeableBitmap this The writeable bitmap.
outputStream Stream The image data stream.
parameters WriteableBitmapSavePngParameters The image save parameters.
return System.Threading.Tasks.Task