Task snapshot (Text path) snapshot (0, 0, 640, 480, path) @ Task snapshot (Int xul, Int yul, Int dx, Int dy, Text path) // // xul: x-coordinate of upper-left corner of the region to be captured // xul: x-coordinate of upper-left corner of the region to be captured // dx: horizontal size (in pixels) of the region to be captured // dy: vertical size (in pixels) of the region to be captured // path: path to the file onto which the image is to be stored // Int2 head[]={0, 0, 118, 40, 0, 0, 0, 0, 0, 1000, 1000, 0, 0} Int r[]={0, 0, 0, 0,128,128,128,192,128, 0, 0, 0,255,255,255,255} Int g[]={0, 0,128,128, 0, 0,128,192,128, 0,255,255, 0, 0,255,255} Int b[]={0,128, 0,128, 0,128, 0,192,128,255, 0,255, 0,255, 0,255} Int zz size=8*((dx-1)/8+1) head[0]=size head[4]=dx head[5]=dy head[6]=4*65536L+1 command="write "+path Open g (command) Write binary g (66) Write binary g (77) Do k=0,12 +zz_=(head_[k_])&0xff; Write binary g (zz) +zz_=(head_[k_]>>8)&0xff; Write binary g (zz) +zz_=(head_[k_]>>16)&0xff; Write binary g (zz) Write binary g (0) Loop Do k=0,15 Write binary g (b[k]) Write binary g (g[k]) Write binary g (r[k]) Write binary g (0) Loop Do y=dy-1,0 Do x=0,size/2-1 z=16*getpixel(xul+2*x,yul+y)+getpixel(xul+2*x+1,yul+y) Write binary g (z) Loop Loop Close g