您是否知道任何使用WPF WriteableBitmap和理想的BackBuffer提供繪製簡單形狀(線條和可選其他形狀)方法的庫? 我知道有一個用於Silverlight的WriteableBitmapEx項目,但是WPF等價嗎?使用WPF的繪圖線WriteableBitmap.BackBuffer
3
A
回答
7
我猜這裏是回答我的問題:)
_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();
+4
你不需要明確處理()位圖。這是使用的目的。 – 2012-01-15 13:11:22
1
你似乎是使用位圖,但要求使用WriteableBitmap的解決方案。有一個WPF的WriteableBitmapEx。
+0
WriteableBitmapEx沒有最佳的性能,並且不能繪製文本;如果您需要的話,它只有線路更好的抗鋸齒系統。 – 2015-09-21 09:00:21
相關問題
- 1. 使用WPF繪製3D線
- 2. 你用什麼來繪製使用C#和WPF的折線圖?
- 3. 使用WPF在畫布上繪製線
- 4. 繪畫使用WPF
- 5. 使用QT的圖片中的自由手繪線性繪圖
- 6. 使用WPF在多屏幕上繪圖
- 7. 如何在WPF中使用GDI +繪圖?
- 8. WPF快速2D繪圖...使用什麼?
- 9. WPF折線相對點值和拉伸繪製的曲線圖
- 10. 的繪圖線
- 11. 的繪圖線
- 12. WPF c#使用線條或替代方法繪製粗曲線
- 13. 使用kineticjs傳輸的繪圖線
- 14. 繪圖虛線使用的CALayer
- 15. 沒有mxml的繪圖線(使用ActionScript)
- 16. 繪製線陣列WPF
- 17. 在WPF中繪製3D線
- 18. 如何讓用戶使用WPF中的畫布繪製線條
- 19. WPF圖像重繪
- 20. WPF繪圖問題
- 21. 重繪圖像WPF
- 22. WPF繪圖悖論
- 23. WPF中的繪圖圈
- 24. WPF中的位圖繪製
- 25. 繪圖線的JavaScript
- 26. 如何使用phpGraphlib繪製多線圖
- 27. 如何使用matplotlib繪製折線圖
- 28. 繪製折線圖使用chart.js之
- 29. Python使用Matplotlib繪製拋物線圖
- 30. 在線程中使用matplotlib繪圖
相關:[如何獲取WriteableBitmap DrawingContext](http://stackoverflow.com/questions/88488/getting-a-drawingcontext-for-a-wpf-writeablebitmap) – 2012-01-03 12:24:00