The URI given to MediaControl for a music file's album art .Net

你。 提交于 2019-12-11 08:16:47

问题


I want to show album art in the windows 8 media control, like this:

However, MediaControl.AlbumArt has type Uri, instead of type ImageSource like I expected. Does the album art embedded in a music file even have a URI? I've tried providing a URI to the file ("file:///C:/Rest/Of/Path.mp3") (an immediate exception results), but other than that I don't even know where to start. Maybe I'm supposed to write the album art to a temporary file and point at that (feels like the wrong way to do it, but maybe?).


回答1:


You can either provide a web link or use the ms-appx:// format to refer to files in your app directory.

http://msdn.microsoft.com/en-us/library/windows/apps/hh781215.aspx

Note that to reference the root of your app directory it's three slashes:

var x = new Uri("ms-appx:///path/to/image.png");


来源:https://stackoverflow.com/questions/12924390/the-uri-given-to-mediacontrol-for-a-music-files-album-art-net

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