我已经拍了一张照片并保存了,但我需要对它进行图像处理。我尝试使用以下代码,但WritableBitmap不接受位图,它需要一个流。
var writeableBitmap =新的WritableBitmap(位图);
代码如下:
CameraCaptureUI cam = new CameraCaptureUI();
var capturedImage = await cam.CaptureFileAsync(CameraCaptureUIMode.Photo);
if (capturedImage != null)
{
var img = new BitmapImage();
img.SetSource(await capturedImage.OpenReadAsync());
}发布于 2012-09-23 06:06:53
这应该能起到作用--您需要使用OpenAsync。
var dialog = new CameraCaptureUI();
var file = await dialog.CaptureFileAsync(CameraCaptureUIMode.Photo);
if (file != null)
{
var stream = await file.OpenAsync(FileAccessMode.Read);
var img = new BitmapImage();
img.SetSource(stream);
AccountPictureImage.Source = img;
}https://stackoverflow.com/questions/12528054
复制相似问题