中国优质的IT技术网站
专业IT技术创作平台
IT职业在线教育平台
微信扫码分享
import { BusinessError } from '@kit.BasicServicesKit'; async function CreatePixelMap() { const color: ArrayBuffer = new ArrayBuffer(96); let opts: image.InitializationOptions = { editable: true, pixelFormat: image.PixelMapFormat.RGBA_8888, size: { height: 4, width: 6 } } image.createPixelMap(color, opts, (error: BusinessError, pixelMap: image.PixelMap) => { if (error) { console.error(`Failed to create pixelmap. code is \${error.code}, message is \${error.message}`); return; } else { console.info('Succeeded in creating pixelmap.'); } }) }