Open GoogleCodeExporter opened 8 years ago
Yes, it is. Before viewer.onloadingcomplete is invoked, the viewer sets a flag
to call for a redraw but won't perform it immediately. There's an asynchronous
routine, periodically scheduled by an internal timer, to get the actual job
done. So there will be only background when your code is executed.
Try this solution instead:
var canExport = false;
...
viewer.onloadingcomplete = function() {
// now we can export the screenshot
canExport = true;
};
viewer.afterupdate = function() {
// do export it and reset the flag
if (canExport) {
window.open(canvas.toDataURL());
canExport = false;
}
};
...
It makes use of another event handler viewer.afterupdate which is ensured to be
called after a redraw is complete for the actual exporting. This handler is
documented here:
http://jsc3d.googlecode.com/svn/trunk/jsc3d/docs/symbols/JSC3D.Viewer.html#after
update.
Original comment by Humu2...@gmail.com
on 4 Sep 2014 at 3:16
Thank you. It's work well
Original comment by fabien...@gmail.com
on 5 Sep 2014 at 2:02
Original issue reported on code.google.com by
fabien...@gmail.com
on 4 Sep 2014 at 8:33