从文件创建图片。
文件路径。
异步的Image对象。
const result = await createImageFromFile('/path/to/image.png');if (result.isOk()) { const img = result.unwrap(); console.log('图片尺寸:', img.width, 'x', img.height);} Copy
const result = await createImageFromFile('/path/to/image.png');if (result.isOk()) { const img = result.unwrap(); console.log('图片尺寸:', img.width, 'x', img.height);}
从文件创建图片。