sitelink1 | http://www.w3schools.com/tags/ref_canvas.asp |
---|---|
sitelink2 | http://www.w3schools.com/canvas/default.asp |
sitelink3 | |
sitelink4 | |
extra_vars5 | |
extra_vars6 |
Canvas Description
The HTML5 <canvas> tag is used to draw graphics, on the fly, via scripting (usually JavaScript).
However, the <canvas> element has no drawing abilities of its own (it is only a container for graphics) - you must use a script to actually draw the graphics.
The getContext() method returns an object that provides methods and properties for drawing on the canvas.
This reference will cover the properties and methods of the getContext("2d") object, which can be used to draw text, lines, boxes, circles, and more - on the canvas.
What is HTML Canvas?
The HTML <canvas> element is used to draw graphics, on the fly, via scripting (usually JavaScript).
The <canvas> element is only a container for graphics. You must use a script to actually draw the graphics.
Canvas has several methods for drawing paths, boxes, circles, text, and adding images.
- context = canvas.getContext(contextId [, ... ] )
-
Returns an object that exposes an API for drawing on the canvas. The first argument specifies the desired API, either "
2d
", "bitmaprenderer
" or "webgl
". Subsequent arguments are handled by that API.This specification defines the "
2d
" and "bitmaprenderer
" contexts below. There is also a specification that defines a "webgl
" context. [WEBGL]Returns null if the given context ID is not supported, if the canvas has already been initialised with the other context type (e.g. trying to get a "
2d
" context after getting a "webgl
" context).reference -> https://html.spec.whatwg.org/multipage/scripting.html#dom-canvas-getcontext
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
85 | HTML5 강좌 9강 - HTML5 태그 - canvas 다각형 | 황제낙엽 | 2016.12.03 | 52 |
84 | HTML5 강좌 8강 - HTML5 태그 - canvas 선그리기 | 황제낙엽 | 2016.12.03 | 51 |
83 | HTML5 강좌 7강 - HTML5 태그 - canvas 사각형 | 황제낙엽 | 2016.12.03 | 38 |
82 | HTML5 강좌 6강 - HTML5 태그 - canvas #1 | 황제낙엽 | 2016.12.03 | 133 |
81 | HTML5 강좌 5강 - HTML5 태그 - prograss,download | 황제낙엽 | 2016.12.03 | 66 |
80 | HTML5 강좌 4강 - HTML5 태그 - mark,time,meter | 황제낙엽 | 2016.12.03 | 61 |
79 | HTML5 강좌 3강 - HTML5 레이아웃 잡아보기 | 황제낙엽 | 2016.12.03 | 51 |
78 | HTML5 강좌 2강 - HTML5 시맨틱웹을 위한 구성요소 | 황제낙엽 | 2016.12.03 | 246 |
77 | HTML5 강좌 1강 - HTML5 개념 및 기본구조 | 황제낙엽 | 2016.12.03 | 59 |
76 | HTTP 오류 코드의 종류 | 황제낙엽 | 2016.12.01 | 77 |
75 | Multiple Canvas Layer 예제 | 황제낙엽 | 2016.08.23 | 31 |
» | Canvas 개요 | 황제낙엽 | 2016.08.22 | 69 |
73 | Canvas 확대 | 황제낙엽 | 2016.08.22 | 64 |
72 | Canvas setTransform 함수 | 황제낙엽 | 2016.08.22 | 69 |
71 | Canvas 회전 | 황제낙엽 | 2016.08.22 | 71 |
70 | Canvas 영역 선택 | 황제낙엽 | 2016.08.22 | 77 |
69 | Canvas CanvasRenderingContext2D Context 속성 | 황제낙엽 | 2016.08.22 | 19 |
68 | Canvas 도형의 클릭 이벤트 처리 | 황제낙엽 | 2016.08.22 | 263 |
67 | Canvas 이미지 추출 | 황제낙엽 | 2016.08.22 | 122 |
66 | Canvas 더블버퍼링 | 황제낙엽 | 2016.08.22 | 195 |