3
我需要從IsolatedStorage加載圖像,並將其顯示在Image UIElement上。 我調查了MSDN,發現我無法從IsolatedStorage獲得Uri。我可以獲取保存的jpeg圖像文件的流。如何從孤立存儲中讀取圖像並將其顯示在圖像元素上?
當我得到jpeg文件流後,如何在Image元素上顯示它?
我需要從IsolatedStorage加載圖像,並將其顯示在Image UIElement上。 我調查了MSDN,發現我無法從IsolatedStorage獲得Uri。我可以獲取保存的jpeg圖像文件的流。如何從孤立存儲中讀取圖像並將其顯示在圖像元素上?
當我得到jpeg文件流後,如何在Image元素上顯示它?
使用BitmapImage.SetSource讀取數據流,然後將Image.Source設置爲BitmapImage的:
Stream jpegStream;
var image1 = new BitmapImage();
image1.SetSource(jpegStream);
Image image = new Image();
image.Source = image1;
非常感謝你。 – AechoLiu 2011-05-04 07:54:14