Hi,I am developing a windows phone 8.1 app,my app needs to capture images there is no issue in capturing images when I save the image to isolated storage its getting blurred.Saving of images to isolated storage works fine when app runs in windows phone 8.1 when it is in windows phone 10 it is blurred.I am using the following code.I am using FileOpenPicker to select an image.private async void viewActivated(CoreApplicationView sender, Windows.ApplicationModel.Activation.IActivatedEventArgs args) { FileOpenPickerContinuationEventArgs args1 = args as FileOpenPickerContinuationEventArgs;if (args1 != null) { if (args1.Files.Count == 0) return; View.Activated -= viewActivated; StorageFile storageFile = args1.Files[0]; var stream = await storageFile.OpenAsync(Windows.Storage.FileAccessMode.Read); await isolatedStorage.SaveImages(stream.AsStream(), directory, myFilename);} public async Task<bool> SaveImages(Stream stream, string directory, string fileName) { StorageFolder folder = null; StorageFolder localFolder = ApplicationData.Current.LocalFolder; folder = localFolder; try { foreach (var item in directory.Split('\\')) { folder = await folder.CreateFolderAsync(item, CreationCollisionOption.OpenIfExists); } } catch (Exception ex) { } BitmapImage bitmapImage = new BitmapImage(); try { StorageFile file = await folder.CreateFileAsync(fileName, CreationCollisionOption.ReplaceExisting); bitmapImage.DecodePixelHeight = 500; await bitmapImage.SetSourceAsync(stream.AsRandomAccessStream()); //var wb = new WriteableBitmap(bitmapImage.PixelWidth,bitmapImage.PixelHeight); //if (Constants.IsCompress) //{ BitmapDecoder bmpDecoder = await BitmapDecoder.CreateAsync(stream.AsRandomAccessStream()); BitmapTransform trns = new BitmapTransform(); trns.Rotation = BitmapRotation.None; trns.Flip = BitmapFlip.None; PixelDataProvider pixelData = await bmpDecoder.GetPixelDataAsync(bmpDecoder.BitmapPixelFormat, BitmapAlphaMode.Premultiplied, trns, ExifOrientationMode.IgnoreExifOrientation, ColorManagementMode.ColorManageToSRgb); using (var destFileStream = await file.OpenAsync(FileAccessMode.ReadWrite)) { BitmapEncoder bmpEncoder = await BitmapEncoder.CreateAsync(BitmapEncoder.JpegEncoderId, destFileStream); bmpEncoder.SetPixelData(BitmapPixelFormat.Bgra8, BitmapAlphaMode.Straight, Convert.ToUInt32(bmpDecoder.OrientedPixelWidth), Convert.ToUInt32(bmpDecoder.OrientedPixelHeight), bmpDecoder.DpiX, bmpDecoder.DpiY, pixelData.DetachPixelData()); await bmpEncoder.FlushAsync(); } stream.Dispose(); } catch (Exception ex) { string s = ex.Message; } return true; 解决方案 这篇关于[WP8.1]当保存到Windows Phone 10中的隔离存储器中时,图像变得模糊的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-29 19:45