我需要知道如何将bitmap-image转换为windows store应用程序的字节数组。 这里是我试过,但它不会将位图保存的BitmapImage将bitmapImage转换为用于windows store的字节数组
Dim file As StorageFile = Await Windows.Storage.StorageFile.GetFileFromApplicationUriAsync()
Dim stream As IRandomAccessStream = Await file.OpenAsync(Windows.Storage.FileAccessMode.Read)
Dim decoder As BitmapDecoder = Await BitmapDecoder.CreateAsync(stream)
Dim pixelData As PixelDataProvider = Await decoder.GetPixelDataAsync()
Return pixelData.DetachPixelData()
你能告诉我们你尝试过什么到目前为止? –
到目前为止您尝试过哪些代码?如果你显示你已经尝试了什么,并说出哪个位不起作用,那么你会发现你会得到更好的回应。 –
以及我试过,但它不是存储像的BitmapImage '点心文件作为StorageFile =等待Windows.Storage.StorageFile.GetFileFromApplicationUriAsync() 昏暗流作为IRandomAccessStream =等待file.OpenAsync(Windows.Storage.FileAccessMode.Read) 昏暗解码器作为BitmapDecoder =等待BitmapDecoder.CreateAsync(流) 昏暗PixelData取出作为PixelDataProvider =等待decoder.GetPixelDataAsync() 返回pixelData.DetachPixelData()” –