I share this blog with my thoughts and creations from my daily programming, knowledge, and technology updates.
Apps Scriptリファレンス: Apps Script Reference
|障害・課題追跡: IssueTracker
|Google Workspace: Status Dashboard
- Summary
2019年5月7日火曜日
canvasのwidthとheightの設定
タグ内で設定したい
<canvas id="canvas1" width=600 height="1200"></canvas>
スクリプトで設定したい
var canvas_div = elem('canvas_div');
var canvas = document.getElementById('canvas1');
canvas.width = 600;
canvas.height = 1200;
補足:スタイルで設定してもうまくいかなかった
<style>
#canvas1 {
width: 600;
height1200;
}
</style>
参考
HTMLCanvasElement.width
https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/width
HTMLCanvasElement.height
Latest post
スプレッドシートの空白セルを直前の値で埋めたい
A列の空白セルに直前の値を入れたくて書いたコードです スプレッドシートに以下のようなBeforeの表があるとき (A列に空白セルがある) Before 1 A B 2 エリア 都市 3 東京 新宿 4 渋谷 5 池袋 6 神奈川 横浜 7 川崎 8 相模原 9 千葉 千葉 10 ...