-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIMAGE.CPP
More file actions
41 lines (28 loc) · 747 Bytes
/
IMAGE.CPP
File metadata and controls
41 lines (28 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <stdio.h>
#include "proboard.hpp"
#include <tswin.hpp>
void
screen_image()
{
File fp(form("%sIMAGE.TXT",syspath),fmode_write |
fmode_text |
fmode_copen |
fmode_append );
if(!fp.opened()) return;
String line;
for(int y=SCREEN.minY;y<=SCREEN.maxY;y++)
{
int lastchar = 0;
line = "";
for(int x=SCREEN.minX;x<=SCREEN.maxX;x++)
{
char c = tsw_whaton(x,y);
if(c!=' ') lastchar = x-SCREEN.minX+1;
line << c;
}
line << "\n\n";
line[lastchar] = '\n';
line[lastchar+1] = '\0';
fp.printf("%s",(char *)line);
}
}