Context:
Image1 is a Windows.UI.Xaml.Controls.Image
Image1.Source is WritableBitmap1, which is a Windows.UI.Xaml.Media.Imaging.WritableBitmap
Image2 is a Windows.UI.Xaml.Controls.Image
Now I want to drag Image1 to Image2, so that they show the same image. Now the code works like this:
When Image1.DragStarting:
args.Data.SetBitmap(RandomAccessStreamReference.CreateFromStream(WritableBitmap1.PixelBuffer.AsStream.AsRandomAccessStream))
When Image2.Drop (e As DragEventArgs):
Await (Await e.DataView.GetBitmapAsync()).OpenReadAsync'←Exception occurs here
The IRandomAccessStreamReference.OpenReadAsync() function fails:
System.NotSupportedException:“This IRandomAccessStream does not support the CloneStream method because it requires cloning and this stream does not support cloning.”
WritableImage1 is created programmatically and thus no files can be used as a source.