Brenton Strine
The Canvas Element
Slide Duration:Table of Contents
Section 1: HTML
Your First Web Page
17m 1s
- Intro0:00
- World Wide Web0:23
- Introduction to HTML0:25
- Looking at Source Code0:53
- HTML51:58
- HTML5 Specification1:59
- Creating a Web Page4:10
- What You Will Need to Create a Web Page4:11
- Example: Basic Web Page4:40
- Example: Creating a Web Page5:46
- HTML Elements6:33
- Adding a Title7:08
- Main Body7:48
- First Level Heading8:23
- Adding an Image8:42
- Paragraph9:09
- Adding a List and URLs11:13
- Footer14:09
- CSS: Styling16:02
Web Basics and Web History
32m 23s
- Intro0:00
- The Web0:56
- Overview of the Web0:58
- The Web Page2:39
- Overview of the Web Page2:40
- Web Technologies4:45
- Overview of Web Technologies4:46
- The Web Today9:22
- The Web Today9:23
- What is HTML11:22
- HyperText Markup Language11:23
- The Creation of the Internet12:40
- History of the Internet12:41
- Developments in HTML14:10
- The Birth of HTML14:11
- Early Problems15:35
- Early Browsers16:24
- History of Early Browsers16:25
- NCSA Mosaic17:55
- NCSA Mosaic17:56
- The Browser Wars Begin19:39
- History of the Browser Wars19:40
- Casualties of War22:27
- Results of the Browser Wars22:28
- HTML 4 Stabilization25:31
- History and Overview of HTML425:32
- Modern Browser Developments27:27
- Modern Browsers27:29
- HTML530:57
- Overview of HTML530:58
Web Development Tools
26m 28s
- Intro0:00
- Browsers0:17
- Introduction to Browsers0:18
- Example: Browsers2:35
- Firefox Add-ons3:14
- Firefox Browser3:15
- Example: Firebug Add-ons3:54
- Example: Web Developer Toolbar and ColorZilla7:51
- Domain Names and Hosting10:23
- Overview of Domain Names and Hosting10:24
- Your Own Domain11:03
- Installing a Local Web Server12:42
- Installing a Local Web Server12:43
- Apache Web13:29
- WYSIWYG Editors15:56
- Introduction to WYSIWYG Editors15:57
- Content Management System18:31
- How Content Management System Works18:32
- Example: WordPress20:00
- File Transfer Protocol22:26
- File Transfer Protocol22:27
HTML Elements and Attributes
21m 50s
- Intro0:00
- Proper use of Elements and Attributes0:14
- Elements and Attributes0:16
- Example1:06
- Normal HTML Elements2:00
- Start Tag, Content, and End Tag2:02
- Example: Warning!2:34
- Void HTML Elements3:23
- Self-Closing Tags3:24
- List of Void Elements4:04
- Example: Line Break5:00
- HTML Comments6:13
- Purpose of Comment Tags6:14
- Example: Comment Tags6:50
- Attributes7:25
- Properties of Attributes7:27
- Example: Attributes7:39
- Example: Whitespace10:22
- HTML Character Codes12:05
- Character References12:07
- Example: Registered Trademark Symbol12:35
- Example: Using Character References13:23
- Example: Start Tag and End Tag15:57
- Example: Self-Closing Tag16:37
- Example: Attributes17:37
- Example: Proper use of Elements and Attributes19:02
- Example: Comment20:09
- Example: Whitespace20:46
Essential Tags Part 1
41m 42s
- Intro0:00
- Document Structure Tags1:13
- Document Structure Tags and Example1:14
- Layout Tags3:24
- Layout Tags3:26
- Example: Layout Tags7:48
- Example: Layout Tags11:28
- Example: Layout Tags13:17
- Example: Layout Tags14:22
- Text Level Tags17:22
- Text Level Tags17:23
- Example: Text Level Tags17:48
- Grouping Content Tags24:23
- Grouping Content Tags24:24
- <p> Tag24:45
- <hr> Tag25:31
- <figure>, <figcaption>, and <blockquote> Tag26:14
- <div> Tag26:58
- Example: Grouping Content Tags27:28
- Embedded Content Tags33:12
- Embedded Content Tags33:13
- Example: Embedded Content Tags35:39
Essential Tags Part 2
24m 20s
- Intro0:00
- Simple Tables0:17
- Simple Tables0:19
- Example: Simple Tables2:31
- Semantic Tables5:11
- Semantic Tables5:14
- Example: Semantic Tables6:24
- Simple Lists8:14
- Simple Lists8:18
- Unordered List8:36
- Ordered List8:42
- Example: Simple Lists9:37
- Definition Lists14:08
- Definition Lists14:09
- Example: Definition Lists15:21
- Forms17:11
- Forms17:12
- Example: Forms17:52
Markup Language
29m 38s
- Intro0:00
- HTML 1 Through 3.20:13
- Period of Rapid Growth of HTML0:14
- Tag Soup2:03
- Definition of Tag Soup2:04
- Example: Tag Soup3:00
- Example: Tag Soup and Valid Doctype4:45
- HTML 4.015:26
- Overview of HTML 4.015:27
- Three Flavors of HTML 4.01: Strict, Transitional, and Frameset6:05
- XHTML 17:19
- Overview of XHTML 17:20
- Example: XHTML 19:20
- XHTML1 Syntax11:48
- Lower Case Rule11:49
- Closed Elements Rule12:25
- Encased in Quotes Rule14:18
- Boolean Attributes May Not Be Minimized14:35
- Correct Nesting is Enforced15:29
- The Problem with XHTML16:15
- Problem with XHTML16:16
- XHTML 219:22
- Overview of XHTML 219:23
- HTML 520:43
- Overview of HTML 520:44
- Validating22:44
- Validators22:45
- Example: W3C Markup Validation Service25:26
Page Structure and Meta-data Elements
32m 50s
- Intro0:00
- The Doctype0:12
- Doctype0:13
- Example: Doctype1:25
- The Root Element1:57
- Root Element1:58
- Example: Root Element2:45
- The Head Element3:38
- Head Element and Body Element3:39
- Example: Head Element and Body Element5:06
- The Head Element5:42
- Head Element vs. Header Element5:47
- The Title Element6:51
- Title Element6:52
- Example: Title Element7:54
- The Base Element9:00
- Base Element9:03
- Example: Base Element9:42
- The Link Element14:07
- Link Element: rel, type, and href14:08
- Example: Link Element15:13
- The Meta Element17:54
- Meta Element: charset, name, and http-equiv17:55
- Example: Meta Element21:00
- The Style Element23:35
- Style Element23:37
- Example: Style Element24:40
Text-Level Semantics
30m 13s
- Intro0:00
- Text Level Semantics0:06
- Paragraph Level0:07
- The <a> Element2:23
- Definition of the <a> Element2:25
- The <em> Element3:25
- Definition of the <em> Element3:26
- The <strong> Element6:50
- The <strong> Element6:51
- The <small> Element8:35
- The <small> Element8:36
- Example of <small> Element10:19
- The <cite> Element10:55
- The <cite> Element10:56
- Example of <cite> Element12:32
- The <q> Element12:45
- The <q> Element12:46
- Example of <q> Element13:34
- The <abbr> Element15:35
- The <abbr> Element15:36
- Example of <abbr> Element16:41
- The <dfn> Element17:03
- The <dfn> Element17:04
- Example of <dfn> Element18:01
- The <time> Element19:11
- The <time> Element and Example19:12
- The <code> Element21:18
- The <code> Element21:19
- Example of <code> Element23:00
- The <sub> and <sup> Elements23:31
- The <sub> and <sup> Elements23:32
- Example of <sub> and <sup> Elements23:50
- The <i> Element24:51
- The <i> Element and Example24:52
- The <b> Element27:16
- The <b> Element27:17
- Example of <b> Element29:07
Heading and Sectioning
23m 39s
- Intro0:00
- Heading Elements0:06
- Heading Tags0:07
- Heading Rules1:13
- Heading Rules and Example1:35
- Sectioning Roots5:39
- Sectioning Roots5:41
- Sectioning Contents6:25
- Sectioning Content Elements6:27
- Section Wrapping7:40
- Section Wrapping7:41
- Example: Section Wrapping10:10
- Real World Example 115:36
Forms
47m 51s
- Intro0:00
- Form Terminology0:23
- Form0:24
- Control0:43
- Control Name and Control Label1:09
- Input Type and State1:52
- Form Controls2:20
- Button: Submit and Reset2:32
- Radio3:37
- Checkbox4:00
- Select Menu4:05
- Textarea4:28
- Various Input Types4:38
- Example: Basic Controls of Form Element7:05
- Example: Buttons18:20
- Example: Additional Controls20:56
- Example: Special Input Types27:55
- Example: Date and Time Control33:40
- Example: Create Your Own Control37:32
- Example: Placeholder Text39:10
- Example: Datalist41:43
- Example: Sizing and Input Containment42:16
- Example: Select Modification42:51
- Example: Required Attribute44:41
Links
36m 41s
- Intro0:00
- URIs and URLs0:23
- Definitions of URL and URI0:36
- Differences Between URL and URI0:42
- Example: URI and URL1:14
- Typical URI Construction2:33
- Domain and Subdomain2:34
- Protocol4:18
- IP Address5:05
- Typical URI Construction5:32
- Second Level Domain5:33
- Port6:07
- Foldernames6:46
- Typical URI Construction8:06
- Filename and File Extension8:08
- Typical URI Construction10:38
- Name/ Value Pairs10:40
- Internal Anchors11:45
- Typical URI Construction12:30
- Example: URI Construction12:31
- Relative and Absolute URIs14:20
- Relative and Absolute URIs14:22
- Example: Relative and Absolute URIs18:32
- Link States24:15
- Link States24:16
- Example: Link States25:18
- Block Level Links27:02
- Example: Block Level Links27:03
- Bookmark Links29:18
- Bookmark Links29:20
- Example: Bookmark Links30:15
- Attributes32:06
- href and target32:20
- rel, media, hreflang, and type33:18
Embedded Content
46m 5s
- Intro0:00
- Embedding Image0:22
- Embedding an Image0:25
- Image File Formats3:38
- Image Format: Jpg3:42
- Image Format: Png4:13
- Image Format: Gif4:40
- Compression6:05
- Image Format: Precise Lines and Fewer Colors8:38
- Animated Gif10:49
- Alpha Transparency Png11:09
- Embedding Audio12:52
- Old Way of Embedding Audio13:00
- New Way of Embedding Audio14:54
- Example: Adding Buttons20:04
- Message for Users26:36
- Audio Attributes27:46
- Control28:29
- Autoplay28:44
- Loop29:36
- Preload30:40
- Embedding Video32:00
- Embedding Video32:11
- Controls34:22
- Poster Attributes36:01
- Video Formats37:36
- Solving Formatting Problem39:26
The Canvas Element
19m 25s
- Intro0:00
- Creating the Element0:38
- What is the Canvas Element?0:39
- HTML and Canvas Element1:48
- Example: Canvas Element3:23
- Creating the Canvas in JavaScript5:13
- getContext() Method5:17
- Checking Browser Support with the getContext() Method6:00
- Example: Creating the Canvas in JavaScript7:31
- Drawing in the Canvas10:13
- Methods for Drawing in the Canvas10:14
- 2d Context10:58
- Example: Creating Drawing in the Canvas11:39
- Example: Adding an Image and Texts15:30
- Example: Advance Canvas Element17:31
Content Models
29m 8s
- Intro0:00
- The HTML 4.01 Content Model0:16
- Block Elements and Inline Elements0:18
- Example: Block Elements and Inline Elements1:18
- W3C Markup Validation Service3:28
- The HTML5 Content Model6:21
- Overview of HTML5 New Content Categories6:22
- Flow Content8:02
- Specification for Content Models8:05
- Flow Content9:41
- Example: Flow Content Elements10:40
- List of Flow Content11:35
- BlockQuote Element11:50
- Sectioning Content13:19
- Introduction to Sectioning Content13:20
- Heading Content14:06
- Heading Content and hgroup Element14:07
- Phrasing Content16:56
- Attributes of Phrasing Content16:57
- Anchor Element in Phrasing Content17:28
- Embedded Content19:33
- Attributes of Embedded Content19:34
- No Content19:53
- Transparent Content20:38
- Source Elements and Param Elements21:15
- Interactive Content24:16
- Interactive Content Elements24:17
- Button Element25:57
The DOM
13m 10s
- Intro0:00
- The DOM0:26
- Document Object Model0:27
- The DOM Tree0:55
- DOM Trees0:56
- Example: DOM Tree1:31
- Vocabulary: Tree, Node,Branch, Parent, Child2:15
- Exploring the DOM3:13
- Example: Built-in Browser Inspection and Firebug3:15
- Example: Manually Exploring the DOM6:01
- JavaScript7:28
- DOM Navigation Techniques7:55
- DOM Navigation Techniques7:56
Favicons
13m 14s
- Intro0:00
- Favorite Icons0:08
- Function of Favorite Icons0:09
- Bowser Support1:10
- Browser Support1:13
- Location in Browsers1:46
- Implementation Methods2:04
- Implementation Methods for Favorite Icons2:05
- Favicon and Apple Mobile Devices4:51
- Creating the Icon6:13
- How to Create the Icon6:14
- Favicon Resources9:10
- Websites for Icon Creation and Conversion9:11
- Programs for Icon Creation and Conversion11:50
Embedding Flash and Other Objects
15m 7s
- Intro0:00
- Flash and other Plug-ins0:41
- Main Problems with Flash0:44
- Benefits of Flash2:02
- Embedding Flash: the Old Way2:57
- The Old Way to Embed Flash2:58
- Embedding Flash: the Satay Method6:42
- Satay Method6:43
- Embedding Flash: HTML59:28
- How to Embed Flash in HTML59:29
- Embedding Flash Directly in <video>11:39
- Embedding Flash Directly in Video Element11:40
- Review of Embedding13:24
- Image Elements13:39
- Video, Audio, and Canvas Elements13:44
- Embed Elements13:53
- Object Elements14:04
Offline Cache
19m 53s
- Intro0:00
- Purpose0:47
- Purpose of Offline Cache0:48
- The Appache2:06
- Attributes of Appcache2:07
- The Manifest File3:22
- Manifest File3:23
- Example of Manifest3:32
- Section Headers: Cache, Fallback, and Network4:21
- Server-Side Considerations5:17
- text/cache-manifest MIME-type5:18
- Other Server-Side Considerations5:41
- ExpiresActive On and ExpiresDefault 'access'6:07
- Example: Offline Cache 17:44
- Example: Overwriting Files11:09
- Example: Wild Cards for Network14:58
- Example: Offline Cache 216:06
Web Development Principles
26m 47s
- Intro0:00
- Interoperability0:36
- Interoperability of Web Development0:37
- Interoperable Websites Should Work3:05
- Qualities of Interoperable Websites3:06
- Backward Compatibility5:52
- Compatibility With Older Technology5:53
- Example: Meta Tag9:07
- Forward Compatibility9:33
- Advancement in Technology9:34
- Accessibility10:11
- Accessibility of Content10:12
- Semantic Code11:43
- Example: Where Will This Link Take You?13:56
- Graceful Degradation14:59
- Graceful Degradation or Fault Tolerance15:00
- Types of Degradation16:35
- Progressive Enhancement18:36
- Progressive Enhancement18:37
- Future Detection and Browser Sniffing21:05
- Future Detection Versus Browser Sniffing21:06
- Example: Email Input Type23:39
- Tim Berners-Lee's Quote26:20
Loading...
This is a quick preview of the lesson. For full access, please Log In or Sign up.
For more information, please see full course syllabus of HTML
For more information, please see full course syllabus of HTML
HTML The Canvas Element
Lecture Description
In this lesson our instructor talks about the canvas element. He first talks about creating the element. Then he discusses creating the canvas in JavaScript. Finally he talks about methods for drawing in the canvas and some examples.
Bookmark & Share
Embed
Share this knowledge with your friends!
Copy & Paste this embed code into your website’s HTML
Please ensure that your website editor is in text mode when you paste the code.(In Wordpress, the mode button is on the top right corner.)
×
- - Allow users to view the embedded video in full-size.
Next Lecture
Previous Lecture
0 answers
Post by Eric Rapinchuk on May 10, 2012
add this at the top for the pic...
var img = new Image();
img.src = ("nightpan.jpg");
ctx.drawImage(img,0,0);
0 answers
Post by Eric Rapinchuk on May 10, 2012
This code works guys... ;)
<!DOCTYPE html>
<html>
<head>
<title>Canvas</title>
<link rel="stylesheet" href="css.css"></link>
</head>
<body onload="draw()"> <!-- I NEED THIS -->
<h1>Canvas Element</h1>
<p>This isn't an image, it's a canvas.</p>
<canvas id="draw" width="200" height="200">
Sorry, your browser doesn't support the canvas element :(
</canvas>
<script type = "application/javascript">
function draw() { <!-- i needed this?!!?!?!? -->
var paint = document.getElementById("draw");
var ctx = paint.getContext("2d");
ctx.fillStyle = "rgb(200,0,0)";
ctx.fillRect (10, 10, 55, 50);
ctx.fillStyle = "rgba(0, 0, 200, 0.5)";
ctx.fillRect (20, 20, 55, 50);
ctx.fillStyle = "rgba(0,200,0, 0.5)";
ctx.fillRect (30, 30, 55, 50);
ctx.fillStyle = "rgba(0, 0, 200, 0.5)";
ctx.fillRect (40, 40, 55, 50);
ctx.fillStyle = "rgba(200,0,200, 0.5)";
ctx.fillRect (50, 50, 55, 50);
ctx.fillStyle = "rgba(0, 200, 200, 0.5)";
ctx.fillRect (60, 60, 55, 50);
}
<!-- i took the if/else statement out :(-->
</script>
</body>
</html>
0 answers
Post by Richard C. Witt, Jr. on December 13, 2011
Brenton,
I've been able to replicate all the code example except this one. Did you have a CSS style sheet that was being referenced too? The only thing that appeared in my Browser was this:
Canvas Element
This isn't an image, it's a canvas
Nothing other than that appeared. I checked my code to make sure it was what you showed and I tried it in Firefox, Opera. Please advise.
Richard C. Witt
[email protected]
0 answers
Post by Alisher Ulugbekov on January 23, 2011
Very instructive. Thanks Brenton.