如何设置像素"控制台窗口"通过传递"字符串指针"用C? [英] How to set pixels to "Console Windows" by passing "String Pointer" in C?

查看:128
本文介绍了如何设置像素"控制台窗口"通过传递"字符串指针"用C?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何使用与setPixel()

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?

推荐答案

不知道你的控制台窗口或串了,他们有要的setPixel做什么意思()。

Not sure what you mean by "Console Windows" or "String", and what they have to do with SetPixel().

然而这是事实,修改使用重复调用的setPixel位图()的效率非常低,因为它具有高的开销。相反,位图数据复制到使用的的GetDIBits(),修改缓冲区,一旦你完成使用SetDIBits()将它们复制回位。

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().

这篇关于如何设置像素"控制台窗口"通过传递"字符串指针"用C?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆