<font color="RED" size=4>To kchsun:</font>
这是可以控制Brother 2724针式打印机进行屏幕图形打印的子程序(<font color="RED"C语言</font>)供参考:
/* graphics print sub_function under the VGA 640*480 256color model in Borland C v3.1
key function controling printer: fprintf();biosprint()
Example: This's Brother 2724 Printer
*/
prntoscr()
{
int x,y,i,j,cor;
unsigned char by[20][3][640];
for(i=0;i<20;i++)
for(x=0;x<640;x++)
for(j=0;j<=2;j++)
{
by[j][x]=0x00;
for(y=0;y<=7;y++){
cor=getpixel(x,i*24+j*8+y);
by[j][x]=(by[j][x]<<1);
if(cor!=0)
by[j][x]=(by[j][x]|0x01);}
}
fprintf(stdprn,"%c%c%c",27,51,24);
for(i=0;i<20;i++){
fprintf(stdprn,"%c%c%c%c%c",27,42,33,128,2);
for(x=0;x<640;x++)
for(j=0;j<=2;j++)
biosprint(0,by[j][x],0);
fprintf(stdprn,"%c%c",13,10);
}
fprintf(stdprn,"%c%c",10,10);
return 0;
}