你知道有哪些库可以使用WPF WriteableBitmap和理想的BackBuffer来绘制简单的形状(线条和其他形状)的方法吗? 我知道Silverlight有WriteableBitmapEx项目,但是是否有WPF等效项目呢?
你知道有哪些库可以使用WPF WriteableBitmap和理想的BackBuffer来绘制简单的形状(线条和其他形状)的方法吗? 我知道Silverlight有WriteableBitmapEx项目,但是是否有WPF等效项目呢?
我猜这里就是我的问题的答案 :)
_plotBitmap.Lock();
var b = new Bitmap(_plotBitmap.PixelWidth,
_plotBitmap.PixelHeight,
_plotBitmap.BackBufferStride,
System.Drawing.Imaging.PixelFormat.Format24bppRgb,
_plotBitmap.BackBuffer);
using(var bitmapGraphics = System.Drawing.Graphics.FromImage(b))
{
bitmapGraphics.SmoothingMode = SmoothingMode.HighSpeed;
bitmapGraphics.InterpolationMode = InterpolationMode.NearestNeighbor;
bitmapGraphics.CompositingMode = CompositingMode.SourceCopy;
bitmapGraphics.CompositingQuality = CompositingQuality.HighSpeed;
bitmapGraphics.DrawLine(Pens.Gold,2,2,222,222);
}
_plotBitmap.AddDirtyRect(new Int32Rect(0,0,_plotBitmap.PixelWidth,_plotBitmap.PixelHeight));
_plotBitmap.Unlock();
看起来你正在使用Bitmap,但要求使用WriteableBitmap的解决方案。WPF有WriteableBitmapEx可供使用。