gpt4 book ai didi

wpf - 使用 WPF WriteableBitmap.BackBuffer 绘制线条

转载 作者:行者123 更新时间:2023-12-01 09:09:22 28 4
gpt4 key购买 nike

您知道任何提供使用 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();

关于wpf - 使用 WPF WriteableBitmap.BackBuffer 绘制线条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3000591/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com