パノラマとパノラマの背景画像を変更する必要があるボタンを備えたシンプルなページがあります。元の画像は 1200x800 です。Resources の画像を使用すると、すべて問題ありません。
Uri uri = new Uri("Resources/Panorama.png", UriKind.Relative);
var bitmap2 = new BitmapImage(uri);
// here from debugging: bitmap2.CreateOptions == DelayCreation, bitmap2.PixelWidth == 0 and bitmap2.PixelHeight == 0
var lcBrush2 = new ImageBrush() {
Stretch = Stretch.Fill,
ImageSource = bitmap2
};
panoMain.Background = lcBrush2;
しかし、Isolated Storage から写真を撮ると:
var picStream = ...getting a stream of file....;
BitmapImage bitmap = new BitmapImage();
bitmap.SetSource(picStream);
// here from debugging: bitmap.PixelWidth == 1200 and bitmap.PixelHeight == 800
var lcBrush = new ImageBrush() {
Stretch = Stretch.Fill,
ImageSource = bitmap
};
panoMain.Background = lcBrush;
その後、画像は 480x800 に縮小されます
私が間違っていることは何ですか?それともMSのバグ?