so, ich versuche IRandomAccessStreamWithContentType aber kann nicht bekommen, weil ich Ausnahme erhalten:C# UWP Konvertieren von System.IO.Stream Windows.Storage.Streams.IRandomAccessStreamWithContentType
"This IRandomAccessStream does not support the CloneStream method because it requires cloning and this stream does not support cloning."
Und dies geschieht auf letzte Zeile der folgender Code:
PixelDataProvider pix = await decoder.GetPixelDataAsync(
BitmapPixelFormat.Bgra8,
BitmapAlphaMode.Straight,
transform,
ExifOrientationMode.IgnoreExifOrientation,
ColorManagementMode.ColorManageToSRgb);
byte[] pixels = pix.DetachPixelData();
Stream pixStream = cropBmp.PixelBuffer.AsStream();
pixStream.Write(pixels, 0, (int)(width * height * 4));
IRandomAccessStream iStream= pixStream.AsRandomAccessStream(); //dafaq with streams
RandomAccessStreamReference iReferenceStream= RandomAccessStreamReference.CreateFromStream(iStream);
IRandomAccessStreamWithContentType newStream = await iReferenceStream.OpenReadAsync();
Gibt es eine Problemumgehung oder etwas?
Edit 1
ich auch auf diese Weise versucht haben, immer noch nicht funktioniert. (Aber jetzt bekomme ich null nicht, dass Clone gescheitert)