物理光圈查询对象。
getSupportedPhysicalApertures(): Array<PhysicalAperture>
获取支持的物理光圈。
元服务API: 从API version 24开始,该接口支持在元服务中使用。
系统能力: SystemCapability.Multimedia.Camera.Core
返回值:
| 类型 | 说明 |
|---|---|
| Array<PhysicalAperture> | 支持的物理光圈数组。 |
错误码:
以下错误码的详细介绍请参见Camera错误码。
| 错误码ID | 错误信息 |
|---|---|
| 7400102 | Operation not allowed, the inputDevice or the session is abnormal. |
| 7400103 | Session not config. |
示例:
import { BusinessError } from '@kit.BasicServicesKit';
function getSupportedPhysicalApertures(photoSession: camera.PhotoSession): Array<camera.PhysicalAperture> {
let apertures: Array<camera.PhysicalAperture> = [];
try {
apertures = photoSession.getSupportedPhysicalApertures();
} catch (error) {
// 失败返回错误码error.code并处理。
let err = error as BusinessError;
console.error(`The getSupportedPhysicalApertures call failed. error code: ${err.code}`);
}
return apertures;
}