开发者

how can I set the metadata of an image using WPF?

WPF has an Image开发者_StackOverflow社区Source 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?


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


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);

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜