openharmony 鸿蒙 arkts-apis-camera-Aperture

2026-08-25 浏览 (1)

Interface (Aperture)

Aperture继承自ApertureQuery

物理光圈对象。

说明:

  • 本模块首批接口从API version 10开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
  • 本Interface首批接口从API version 24开始支持。

导入模块

import { camera } from '@kit.CameraKit';

getPhysicalAperture24+

getPhysicalAperture(): number

获取当前物理光圈值。

原子化服务API: 从API version 24开始,该接口支持在原子化服务中使用。

系统能力: SystemCapability.Multimedia.Camera.Core

返回值:

类型说明
number当前物理光圈值。

错误码:

以下错误码的详细介绍请参见Camera错误码

错误码ID错误信息
7400102Operation not allowed, the inputDevice or the session is abnormal.
7400103Session not config.

示例:

import { BusinessError } from '@kit.BasicServicesKit';

function getPhysicalAperture(photoSession: camera.PhotoSession): number {
  let aperture = 0.0;
  try {
    aperture = photoSession.getPhysicalAperture();
  } catch (error) {
    // 失败返回错误码error.code并处理。
    let err = error as BusinessError;
    console.error(`The getPhysicalAperture call failed. error code: ${err.code}`);
  }
  return aperture;
}

setPhysicalAperture24+

setPhysicalAperture(aperture: number): void

设置物理光圈值。

原子化服务API: 从API version 24开始,该接口支持在原子化服务中使用。

系统能力: SystemCapability.Multimedia.Camera.Core

参数:

参数名类型必填说明
aperturenumber物理光圈值。

错误码:

以下错误码的详细介绍请参见Camera错误码

错误码ID错误信息
7400102Operation not allowed, the inputDevice or the session is abnormal.
7400103Session not config.

示例:

import { BusinessError } from '@kit.BasicServicesKit';

function setPhysicalAperture(photoSession: camera.PhotoSession, aperture: number): void {
  try {
    photoSession.setPhysicalAperture(aperture);
  } catch (error) {
    // 失败返回错误码error.code并处理。
    let err = error as BusinessError;
    console.error(`The setPhysicalAperture call failed. error code: ${err.code}`);
  }
}

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 capi-oh-camera-capturesession-callbacks

openharmony 鸿蒙 arkts-apis-camera-OIS

openharmony 鸿蒙 capi-oh-camera-camera-devicequeryinfo

openharmony 鸿蒙 capi-oh-camera-camera-frameraterange

openharmony 鸿蒙 capi-oh-camera-camera-outputcapability

openharmony 鸿蒙 arkts-apis-camera-Photo

openharmony 鸿蒙 capi-oh-camera-camera-profile

openharmony 鸿蒙 capi-oh-camera-camera-manager

openharmony 鸿蒙 capi-oh-camera-previewoutput-callbacks

openharmony 鸿蒙 arkts-apis-camera-ManualExposureQuery

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/Ku6572cM