在SL類庫MyLib中,我有一個圖像說my.png。然後我想在後面的代碼中使用它我試着按照下面的方式:如何在silverlight應用程序中爲本地圖像設置uri?
StreamResourceInfo resourceStream = Application.GetResourceStream(new Uri("/MyLib;component/my.png", UriKind.Relative));
BitmapImage image = new BitmapImage();
image.SetSource(resourceStream.Stream);
this.MyIcon.Source = image;
但它不是在開火。我認爲這是Uri設置不正確。請幫助。