Definition: | sequence s3 = save_text_image(sequence s1, sequence s2) |
Description: | Save a rectangular region of text from a text-mode screen. The result is a sequence of sequences containing ASCII characters and attributes from the screen. You can redisplay this text using display_text_image(). s1 is a 2-element sequence {line1, column1} specifying the top-left character. s2 is a sequence {line2, column2} specifying the bottom right character. |
Comments: | Because the character attributes are also saved, you will get
the correct foreground color, background color and other properties
for each character when you redisplay the text.
On DOS32, an attribute byte is made up of two 4-bit fields that encode the foreground and background color of a character. The high-order 4 bits determine the background color, while the low-order 4 bits determine the foreground color. You might use this function in a text-mode graphical user interface to save a portion of the screen before displaying a drop-down menu, dialog box, alert box etc. On DOS32, if you are flipping video pages, note that this function reads from the current active page. |
Example: | If the top 2 lines of the screen have: |
Hello World |
|
And you execute: | |
s = save_text_image({1,1}, {2,5}) |
|
Then s is something like: | |
{"H-e-l-l-o-", "W-o-r-l-d-"}where '-' indicates the attribute bytes |
|
See Also: | display_text_image, get_screen_char |