我正在使用WriteableBitmapEx库来编辑使用 Windows 8 Pro 的平板电脑摄像头拍摄的图像。每次调用 GetPixel() 函数时,我都会收到 AccessViolationException,代码如下:
Windows.Media.Capture.MediaCapture captureMgr = new MediaCapture();
await captureMgr.InitializeAsync();
IRandomAccessStream memoryStream = new InMemoryRandomAccessStream();
await captureMgr.CapturePhotoToStreamAsync(imageProperties, memoryStream);
await memoryStream.FlushAsync();
memoryStream.Seek(0);
WriteableBitmap tmpImage = new WriteableBitmap(1, 1);
tmpImage.SetSource(memoryStream);
tmpImage.GetPixel(1, 1); // An AccessViolationException occurs.
我做错了什么?