BitmapImage UriSource错误 [英] BitmapImage UriSource wrong
问题描述
以下代码不应显示消息框,但是:
The following code should not display a message box, but does:
Uri uriToUse = new Uri("ms-appx:///assets/logo.png");
BitmapImage bi = new BitmapImage() {UriSource = uriToUse};
if (uriToUse != bi.UriSource)
{
MessageDialog dialog = new MessageDialog("Shouldn't get here but do");
await dialog.ShowAsync();
}
实际上,UriSource是"ms-appx:/assets/logo.png"。
Actually, the UriSource is "ms-appx:/assets/logo.png".
这个对我来说是一个问题因为我有一些现有的代码提供了BitmapImage,但是需要一个URI来传递给tile系统。 所以我必须使我的代码更复杂,以解决这个问题。
This is a problem for me because I have some existing code that is providing a BitmapImage, but need a URI to pass to the tile system. So I have to make my code even more complex to deal with this problem.
我希望RTM能解决这个问题!
I hope this can be fixed by RTM!
... Stefan
...Stefan
推荐答案
您能否使用 Uri uriToUse =
新 Uri ( " ms-appx :/assets/logo.png" );
Are you able to use Uri uriToUse = new Uri("ms-appx:/assets/logo.png");
只有一个/在ms-appx之后?
only one / after ms-appx?
这篇关于BitmapImage UriSource错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!