diff --git a/zh-cn/application-dev/reference/apis/js-apis-image.md b/zh-cn/application-dev/reference/apis/js-apis-image.md index 6720c5cbcdd506327ca1bd9fd5e5b9af698563fe..bdb9d82a612fa80c05b9384c9e59082016b1e38d 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-image.md +++ b/zh-cn/application-dev/reference/apis/js-apis-image.md @@ -1,7 +1,5 @@ # 图片处理 -本模块提供图片处理效果,包括通过属性创建PixelMap、读取图像像素数据、读取区域内的图片数据等。 - > **说明:** > 本模块首批接口从API version 6开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 @@ -65,13 +63,8 @@ createPixelMap(colors: ArrayBuffer, options: InitializationOptions, callback: As const color = new ArrayBuffer(96); let bufferArr = new Uint8Array(color); let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } } -image.createPixelMap(color, opts, (error, pixelmap) => { - if(error) { - console.log('Failed to create pixelmap.'); - } else { - console.log('Succeeded in creating pixelmap.'); - } -}) +image.createPixelMap(color, opts, (pixelmap) => { + }) ``` ## PixelMap7+ @@ -2034,11 +2027,17 @@ img.release().then(() =>{ **系统能力:** 以下各项对应的系统能力均为SystemCapability.Multimedia.Image.Core -| 名称 | 默认值 | 描述 | -| --------- | ------ | ---------------- | -| UNKNOWN | 0 | 未知格式。 | -| RGB_565 | 2 | 格式为RGB_565。 | -| RGBA_8888 | 3 | 格式为RGBA_8888。 | +| 名称 | 默认值 | 描述 | +| ---------------- | ------ | ----------------- | +| UNKNOWN7+ | 0 | 未知格式。 | +| RGB_5657+ | 2 | 格式为RGB_565 | +| RGBA_88887+ | 3 | 格式为RGBA_8888。 | +| BGRA_88889+ | 4 | 格式为BGRA_8888。 | +| RGB_8889+ | 5 | 格式为RGB_888。 | +| ALPHA_89+ | 6 | 格式为ALPHA_8。 | +| RGBA_F169+ | 7 | 格式为RGBA_F16。 | +| NV219+ | 8 | 格式为NV21。 | +| NV129+ | 9 | 格式为NV12。 | ## AlphaType9+ @@ -2134,16 +2133,21 @@ PixelMap的初始化选项。 **系统能力:** 以下各项对应的系统能力均为SystemCapability.Multimedia.Image.Core -| 名称 | 默认值 | 说明 | -| ----------------- | ----------------------- | ------------------------ | -| BITS_PER_SAMPLE | "BitsPerSample" | 每个像素比特数。 | -| ORIENTATION | "Orientation" | 图片方向。 | -| IMAGE_LENGTH | "ImageLength" | 图片长度。 | -| IMAGE_WIDTH | "ImageWidth" | 图片宽度。 | -| GPS_LATITUDE | "GPSLatitude" | 图片纬度。 | -| GPS_LONGITUDE | "GPSLongitude" | 图片经度。 | -| GPS_LATITUDE_REF | "GPSLatitudeRef" | 纬度引用,例如N或S。 | -| GPS_LONGITUDE_REF | "GPSLongitudeRef" | 经度引用,例如W或E。 | +| 名称 | 默认值 | 说明 | +| ------------------------ | ----------------------- | ------------------------ | +| BITS_PER_SAMPLE7+ | "BitsPerSample" | 每个像素比特数。 | +| ORIENTATION7+ | "Orientation" | 图片方向。 | +| IMAGE_LENGTH7+ | "ImageLength" | 图片长度。 | +| IMAGE_WIDTH7+ | "ImageWidth" | 图片宽度。 | +| GPS_LATITUDE7+ | "GPSLatitude" | 图片纬度。 | +| GPS_LONGITUDE7+ | "GPSLongitude" | 图片经度。 | +| GPS_LATITUDE_REF7+ | "GPSLatitudeRef" | 纬度引用,例如N或S。 | +| GPS_LONGITUDE_REF7+ | "GPSLongitudeRef" | 经度引用,例如W或E。 | +| DateTimeOriginal9+ | "2022:06:02 15:51:35" | 拍摄时间。 | +| ExposureTime9+ | "1/33 sec." | 曝光时间。 | +| SceneType9+ | "Directly photographed" | 拍摄场景,默认直接拍摄。 | +| ISOSpeedRatings9+ | "400" | ISO 曝光度,默认值为400。| +| FNumber9+ | "f/1.8" | 光圈值。 | ## ImageFormat9+