Created
May 25, 2018 08:51
-
-
Save zhangkn/00ef54ed416e24511551706e54b66008 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var image = wx.createImage() | |
// 设置 Image 对象的 src 属性可以加载一张本地图片或网络图片,当图片加载完毕时会执行注册的 onload 回调函数,此时可以将 Image 对象绘制到 Canvas 上。 | |
image.onload = function () { | |
console.log(image.width, image.height) | |
context.drawImage(image, 0, 0) | |
} | |
image.src = 'logo.png' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment