首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用WriteableBitmap实现双WriteableBitmapEx闪电战

用WriteableBitmap实现双WriteableBitmapEx闪电战
EN

Stack Overflow用户
提问于 2013-04-18 08:40:57
回答 1查看 1.4K关注 0票数 0

我试着把两张可写的位图擦掉。但是,调试器会提示一条错误消息,说明以下内容:

输入WriteableBitmap需要具有Pbgra32像素格式。使用BitmapFactory.ConvertToPbgra32Format方法自动将任何输入BitmapSource ?转换为该类接受的正确格式。

这是我的密码。

代码语言:javascript
复制
Rect cRect =new (320,240);
WriteableBitmap _bitmap = new WriteableBitmap(320, 240, 96, 96, PixelFormats.Bgr32, null);
_bitmap.WritePixels(new Int32Rect(0, 0, 320, 240), _image, 320*240, 0);    //_image is a image stream                  
_bitmap.Blit(cRect, _imageFrame, cRect); //_imageFrame is another writeablebitmap

实际上,_imageFrame是画布上的一个WriteableBitmap,它将在正常时间更改其内容。有没有一种更有效的方法将可写位图和画布混为一谈?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-04-18 09:01:55

你能改到这一行吗?

代码语言:javascript
复制
WriteableBitmap _bitmap = new WriteableBitmap(320, 240, 96, 96, PixelFormats.Pbgra32, null);

_imageFrame WriteableBitmap上类似的东西

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16078255

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档