BitmapEncoder.CreateForInPlacePropertyEncodingAsync | createForInPlacePropertyEncodingAsync method
Asynchronously creates a new BitmapEncoder for in-place property and metadata editing. The new encoder can only edit bitmap properties in-place and will fail for any other uses.
Windows.Graphics.Imaging.BitmapEncoder.createForInPlacePropertyEncodingAsync(bitmapDecoder).done( /* Your success and error handlers */ );
Note The encoder writes to the stream that the original BitmapDecoder was created on. You can't specify an output stream.
Use this method to retrieve an encoder when you are only going to use it to edit or write a limited amount of properties to the image. An encoder retrieved this way can provide a performance advantage over an encoder returned by CreateForTranscodingAsync because it writes the new properties to empty padding space instead of encoding the entire image again.
Note Here are several limitations to an encoder retrieved this way:
You can only use these methods on the encoder:
- The input BitmapDecoder must be an encoder created on a stream with ReadWrite access.
- Not all metadata formats support fast metadata encoding. The native metadata handlers that support metadata are IFD, Exif, XMP, and GPS.
- The metadata block must have enough padding to store the properties that you are trying to edit.
If an encoding operation fails for any reason, you will have to use CreateForTranscodingAsync to edit the metadata and re-encode the image. When you re-encode, you can also add new or additional padding to enable in-place property encoding in the future. To do this, create a new BitmapTypedValue with Type set to UInt32 and Value set to the number of bytes of padding you wish to add. A typical value is 4096 bytes. Set this metadata item on one or more of the metadata query locations in this table.
|Metadata format||JPEG metadata query||TIFF, JPEG-XR metadata query|
Minimum supported client
Minimum supported server
|Windows Server 2012|
Minimum supported phone
|Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]|