Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initialize canvas #2

Open
SohMitian opened this issue Nov 28, 2018 · 1 comment
Open

initialize canvas #2

SohMitian opened this issue Nov 28, 2018 · 1 comment
Assignees

Comments

@SohMitian
Copy link

画像を選択するたびに画像が重なる問題ですが、キャンバスをつど初期化してみてはどうでしょう。
1.初期化
2.背景だけ描画
以下コード

function initializeCanvas() {
    ctx.clearRect(0, 0, canvas.width, canvas.height)
    img.src = 'img/background5.png';
    img.onload = function () {
        ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
    }
}
@retoruto-carry
Copy link
Owner

良さそうですね!ありがとうございます!
色々検討してみます!

@retoruto-carry retoruto-carry self-assigned this Nov 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants