views:

25

answers:

2

WPF has an ImageSource which has a BitmapMetadata.

However, the Metadata property is read only an the BitmapMetadata is frozen.

So I can I modify the metadata of an image?

A: 

Unfortunately the WPF imaging API doesn't allow you to modify the image metadata... However, you can still do it with GDI+ (System.Drawing)

Thomas Levesque
A: 

Found the answer:

var frame = ...;

BitmapMetadata newMetadata = ...;

var newFrame = BitmapFrame.Create(frame, frame.Thumbnail, newMetadata, frame.ColorContexts);

var encoder = new JpegBitmapEncoder();

encoder.Frames.Add(newFrame);