Extensions.SaveJpeg Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Encodes a WriteableBitmap object into a JPEG stream, with parameters for setting the target width and height of the JPEG file.
Assembly: Microsoft.Phone (in Microsoft.Phone.dll)
'Declaration <ExtensionAttribute> _ Public Shared Sub SaveJpeg ( _ bitmap As WriteableBitmap, _ targetStream As Stream, _ targetWidth As Integer, _ targetHeight As Integer, _ orientation As Integer, _ quality As Integer _ )
Parameters
- bitmap
- Type: System.Windows.Media.Imaging.WriteableBitmap
The WriteableBitmap object.
- targetStream
- Type: System.IO.Stream
The image data stream.
- targetWidth
- Type: System.Int32
The target width of the file.
- targetHeight
- Type: System.Int32
The target height of the file.
- orientation
- Type: System.Int32
This parameter is not currently used by this method. Use a value of 0 as a placeholder.
- quality
- Type: System.Int32
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.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type WriteableBitmap. When you use instance method syntax to call this method, omit the first parameter.
Show:
Note: