Skip to content

Instantly share code, notes, and snippets.

@amuhororo
Last active July 12, 2016 14:06
Show Gist options
  • Save amuhororo/c1b315e1a1b8b3bfb43e7652a873e433 to your computer and use it in GitHub Desktop.
Save amuhororo/c1b315e1a1b8b3bfb43e7652a873e433 to your computer and use it in GitHub Desktop.
Canvas画質指定
snapSave : function(title, call_back,flag_thumb) {
// 略
} else {
setTimeout(function() {
html2canvas($("#tyrano_base").get(0), {
onrendered : function(canvas) {
//ここ!
img_code = canvas.toDataURL(); //
//略
},
// 変更の仕方
img_code = canvas.toDataURL("image/jpeg");   //jpeg + 第二引数省略は画質100%
img_code = canvas.toDataURL("image/jpeg",0.7); //jpeg + 画質0.7
img_code = canvas.toDataURL("image/webp",0.7); //Chromeのみっぽい。激軽。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment