未验证 提交 77161961 编写于 作者: O openharmony_ci 提交者: Gitee

!23620 cameraFramework ArkTs整改

Merge pull request !23620 from 章超123/master
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
```ts ```ts
import camera from '@ohos.multimedia.camera'; import camera from '@ohos.multimedia.camera';
import type { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
import type featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
``` ```
2. 通过getCameraManager()方法,获取cameraManager对象。 2. 通过getCameraManager()方法,获取cameraManager对象。
......
...@@ -11,7 +11,7 @@ Metadata主要是通过一个TAG(Key),去找对应的Data,用于传递 ...@@ -11,7 +11,7 @@ Metadata主要是通过一个TAG(Key),去找对应的Data,用于传递
1. 导入相关接口,导入方法如下。 1. 导入相关接口,导入方法如下。
```ts ```ts
import camera from '@ohos.multimedia.camera'; import camera from '@ohos.multimedia.camera';
import type { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
``` ```
2. 调用CameraOutputCapability类中的supportedMetadataObjectTypes()方法,获取当前设备支持的元数据类型,并通过createMetadataOutput()方法创建元数据输出流。 2. 调用CameraOutputCapability类中的supportedMetadataObjectTypes()方法,获取当前设备支持的元数据类型,并通过createMetadataOutput()方法创建元数据输出流。
......
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
[各类Context的获取方式](../application-models/application-context-stage.md) [各类Context的获取方式](../application-models/application-context-stage.md)
```ts ```ts
import camera from '@ohos.multimedia.camera'; import camera from '@ohos.multimedia.camera';
import type { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
import image from '@ohos.multimedia.image'; import image from '@ohos.multimedia.image';
import type featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
async function cameraModeCase(context: featureAbility.Context, surfaceId: string): Promise<void> { async function cameraModeCase(context: featureAbility.Context, surfaceId: string): Promise<void> {
// 创建CameraManager对象 // 创建CameraManager对象
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
```js ```js
import camera from '@ohos.multimedia.camera'; import camera from '@ohos.multimedia.camera';
import type featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
async function preview(context: featureAbility.Context, cameraInfo: camera.CameraDevice, previewProfile: camera.Profile, photoProfile: camera.Profile, surfaceId: string): Promise<void> { async function preview(context: featureAbility.Context, cameraInfo: camera.CameraDevice, previewProfile: camera.Profile, photoProfile: camera.Profile, surfaceId: string): Promise<void> {
const cameraManager: camera.CameraManager = camera.getCameraManager(context); const cameraManager: camera.CameraManager = camera.getCameraManager(context);
...@@ -85,9 +85,9 @@ async function preview(context: featureAbility.Context, cameraInfo: camera.Camer ...@@ -85,9 +85,9 @@ async function preview(context: featureAbility.Context, cameraInfo: camera.Camer
[各类Context的获取方式](../application-models/application-context-stage.md) [各类Context的获取方式](../application-models/application-context-stage.md)
```js ```js
import camera from '@ohos.multimedia.camera'; import camera from '@ohos.multimedia.camera';
import type { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
import image from '@ohos.multimedia.image'; import image from '@ohos.multimedia.image';
import type featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
async function enableQuickThumbnail(context: featureAbility.Context, surfaceId: string, photoProfile: camera.Profile): Promise<void> { async function enableQuickThumbnail(context: featureAbility.Context, surfaceId: string, photoProfile: camera.Profile): Promise<void> {
let cameraManager: camera.CameraManager = camera.getCameraManager(context); let cameraManager: camera.CameraManager = camera.getCameraManager(context);
...@@ -154,8 +154,8 @@ function showOrSavePicture(pixelMap: image.PixelMap): void { ...@@ -154,8 +154,8 @@ function showOrSavePicture(pixelMap: image.PixelMap): void {
```js ```js
import camera from '@ohos.multimedia.camera'; import camera from '@ohos.multimedia.camera';
import type { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
import type featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
function preLaunch(context: featureAbility.Context): void { function preLaunch(context: featureAbility.Context): void {
let cameraManager: camera.CameraManager = camera.getCameraManager(context); let cameraManager: camera.CameraManager = camera.getCameraManager(context);
...@@ -176,8 +176,8 @@ function showOrSavePicture(pixelMap: image.PixelMap): void { ...@@ -176,8 +176,8 @@ function showOrSavePicture(pixelMap: image.PixelMap): void {
```js ```js
import camera from '@ohos.multimedia.camera'; import camera from '@ohos.multimedia.camera';
import type { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
import type featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
function setPreLaunchConfig(context: featureAbility.Context): void { function setPreLaunchConfig(context: featureAbility.Context): void {
let cameraManager: camera.CameraManager = camera.getCameraManager(context); let cameraManager: camera.CameraManager = camera.getCameraManager(context);
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
```ts ```ts
import camera from '@ohos.multimedia.camera'; import camera from '@ohos.multimedia.camera';
import type { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
``` ```
2. 创建Surface。 2. 创建Surface。
......
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
[各类Context的获取方式](../application-models/application-context-stage.md) [各类Context的获取方式](../application-models/application-context-stage.md)
```ts ```ts
import camera from '@ohos.multimedia.camera'; import camera from '@ohos.multimedia.camera';
import type { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
import media from '@ohos.multimedia.media'; import media from '@ohos.multimedia.media';
import type featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
async function videoRecording(context: featureAbility.Context, surfaceId: string): Promise<void> { async function videoRecording(context: featureAbility.Context, surfaceId: string): Promise<void> {
// 创建CameraManager对象 // 创建CameraManager对象
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
1. 导入media模块。创建拍照输出流的SurfaceId以及拍照输出的数据,都需要用到系统提供的[media接口](../reference/apis/js-apis-media.md)能力,导入media接口的方法如下。 1. 导入media模块。创建拍照输出流的SurfaceId以及拍照输出的数据,都需要用到系统提供的[media接口](../reference/apis/js-apis-media.md)能力,导入media接口的方法如下。
```ts ```ts
import type { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
import media from '@ohos.multimedia.media'; import media from '@ohos.multimedia.media';
``` ```
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
```ts ```ts
import camera from '@ohos.multimedia.camera'; import camera from '@ohos.multimedia.camera';
import type { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
import type featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
``` ```
2. 调用cameraManager类中的createCaptureSession()方法创建一个会话。 2. 调用cameraManager类中的createCaptureSession()方法创建一个会话。
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
```ts ```ts
import image from '@ohos.multimedia.image'; import image from '@ohos.multimedia.image';
import camera from '@ohos.multimedia.camera'; import camera from '@ohos.multimedia.camera';
import type { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
``` ```
2. 获取SurfaceId。 2. 获取SurfaceId。
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册