#include #include #include #include #include int huge return0(void) {return 0;} const unsigned SVGA_RED = 39; const unsigned cell_x = 14; const unsigned cell_y = 13; const unsigned cell_mem_size = 214; // for 320*200: // const unsigned cell_x = 7; // const unsigned cell_y = 7; char pixel[cell_x][cell_y], cursx, cursy; char dc[20]; void draw_table() { int a, b,c; cleardevice(); setcolor(7); for(a=0;a<=cell_x;a++) line(a*10,0,a*10,130); for(a=0;a<=cell_y;a++) line(0,a*10,140,a*10); for(a=0;a0) dy = -1;break; case 80: if (cursy0) dx = -1;break; case 77: if (cursx9) color-=10; putimage(200,0,(void*)blank,COPY_PUT); setcolor(color);outtextxy(200,0,itoa(color,s,10)); break; case '.': if (color<255) color++; putimage(200,0,(void*)blank,COPY_PUT); setcolor(color);outtextxy(200,0,itoa(color,s,10)); break; case ',': if (color>0) color--; putimage(200,0,(void*)blank,COPY_PUT); setcolor(color);outtextxy(200,0,itoa(color,s,10)); break; case 'c': n1=getch();n2=getch();n3=getch(); if((n1>='0')&&(n1<='9')&&(n2>='0')&&(n2<='9')&&(n3>='0')&&(n3<='9')) { color = (n1-'0')*100+(n2-'0')*10+n1-'0'; setcolor(color); putimage(200,0,(void*)blank,COPY_PUT); outtextxy(200,0,itoa(color,s,10)); } break; case 's': getimage(200,50,213,62,(void*)thispict); closegraph(); cout << "\nPlease type the file name - \n"; cin.getline(s,100); out_file.open(s); for(a=0;a<214;a++) out_file.put(thispict[a]); out_file.close(); initgraph(&gi,&gm,"c:\\tc\\bgi"); draw_table(); } putimage(cursx*10+4,cursy*10+4,(void*)dc,XOR_PUT); cursx+= dx; cursy+=dy; dx=dy=0; putimage(cursx*10+4,cursy*10+4,(void*)dc,XOR_PUT); } closegraph(); return 0; } /*while((c = getch()) != 13) { if (c == '+') color++; if (c == '-') color--; setcolor(color); rectangle(10,10,22,21); }*/