且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在c#中逐像素地绘制图像?

更新时间:2023-01-24 14:41:53

***的解决办法是在其中 [ ^ ]。



-KR
Best possible solution is here[^].

-KR


最糟糕的事情是使用 SetPixel 。你***使用 System.Drawing.Bitmap.LockBits

http://msdn.microsoft.com/en-us/library/system.drawing.bitmap.lockbits%28v=vs .110%29.aspx [ ^ ]。



使用WPF,可以使用类 System.Windows.Media.Imaging.WriteableBitmap

http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.writeablebitmap%28v=vs.110% 29.aspx [ ^ ]。



-SA
Worst thing to draw anything is using SetPixel. You should better use System.Drawing.Bitmap.LockBits:
http://msdn.microsoft.com/en-us/library/system.drawing.bitmap.lockbits%28v=vs.110%29.aspx[^].

With WPF, it can be done using the class System.Windows.Media.Imaging.WriteableBitmap:
http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.writeablebitmap%28v=vs.110%29.aspx[^].

—SA

>