摘要: ###在canvas中的像素操作 到目前为止,我们尚未深入了解Canvas画布真实像素的原理,事实上, 你可以直接通过ImageData对象操纵像素数据,直接读取或将数据数组写入该对象中 ###得到场景像素数据 getImageData():获得一个包含画布场景像素数据的ImageData对像,它代 阅读全文
posted @ 2019-11-10 16:46 distant-遥远 阅读(504) 评论(0) 推荐(0)
摘要: ##在canvas中绘制文本 canvas 提供了两种方法来渲染文本: fillText(text, x, y) 在指定的(x,y)位置填充指定的文本 strokeText(text, x, y) 在指定的(x,y)位置绘制文本边框 <!DOCTYPE html> <html> <head> <me 阅读全文
posted @ 2019-11-10 11:46 distant-遥远 阅读(669) 评论(0) 推荐(0)
摘要: ##在canvas中插入图片(需要image对象) 1.canvas操作图片时,必须要等图片加载完才能操作 2.drawImage(image, x, y, width, height) 其中 image 是 image 或者 canvas 对象,x 和 y 是其在目标 canvas 里的起始坐标。 阅读全文
posted @ 2019-11-10 11:28 distant-遥远 阅读(7829) 评论(0) 推荐(0)