diff --git a/exec/load/frame.js b/exec/load/frame.js index f5f1c88abe1de2dd71767439bad9d75d479988f1..ad27e26f51d8642b4664233aec088e3edd3077db 100644 --- a/exec/load/frame.js +++ b/exec/load/frame.js @@ -255,7 +255,34 @@ function Frame(x,y,width,height,attr,frame) { var yoff = frame.y - this.y; updateChar(xoff + x,yoff + y); } + this.screenShot = function(file,append) { + var f = new File(file); + if(append) + f.open('ab',true,4096); + else + f.open('wb',true,4096) ; + if(!f.is_open) + return false; + for(var y = 0;y<this.height;y++) { + for(var x = 0;x<this.width;x++) { + var c = getTopCanvas(x,y); + var d = getData(c,x,y); + if(d.ch) + f.write(d.ch); + else + f.write(" "); + if(d.attr) + f.writeBin(d.attr,1); + else + f.writeBin(0,1); + } + } + + f.close(); + return true; + } + /* private functions */ function updateChar(x,y) { if(!properties.update[y]) @@ -800,6 +827,9 @@ function Frame(x,y,width,height,attr,frame) { if(update) this.refresh(); } + this.screenShot = function(file,append) { + return properties.display.screenShot(file,append); + } /* console method emulation */ this.home = function() {