How to set pixels to “Console Windows” by passing “String Pointer” in C?

半腔热情 提交于 2019-12-24 19:10:00

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!