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
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
31 | div와 span의 차이점 (from Bing) | 황제낙엽 | 2023.06.16 | 82 |
30 | iframe 다루기 | 황제낙엽 | 2017.02.27 | 1821 |
29 |
Multiple Canvas Layer 예제
![]() | 황제낙엽 | 2016.08.23 | 128 |
» | Canvas 개요 | 황제낙엽 | 2016.08.22 | 177 |
27 |
Canvas 확대
![]() | 황제낙엽 | 2016.08.22 | 136 |
26 | Canvas setTransform 함수 | 황제낙엽 | 2016.08.22 | 148 |
25 |
Canvas 회전
![]() | 황제낙엽 | 2016.08.22 | 152 |
24 |
Canvas 영역 선택
![]() | 황제낙엽 | 2016.08.22 | 141 |
23 | Canvas CanvasRenderingContext2D Context 속성 | 황제낙엽 | 2016.08.22 | 91 |
22 | Canvas 도형의 클릭 이벤트 처리 | 황제낙엽 | 2016.08.22 | 351 |
21 | Canvas 이미지 추출 | 황제낙엽 | 2016.08.22 | 202 |
20 | Canvas 더블버퍼링 | 황제낙엽 | 2016.08.22 | 281 |
19 |
Canvas 비트맵 그리기
![]() | 황제낙엽 | 2016.08.22 | 124 |
18 |
Canvas 그라디언트 그리기
![]() | 황제낙엽 | 2016.08.22 | 141 |
17 |
Canvas 텍스트 그리기
![]() | 황제낙엽 | 2016.08.22 | 102 |
16 |
Canvas 곡선 그리기
![]() | 황제낙엽 | 2016.08.22 | 493 |
15 |
Canvas 다각형 그리기
![]() | 황제낙엽 | 2016.08.22 | 196 |
14 |
Canvas 사각형 그리기
![]() | 황제낙엽 | 2016.08.22 | 141 |
13 |
Canvas 시작하기
![]() | 황제낙엽 | 2016.08.22 | 100 |
12 | Vector Markup Language | 황제낙엽 | 2012.12.20 | 117 |