Reading Metadata property of GifBitmapDecoder…why is it null?

試著忘記壹切 提交于 2019-12-02 04:35:43

First, you need to Freeze the Frame you want to obtain the metadata from:

var frame = myGif.Frames[0];
frame.Freeze();

Second, the frame.Metadata returns an ImageMetadata which does not have a GetQuery method, but in fact the object returned is of type BitmapMetadata which has a GetQuery method, so you just need to cast frame.Metadata to BitmapMetadata as you do in the last commented lines of your code.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!