规范原文如下:
The translate(x, y) method must add the translation transformation described by the arguments to the transformation matrix. The x argument represents the translation distance in the horizontal direction and the y argument represents the translation distance in the vertical direction. The arguments are in coordinate space units.
原文见:http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-translate
translate(x,y)函数是将整个canvas水平移动x距离,垂直移动y距离。
canvas是以(0,0)为默认原点,其原点默认在屏幕左上角;通过translate(x,y)把点(x,y)作为原点。
需要注意的是:是在原点的基础上分别偏移x和y。
例子:原点假如落在(1,1),那么translate(10,10)就是在原点(1,1)基础上分别在x轴、y轴移动10,则原点变为(11,11)。
分享到:
相关推荐
jsPdf.debug.js和html2canvas.js下载jsPdf.debug.js和html2canvas.js下载jsPdf.debug.js和html2canvas.js下载jsPdf.debug.js和html2canvas.js下载
html2canvas.min.js的源码,方便大家下载
讲解使用canvas.save()和canvas.restore()的demo
html2canvas.js 和html2canvas.min.js 以及应用示例
可以是用来在网页上面截屏的代码:html2canvas.js;基于html2canvas实现网页保存为图片。
canvas.text.js
html2canvas 页面元素转canvas转图片 fileSaver 文件下载 jszip 文件压缩
html2canvas.js实现整个区域甚至整个页面的截取,再次声明这不是一个小小的头像图片的移动截取(小小的截取就不要下载喽),是整个页面的截取;网页端需要的不多,就是现在不太好找了,所里我整理了一下
flashcanvas.min.js flashcanvas.min.js flashcanvas.min.js flashcanvas.min.js
html2canvas.js下载
使用html2canvas将指定element转成图片,可广泛用于生成宣传海报图,javascript使用方式支持基础js文件
做项目需要用到html2canvas.js和jspdf.debug.js找了好久才找的,先存放在这里如果大家需要也可以下。