站内搜索:
首页 >> 前端 >> 内容
webgl在使用canvas.toDataURL()时没有内容怎么办?

时间:2017/11/7 15:32:21

这个问题很好解决,就是在获取webgl对象的时候,多传入一个{preserveDrawingBuffer: true},然后在使用canvas.toDataURL()获取就能够获取到了。

案例:

    var canvas = document.getElementById("canvas");
    gl = canvas.getContext("experimental-webgl", {preserveDrawingBuffer: true});

  • 上一篇:booterStrap写轮播图的方法
  • 下一篇:AIDL实现步骤
  • 返回顶部