void printscreen(void) #define put(c) fputc(c,Lst) { int i,j,k,l1,l2,from; int b,mod,div; char prn_name[15],*suffix=".prn",str[60]; FILE *Lst; strcpy(prn_name,param); strcat(prn_name,suffix); if((Lst = fopen("prn","w")) == NULL){ message("Нет связи с принтером"); return; } /* if((buffer = (char *) malloc(10000)) == NULL) message("not enough memory"); else setvbuf(Lst,buffer,_IOFBF,9990); */ fprintf(Lst,"\n"); from = 0; l1 = GSSY; l2 = GSSX; mod = ((l2-1) % 256); div =((l2-1) / 256); put(27); put('@'); put(27); put('A'); put(8); for(i = from/8;i <= l1/8; i++){ put(27); put('L'); put(mod); put(div); for(j=0;j <= l2-2; j++) { if(_kbhit()) return; for(k = 0,b = 0; k <= 7; k++) b = b | ((((getpixel(j,i*8+k) != 0) && (i*8+k < l1)) << (7-k))); if( b == 26) b = 16; put(b); } put(13); put(10); } put(27); put('A'); put(8); put(13); put(10); fclose(Lst); }