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

问题描述:

请在这里写一些solutoins。

Please write here some solutoins.

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



-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

>