1.pngファイルを Images/Category/Image01.pngとして登録
2.画像のプロパティ「ビルドアクション」を「コンテンツ」に設定
3.以下のコードで実行
- StreamResourceInfo source = Application.GetResourceStream(new Uri("/Images/Category/Image01.png", UriKind.Relative));
- BitmapImage bitmap = new BitmapImage();
- bitmap.SetSource(source.Stream);
- WriteableBitmap wb = new WriteableBitmap(bitmap);
間違っているのは1行目のパス設定方法。
正しくは以下になります。
- StreamResourceInfo source = Application.GetResourceStream(new Uri("Images/Category/Image01.png", UriKind.Relative));
これで読み込むことが出来ました。
ルートがどこかは不明です。