提交 ea706e8f 编写于 作者: D DCloud_LXH

fix(App): putImageData

上级 85051832
...@@ -446,15 +446,15 @@ export default { ...@@ -446,15 +446,15 @@ export default {
callbackId callbackId
}) { }) {
try { try {
if (__PLATFORM__ === 'app-plus' && compressed) {
const pako = require('pako')
data = pako.inflateRaw(data)
}
if (!height) { if (!height) {
height = Math.round(data.length / 4 / width) height = Math.round(data.length / 4 / width)
} }
const canvas = getTempCanvas(width, height) const canvas = getTempCanvas(width, height)
const context = canvas.getContext('2d') const context = canvas.getContext('2d')
if (__PLATFORM__ === 'app-plus' && compressed) {
const pako = require('pako')
data = pako.inflateRaw(data)
}
context.putImageData(new ImageData(new Uint8ClampedArray(data), width, height), 0, 0) context.putImageData(new ImageData(new Uint8ClampedArray(data), width, height), 0, 0)
this.$refs.canvas.getContext('2d').drawImage(canvas, x, y, width, height) this.$refs.canvas.getContext('2d').drawImage(canvas, x, y, width, height)
canvas.height = canvas.width = 0 canvas.height = canvas.width = 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册