Skip to content

Commit 0c0ee2e

Browse files
committed
ペイント解説のUI画像を追加
1 parent aa46fbb commit 0c0ee2e

5 files changed

Lines changed: 11 additions & 1 deletion

File tree

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,4 @@ CreateJS入門サイトでAnimate CCを扱うのには理由があります。An
138138

139139
<article-author>[池田 泰延](https://twitter.com/clockmaker)</article-author>
140140
<article-date-published>2015-11-22</article-date-published>
141-
<article-date-modified>2016-07-03</article-date-modified>
141+
<article-date-modified>2016-10-18</article-date-modified>

docs/paint.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ function handleUp(event) {
168168

169169
`input`タグで`type="color"`の種類を指定すると、カラーパレットを使えます。OSやブラウザの種類によって、カラーパレットのデザインが異なります。
170170

171+
![](../imgs/paint_input.png)
172+
173+
▲ 左上はWindows 10のChrome、中央はEdge、右側はmacOSのSafariのカラーパレット
174+
171175
### 色の値の取得
172176

173177
お絵描きの線の色は`input`タグの`value`値を使います。`document.querySelector()`メソッドは、HTML要素を参照するメソッドですが、これを使って`input`タグの値を参照します。
@@ -202,6 +206,12 @@ document.querySelector("#buttonReset").addEventListener("click", function(){
202206
});
203207
```
204208

209+
210+
![](../imgs/paint_confirm.png)
211+
212+
`confirm()`メソッドはダイアログを簡単に実装できる命令
213+
214+
205215
### 保存ボタンの制御
206216

207217
保存機能については、`canvas`タグの`toDataURL()`メソッドを使うことで画像をBase64文字列で取得することができます。Base64文字列を新しいウインドウで開くことで画像として表示することができるので、これを保存機能としましょう。

imgs/paint_confirm.png

59.3 KB
Loading

imgs/paint_input.png

215 KB
Loading

imgs/paint_input.psd

4.16 MB
Binary file not shown.

0 commit comments

Comments
 (0)