c - ncurses 位 block 传输/缓冲区

标签 c ncurses blit

我正在寻找一种创建“缓冲区”的方法,我可以使用 ncurses 将其直接复制或位 block 传送到 WINDOW* 上。我知道有子窗口,但由于移动/调整它们大小的唯一方法是创建一个全新的子窗口,因此它们不太适合。我正在寻找类似于 Microsoft 的 WriteConsoleOutput 的东西.

如果我也可以以反向 blit 方式复制区域(获取 stdscr 的矩形并将副本存储在缓冲区中)

最佳答案

实际上可以移动窗口或调整窗口大小,而无需重新创建它们:

mvwin

Calling mvwin moves the window so that the upper left-hand corner is at position (x, y). If the move would cause the window to be off the is allowed, but should be avoided.

wresize

This is an extension to the curses library. It reallocates storage for an ncurses window to adjust its dimensions to the specified values. If either dimension is larger than the current values, the window's data is filled with blanks that have the current background rendition (as set by wbkgdset) merged into them.

This extension of ncurses was introduced in mid-1995. It was adopted in NetBSD curses (2001) and PDCurses (2003).

关于问题,窗口的更新是基于行的(例如,参见waddchnstr)。

关于c - ncurses 位 block 传输/缓冲区,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60107598/

相关文章:

c - C ncurses 应用程序中的希伯来语支持

c - 使用 ncurses 处理转义序列? printf 是否处理转义序列?

python - 有什么方法可以让 "clear"成为一个表面吗?

c - Fread函数和文件

c - [错误]:expected '(' before 'hours'

c - 如何使用Wifi udp套接字编程控制鼠标指针

python - Pygame 文本表面不绘图

c - 移动指针以便以不同的顺序打印

python - 如何防止curses应用程序出现故障?

Python、QT 和 matplotlib 散点图与 blitting