我正在寻找一种创建“缓冲区”的方法,我可以使用 ncurses 将其直接复制或位 block 传送到 WINDOW*
上。我知道有子窗口,但由于移动/调整它们大小的唯一方法是创建一个全新的子窗口,因此它们不太适合。我正在寻找类似于 Microsoft 的 WriteConsoleOutput 的东西.
如果我也可以以反向 blit 方式复制区域(获取 stdscr
的矩形并将副本存储在缓冲区中)
最佳答案
实际上可以移动窗口或调整窗口大小,而无需重新创建它们:
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.
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/