HTML5 Canvas Draw Image
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
var img = document.getElementById("scream");
ctx.drawImage(img,10,10);
<!DOCTYPE html>
<html>
<body>
<p>Image to use:</p>
<img id="scream" src="img_the_scream.jpg" alt="The Scream" width="220" height="277">
<p>Canvas to fill:</p>
<canvas id="myCanvas" width="250" height="300"
style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas>
<p><button onclick="myCanvas()">Try it</button></p>
<script>
function myCanvas() {
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
var img = document.getElementById("scream");
ctx.drawImage(img,10,10);
}
</script>
</body>
</html>
게시글 목록
| 번호 | 제목 |
|---|---|
| 2861 | |
| 2849 | |
| 2828 | |
| 2824 | |
| 2820 | |
| 2814 | |
| 2813 | |
| 2808 | |
| 2807 | |
| 2802 | |
| 2795 | |
| 2787 | |
| 2783 |
CSS
css가 충돌이 됬을때
4
|
| 2781 | |
| 2776 |
HTML
HTML5 자바스크립트 API
1
|
| 2771 | |
| 2757 |
반응형
각 해상도별 테스트.
8
|
| 2756 |
HTML
결제모듈과 구글웹사이트 번역 엘리먼트
|
| 2755 |
HTML
팁] 모바일에서 문자보내기
2
|
| 2754 |
반응형
짧고 굵은거
1
|
| 2748 | |
| 2739 | |
| 2736 | |
| 2734 | |
| 2731 | |
| 2730 |
HTML
팁]모바일에서 전화 걸기
1
|
| 2729 | |
| 2726 | |
| 2724 | |
| 2722 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기