I used this code to get the image file in the localFolder and I encountered the below problem. The problem is at
BitmapImage src is null even there is data in randomstream
any idea how to overcome this problem? Why BitmapImage is null??
string strFilenm = "SDraw-" + prodId.ToString() + ".png"; var folder_path = System.IO.Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "Img"); StorageFolder folder = await StorageFolder.GetFolderFromPathAsync(folder_path); StorageFile storagefile = await folder.GetFileAsync(strFilenm); StorageFile jpgFile = await folder.GetFileAsync(strFilenm); IRandomAccessStream randomStream = await jpgFile.OpenAsync(FileAccessMode.Read); randomStream.Seek(0); BitmapImage src = new BitmapImage(); await src.SetSourceAsync(randomStream); Image1.Source = src;