问题
I know how to set pixels to "Console Windows" by using "SetPixel()"
http://msdn.microsoft.com/en-us/library/windows/desktop/dd145078(v=vs.85).aspx
But it wastes a lot of time to call this function and draw every pixels to it.
Is there any feasible way to set every pixels by passing string (pointer), and call function one time, but set every pixels?
回答1:
Not sure what you mean by "Console Windows" or "String", and what they have to do with SetPixel().
However it is true that modifying bitmaps using repeated calls to SetPixel() is very inefficient because it has high overhead. Instead, copy out the bitmap data to a buffer using GetDIBits(), modify the buffer, and once you're done copy them back into the bitmap using SetDIBits().
来源:https://stackoverflow.com/questions/20087493/how-to-set-pixels-to-console-windows-by-passing-string-pointer-in-c