javascript - Speed up drawing image in canvas -
i have draw multiple images on 1 canvas. make program works, though, have speed display. see images appear 1 one:
var ctx = document.getelementbyid('images_tiles').getcontext('2d'); function handler() { var = this.i; ctx.drawimage(this.img_src, this.r * tilesize, this.c*tilesize, tilesize * tilelist[i].qw, tilesize * tilelist[i].qh); } //draw tiles in spiral (i=0; i<tilelist.length; i++) { var o = { img_src: new image, c: tilelist[i].y, r: tilelist[i].x, i: }; o.img_src.onload = handler.bind(o); o.img_src.src = './viewer/images/'+path+'/lod'+glod+'/tiles_'+ o.c + '_' + o.r +'.jpeg'; }
i see webworker can make parallelization not display. have solution or/and trick.
Comments
Post a Comment