可以通过将buffer转为PixelMap,然后再加载,示例:let imageSource = image.createImageSource(buffer) let options = {alphaType: 0, // 透明度 editable: false, // 是否可编辑 pixelFormat: 3, // 像素格式 scaleMode: 1, // 缩略值 size: {height: 100, width: 100}} // 创建图片大小 imageSource.createPixelMap(options).then((pixelMap) => { this.image = pixelMap })
可以通过将buffer转为PixelMap,然后再加载,示例: