1
0
forked from dyf/APP

修复蓝牙传输数据

This commit is contained in:
微微一笑
2025-10-31 15:35:03 +08:00
parent 3eeffdb62c
commit 3526f28d06

View File

@ -1,6 +1,6 @@
<template> <template>
<view> <view>
<canvas type="2d" canvas-id="reusableCanvas" :width="currentCanvasWidth" :height="currentCanvasHeight" <canvas canvas-id="reusableCanvas" :width="currentCanvasWidth" :height="currentCanvasHeight"
class="offscreen-canvas"></canvas> class="offscreen-canvas"></canvas>
</view> </view>
</template> </template>
@ -149,7 +149,6 @@
// 5. 异步绘制并获取像素数据(串行处理避免冲突) // 5. 异步绘制并获取像素数据(串行处理避免冲突)
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
ctx.draw(false, () => { ctx.draw(false, () => {
setTimeout(() => {
uni.canvasGetImageData({ uni.canvasGetImageData({
canvasId: 'reusableCanvas', canvasId: 'reusableCanvas',
x: 0, x: 0,
@ -170,7 +169,6 @@
reject(err) reject(err)
} }
}); });
}, 100);
}); });
}); });
@ -202,6 +200,5 @@
position: fixed; position: fixed;
left: -9999px; left: -9999px;
top: -9999px; top: -9999px;
visibility: hidden;
} }
</style> </style>