canvas>`元素的`drawImage()`方法:
```javascript
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
var img = document.getElementById('image');
ctx.drawImage(img, 0, 0);
```
2. 使用`<img>`元素的`getImageData()`方法:
```javascript
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
var img = document.getElementById('image');
var imageData = img.getImageData(0, 0, img.width, img.height);
ctx.putImageData(imageData, 0, 0);
```