dongyi8383 2018-07-16 08:43
浏览 1334
已采纳

Html2canvas以高“SCALE”拍摄高质量的屏幕截图

I change the screenshot quality by change the scale, for high quality I use the high scale, it works for quality that the image size will be less than 15MB and for the higher quality it, not works, actually when the screenshot takes an image by more than 15 MB I can't do anything by that image data.

jQuery(document).ready(function($) {
  $('body').click(function(event) {
    html2canvas(document.getElementById("content"), {
      scale: 5.5,
    }).then(function(canvas) {
      // Export the canvas to its data URI representation
      var base64image = canvas.toDataURL("image/png");
      // console.log(base64image);
      $('.entry-content').after(`
        <img src="` + base64image + `" alt="">
      `);
    });
  });
});
  • 写回答

1条回答 默认 最新

  • douzai2562 2018-10-23 06:02
    关注

    I finally found the solution It is related to the php.ini setting I change PHP.ini configuration as bellow and know I can take screenshot up to 90 MB by increasing the scale value.

    post_max_size=1024M

    upload_max_filesize=2048M

    If not working please add these codes to functions.php file

    @ini_set('upload_max_size','256M');
    @ini_set('post_max_size','256M');
    @ini_set('max_execution_time','30000');
    @ini_set('memory_limit', '-1');
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler