1 / 59
文档名称:

Canvas - Telerik:帆布Telerik.ppt

格式:ppt   页数:59页
下载后只包含 1 个 PPT 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

Canvas - Telerik:帆布Telerik.ppt

上传人:薄荷牛奶 2016/1/30 文件大小:0 KB

下载得到文件列表

Canvas - Telerik:帆布Telerik.ppt

相关文档

文档介绍

文档介绍:The CanvasCreating Graphics for the Web Doncho MinkovTelerik Software Academy Technical Trainer of Contents?Overview and usage of the canvas?Drawing shapes?Rectangles, arcs and ellipses?Lines, paths and Bézier curves?Per-pixel manipulationsTable of Contents (2)?Canvas styles?fillColor and strokeColor?Gradients, patterns and shadows?Transformations?Save and restore context state?TranslateThe CanvasThe Canvas?The Canvas is the way to draw in the browser?Uses JavaScript for the drawing?Enables high-performance drawing?The Canvas is part of the HTML5 specification?Supported in most browsers?Both desktop and mobileUsing the Canvas?The Canvas is a rectangular sheet?All the drawing is done inside this sheet?The canvas consists of:?<canvas> HTML element?JavaScript API for the drawing<canvas id="the-canvas" width="100" height="100" />var canvas = ("the-canvas");varcanvasCtx = ("2d");(10, 10, 30, 30);Set width and heightThe Canvas Context?The canvas HTML element provides many ways for drawing?Rectangular 2d drawing?3d drawing?WebGL drawing?HTML5 provides APIs for all these types of drawing?The way to use a specific canvas API is to get the corresponding contextUsing the CanvasLive DemoDrawing ShapesCanvas Shapes?The Canvas provides ways to draw all kinds of shapes?Rects, arcs, ellipses, lines, etc…?Each of these shapes can be either?Drawn in full color (. filled)?Drawn only their border (. stroked)var canvas = ("the-canvas");varcanvasCtx = ("2d");(10, 10, 25, 25);(10, 10, 25, 25);