我目前正在为我的可写位图类使用WriteableBitmapEx 扩展。到目前为止一切正常,我正在一个 WinRT 项目中执行此操作。我运行此代码将位图合并在一起。
Windows.Storage.Pickers.FileSavePicker save = new Windows.Storage.Pickers.FileSavePicker();
save.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.Desktop;
save.DefaultFileExtension = ".png";
save.FileTypeChoices.Add("PNG", new string[] { ".png" });
StorageFile filesave = await save.PickSaveFileAsync();
IOutputStream ab = await filesave.OpenAsync(FileAccessMode.ReadWrite);
if (ab != null)
{
// await _inkManager.SaveAsync(ab);
var imageUri = new Uri("http://i.imgur.com/rbiLg5Z.gif");
var fullSizeBitmap = new Windows.UI.Xaml.Media.Imaging.BitmapImage(imageUri);
// image.Source = fullSizeBitmap;
var file = await WebFile.SaveAsync(imageUri);
WriteableBitmap myTempImage = await new WriteableBitmap(1, 1).LoadAsync(file);
// error!
myImage.Blit(new Rect(0, 0, 20, 28), myTempImage, new Rect(0, 0, 20, 38));
现在myImage.Blit
我得到一个未处理的访问冲突异常。我真的不明白发生了什么或我做错了什么。因此,我们将不胜感激。