我试着把两张可写的位图擦掉。但是,调试器会提示一条错误消息,说明以下内容:
输入WriteableBitmap需要具有Pbgra32像素格式。使用BitmapFactory.ConvertToPbgra32Format方法自动将任何输入BitmapSource ?转换为该类接受的正确格式。
这是我的密码。
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,它将在正常时间更改其内容。有没有一种更有效的方法将可写位图和画布混为一谈?
发布于 2013-04-18 09:01:55
你能改到这一行吗?
WriteableBitmap _bitmap = new WriteableBitmap(320, 240, 96, 96, PixelFormats.Pbgra32, null);和_imageFrame WriteableBitmap上类似的东西
https://stackoverflow.com/questions/16078255
复制相似问题