HarmonyOS 自定义相机拍完照后保存图片相关问题
根据demo里面的代码,自定义相机拍完照后直接保存图片,然后将图片路径作为参数在页面跳转时一起传入新的页面。应该如何修改demo的代码?
import { abilityAccessCtrl, PermissionRequestResult, Permissions } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
import { promptAction, router } from '@kit.ArkUI';
import { image } from '@kit.ImageKit';
import { photoAccessHelper } from '@kit.MediaLibraryKit';
import { fileIo, } from '@kit.CoreFileKit';
import { camera, cameraPicker } from '@kit.CameraKit';
import { picker } from '@kit.CoreFileKit';
const TAG = '[PhotoDemo]';
@Entry
@Component
export struct scanCustomCamera {
type: cameraPicker.PickerMediaType = cameraPicker.PickerMediaType.PHOTO;
isVideo: boolean = true;
path: string = '';
context: Context = getContext(this) as Context;
@State hasPicture: boolean = false;
@State finalPixelMap: image.PixelMap | undefined = undefined;
// 设置安全控件按钮属性
@State saveButtonOptions: SaveButtonOptions = {
icon: SaveIconStyle.FULL_FILLED,
text: SaveDescription.SAVE_IMAGE,
buttonType: ButtonType.Capsule
}
@State buffer: ArrayBuffer | undefined = undefined;
// 当buffer更新时触发事件
onPictureCaptured(buffer: ArrayBuffer) {
this.buffer = buffer;
return buffer;
}
aboutToAppear(): void {
let permissions: Array<Permissions> = [
'ohos.permission.CAMERA',
'ohos.permission.WRITE_MEDIA',
'ohos.permission.READ_MEDIA',
'ohos.permission.MEDIA_LOCATION',
];
let atManager: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager();
// requestPermissionsFromUser会判断权限的授权状态来决定是否唤起弹窗
atManager.requestPermissionsFromUser(this.context, permissions).then((data: PermissionRequestResult) => {
let grantStatus: Array<number> = data.authResults;
let length: number = grantStatus.length;
for (let i = 0; i < length; i++) {
if (grantStatus[i] != 0) {
// 用户拒绝授权,提示用户必须授权才能访问当前页面的功能,并引导用户到系统设置中打开相应的权限
return;
}
}
console.info(`${TAG} Success to request permissions from user. authResults is ${grantStatus}.`);
}).catch((err: BusinessError) => {
console.error(`${TAG} Failed to request permissions from user. Code is ${err.code}, message is ${err.message}`);
})
}
@State surfaceId: string = '';
@State imageSize: image.Size = { width: 1920, height: 1080 };
@State isface: boolean = false;
@State currentIndex: number = 0;
@State modeBool: boolean = false;
private mXComponentController: XComponentController = new XComponentController;
private cameraManager: camera.CameraManager | undefined = undefined;
private cameraInput: camera.CameraInput | undefined = undefined;
private photoOutput: camera.PhotoOutput | undefined = undefined;
private previewOutput: camera.PreviewOutput | undefined = undefined;
private cameraSession: camera.PhotoSession | undefined = undefined;
build() {
Column() {
//预览框
Column({ space: 10 }) {
if (this.hasPicture) {
Image(this.finalPixelMap)
.objectFit(ImageFit.Fill)
.width('100%')
.height(300)
SaveButton(this.saveButtonOptions)// 创建安全控件按钮
.onClick(
async (event, result: SaveButtonOnClickResult) => {
if (result == SaveButtonOnClickResult.SUCCESS) {
if (this.finalPixelMap) {
try {
// 1、使用安全控件创建文件
let phAccessHelper: photoAccessHelper.PhotoAccessHelper =
photoAccessHelper.getPhotoAccessHelper(this.context);
let options: photoAccessHelper.CreateOptions = {
title: Date.now().toString()
};
// createAsset的调用需要ohos.permission.READ_IMAGEVIDEO和ohos.permission.WRITE_IMAGEVIDEO的权限
let photoUri: string =
await phAccessHelper.createAsset(photoAccessHelper.PhotoType.IMAGE, 'png', options);
console.info('CameraDemo createAsset successfully, photoUri: ' + photoUri);
// 2.通过文件管理写入文件
let file: fileIo.File = fileIo.openSync(photoUri, fileIo.OpenMode.WRITE_ONLY);
fileIo.writeSync(file.fd, this.buffer);
fileIo.closeSync(file);
promptAction.showToast({ message: `保存成功` })
} catch (error) {
let err = error as BusinessError;
console.error(`CameraDemo savePicture error: ${JSON.stringify(err)}`);
promptAction.showToast({ message: `保存失败` })
}
}
} else {
console.error('CameraDemo SaveButtonOnClickResult createAsset failed.');
promptAction.showToast({ message: `保存失败` })
}
setTimeout(() => {
this.hasPicture = false;
this.finalPixelMap = undefined;
}, 1000)
}
)
} else {
Stack() {
XComponent({
id: '',
type: 'surface',
libraryname: '',
controller: this.mXComponentController
})
.onLoad(() => {
// 设置Surface宽高(1920*1080),预览尺寸设置参考previewProfilesArray获取的当前设备所支持的预览分辨率大小去设置
// 预览流与录像输出流的分辨率的宽高比要保持一致
this.mXComponentController.setXComponentSurfaceSize({ surfaceWidth: 1920, surfaceHeight: 1080 });
// 获取Surface ID
this.surfaceId = this.mXComponentController.getXComponentSurfaceId();
setTimeout(async () => {
await this.prepareCamera();
}, 500);
})
.width('100%')
.height('90%')
//相机预览界面提示框
Column() {
Image(this.finalPixelMap)
if (this.modeBool) {
Stack() {
Image($r('app.media.promptBorder'))
.objectFit(ImageFit.Cover)
.height('90%')
Image($r(this.isface ? 'app.media.nationalEmblem' : 'app.media.face'))
.objectFit(ImageFit.Cover)
.height('20%')
.translate({
//改变坐标系位置
x: 90,
y: this.isface ? -150 : 150
})
Button('切换正反面')
.height('20')
.backgroundColor('rgba(24,36,49,0.1)')
.translate({
//改变坐标系位置
y: 230
})
.onClick(() => {
this.isface = !this.isface
})
}
} else {
Image($r('app.media.promptBorder'))
.objectFit(ImageFit.Cover)
.height('90%')
}
}
}
.height('80%')
//底部控制区域
Row() {
Image($r('app.media.takePhoto'))//拍照按钮
.objectFit(ImageFit.Cover)
.width(50)
.onClick(
async () => { //点击此处拍完照后,跳转到图片处理和预览页面,并将拍下的照片传过去
let photoCaptureSetting: camera.PhotoCaptureSetting = {
quality: camera.QualityLevel.QUALITY_LEVEL_HIGH, // 设置图片质量高
rotation: camera.ImageRotation.ROTATION_0 // 设置图片旋转角度0
}
// 1、通过拍照流实现:点击拍照
await this.photoOutput?.capture(photoCaptureSetting).catch((error: BusinessError) => {
console.error(`CameraDemo Failed to capture the photo ${error.message}`); //不符合条件则进入
})
this.hasPicture = true;
async (result: SaveButtonOnClickResult) => {
if (result == SaveButtonOnClickResult.SUCCESS) {
if (this.finalPixelMap) {
try {
let phAccessHelper: photoAccessHelper.PhotoAccessHelper =
photoAccessHelper.getPhotoAccessHelper(this.context);
let options: photoAccessHelper.CreateOptions = {
title: Date.now().toString()
};
let photoUri: string =
await phAccessHelper.createAsset(photoAccessHelper.PhotoType.IMAGE, 'png', options);
console.info('CameraDemo createAsset successfully, photoUri: ' + photoUri);
let file: fileIo.File = fileIo.openSync(photoUri, fileIo.OpenMode.WRITE_ONLY);
fileIo.writeSync(file.fd, this.buffer);
fileIo.closeSync(file);
promptAction.showToast({ message: `保存成功` });
//拍完照后跳转到这个页面
router.pushUrl({
url: "pages/scan_imageHandle",
})
} catch (error) {
let err = error as BusinessError;
console.error(`CameraDemo savePicture error: ${JSON.stringify(err)}`);
promptAction.showToast({ message: `保存失败` });
}
}
} else {
console.error('CameraDemo SaveButtonOnClickResult createAsset failed.');
promptAction.showToast({ message: `保存失败` });
}
setTimeout(() => {
this.hasPicture = false;
this.finalPixelMap = undefined;
}, 1000);
};
router.pushUrl({
url: "pages/scan_imageHandle",
params: { info: this.finalPixelMap }
});
})
}
.justifyContent(FlexAlign.SpaceAround)
.height('50')
.width('100%')
}
}
.backgroundColor(Color.Black)
.width('100%')
.height('100%')
.padding(10)
.borderRadius(8)
}
.width('100%')
.height('100%')
.backgroundColor('#FFFFFF')
}
/*
自定义相机部分,可略过
*/
// 创建CameraManager对象
createCameraManager() {
let cameraManager: camera.CameraManager = camera.getCameraManager(this.context);
if (!cameraManager) {
console.error('CameraDemo camera.getCameraManager error');
return;
}
this.cameraManager = cameraManager;
// 监听相机状态变化
this.cameraManager.on('cameraStatus', (err: BusinessError, cameraStatusInfo: camera.CameraStatusInfo) => {
console.info(`CameraDemo camera: ${cameraStatusInfo.camera.cameraId}, status: ${cameraStatusInfo.status}`);
});
}
// 函数中设置监听photoAvailable,在回调中生成图片
setPhotoOutputCb(photoOutput: camera.PhotoOutput) {
//设置回调之后,调用photoOutput的capture方法,就会将拍照的buffer回传到回调中
photoOutput.on('photoAvailable', (errCode: BusinessError, photo: camera.Photo): void => {
console.info(`CameraDemo getPhoto start. err: ${JSON.stringify(errCode)}`);
if (errCode || photo === undefined || photo.main === undefined) {
console.error('CameraDemo getPhoto failed');
return;
}
let imageObj = photo.main;
imageObj.getComponent(image.ComponentType.JPEG,
async (errCode: BusinessError, component: image.Component): Promise<void> => {
console.info('CameraDemo getComponent start');
if (errCode || component === undefined) {
console.error('CameraDemo getComponent failed');
return;
}
let buffer: ArrayBuffer;
if (component.byteBuffer) {
buffer = component.byteBuffer;
this.buffer = buffer;
let sourceOptions: image.SourceOptions = {
sourceDensity: 0, // 在不确定当前密度时传0
sourcePixelFormat: image.PixelMapFormat.RGBA_8888,
sourceSize: this.imageSize
}
let imageSource: image.ImageSource = image.createImageSource(buffer, sourceOptions);
let opts: image.InitializationOptions = {
editable: false,
pixelFormat: image.PixelMapFormat.RGBA_8888,
size: this.imageSize
}
let pixelMap = await imageSource.createPixelMap(opts);
this.finalPixelMap = pixelMap;
} else {
console.error('CameraDemo byteBuffer is null');
return;
}
});
});
}
//相机准备
async prepareCamera() {
this.createCameraManager();
if (!this.cameraManager) {
console.error('CameraDemo cameraManager is undefined.')
return;
}
// 获取设备支持的相机对象,根据位置可划分后置,前置,折叠态相机
let cameraDevices: Array<camera.CameraDevice> = [];
try {
cameraDevices = this.cameraManager.getSupportedCameras();
} catch (error) {
let err = error as BusinessError;
console.error(`CameraDemo The getSupportedCameras call failed. error: ${JSON.stringify(err)}`)
}
cameraDevices.forEach((cameraDevice: camera.CameraDevice) => {
console.info(`CameraDemo cameraId: ${cameraDevice.cameraId}, cameraPosition: ${cameraDevice.cameraPosition.toString()}, cameraType: ${cameraDevice.cameraType.toString()}, connectionType: ${cameraDevice.connectionType.toString()}`)
})
// 获取设备支持的具体某个相机对象的支持的模式类型,包含普通拍照及普通录像两种模式,cameraDevices[0]代表后置相机
let cameraSceneModes: Array<camera.SceneMode> = [];
try {
cameraSceneModes = this.cameraManager.getSupportedSceneModes(cameraDevices[1]);
cameraSceneModes.forEach((cameraSceneMode: camera.SceneMode) => {
console.info(`CameraDemo cameraSceneMode: ${cameraSceneMode.toString()}`)
})
//判断支持的模式类型是否包含拍照
let isSupportPhotoMode: boolean = cameraSceneModes.indexOf(camera.SceneMode.NORMAL_PHOTO) >= 0;
if (!isSupportPhotoMode) {
console.error('CameraDemo photo mode not support');
return;
}
} catch (error) {
let err = error as BusinessError;
console.error(`CameraDemo The getSupportedSceneModes call failed. error: ${JSON.stringify(err)}`)
}
// 创建相机输入流
try {
this.cameraInput = this.cameraManager.createCameraInput(cameraDevices[0]);
} catch (error) {
let err = error as BusinessError;
console.error(`CameraDemo createCaptureSession error. error: ${JSON.stringify(err)}`);
return
}
// 监听cameraInput错误信息
this.cameraInput.on('error', cameraDevices[1], (error: BusinessError) => {
console.error(`CameraDemo Camera input error: ${JSON.stringify(error)}`);
});
// 打开相机
try {
await this.cameraInput.open();
} catch (error) {
let err = error as BusinessError;
console.error(`CameraDemo cameraInput open error. error: ${JSON.stringify(err)}`);
}
// 获取相机对象支持的输出流能力,包含预览,拍照,录像等信息
let cameraOutputCapability: camera.CameraOutputCapability =
this.cameraManager.getSupportedOutputCapability(cameraDevices[1], camera.SceneMode.NORMAL_PHOTO)
if (!cameraOutputCapability) {
console.error('CameraDemo cameraManager.getSupportedOutputCapability error');
return;
}
//获取当前设备支持的预览能力
let previewProfile = cameraOutputCapability.previewProfiles[0];
//预览流和相片分辨率的宽高比要保持一致
cameraOutputCapability.previewProfiles.forEach((profile) => {
if (profile.size.width == this.imageSize.width && profile.size.height == this.imageSize.height) {
previewProfile = profile;
return;
}
})
this.imageSize = previewProfile.size;
// 创建相机预览输出流
try {
this.previewOutput = this.cameraManager.createPreviewOutput(previewProfile, this.surfaceId);
} catch (error) {
let err = error as BusinessError;
console.error(`CameraDemo createCaptureSession error. error: ${JSON.stringify(err)}`);
return
}
// 监听previewOutput错误信息
this.previewOutput.on('error', (error: BusinessError) => {
console.error(`CameraDemo previewOutput error: ${JSON.stringify(error)}`);
});
try {
//获取当前设备支持的拍照能力
let photoProfile = cameraOutputCapability.photoProfiles[0];
//拍照流和相片分辨率的宽高比要保持一致
cameraOutputCapability.photoProfiles.forEach((profile) => {
if (profile.size.width == this.imageSize.width && profile.size.height == this.imageSize.height) {
photoProfile = profile;
return;
}
})
//创建相机拍照输出流
this.photoOutput = this.cameraManager.createPhotoOutput(photoProfile);
} catch (error) {
let err = error as BusinessError;
console.error(`CameraDemo createPhotoOutput error ${JSON.stringify(err)}`);
}
if (this.photoOutput === undefined) {
console.error('CameraDemo photoOutput is undefined.');
return;
}
//调用自定义函数,在定义的监听的回调中保存图片,该自定义函数需传参拍照输出流
this.setPhotoOutputCb(this.photoOutput);
//创建相机会话
try {
this.cameraSession = this.cameraManager.createSession(camera.SceneMode.NORMAL_PHOTO) as camera.PhotoSession;
} catch (error) {
let err = error as BusinessError;
console.error(`CameraDemo createCaptureSession error. error: ${JSON.stringify(err)}`);
return
}
// 监听session错误信息
this.cameraSession.on('error', (error: BusinessError) => {
console.error(`CameraDemo Capture session error: ${JSON.stringify(error)}`);
});
// 开始配置会话
try {
this.cameraSession.beginConfig()
} catch (error) {
let err = error as BusinessError;
console.error(`CameraDemo beginConfig error. error: ${JSON.stringify(err)}`);
}
// 向会话中添加相机输入流
try {
this.cameraSession.addInput(this.cameraInput)
} catch (error) {
let err = error as BusinessError;
console.error(`CameraDemo addInput error. error: ${JSON.stringify(err)}`);
}
// 向会话中添加预览输出流
try {
this.cameraSession.addOutput(this.previewOutput)
} catch (error) {
let err = error as BusinessError;
console.error(`CameraDemo add previewOutput error. error: ${JSON.stringify(err)}`);
}
// 向会话中添加拍照输出流
try {
this.cameraSession.addOutput(this.photoOutput);
} catch (error) {
let err = error as BusinessError;
console.error(`CameraDemo add photoOutput error. error: ${JSON.stringify(err)}`);
}
// 提交会话配置
try {
await this.cameraSession.commitConfig();
} catch (error) {
let err = error as BusinessError;
console.error(`CameraDemo captureSession commitConfig error: ${JSON.stringify(err)}`);
}
// 启动会话
try {
await this.cameraSession.start();
} catch (error) {
let err = error as BusinessError;
console.error(`CameraDemo captureSession start error: ${JSON.stringify(err)}`);
}
//调用自定义函数,配置相机的参数,传参相机会话
this.configuringSession(this.cameraSession)
}
//配置相机的参数可以调整拍照的一些功能,包括闪光灯、变焦、焦距等
configuringSession(photoSession: camera.PhotoSession): void {
// 判断设备是否支持闪光灯
let flashStatus: boolean = false;
try {
flashStatus = photoSession.hasFlash();
} catch (error) {
let err = error as BusinessError;
console.error(`CameraDemo Failed to hasFlash. error: ${JSON.stringify(err)}`);
}
console.info(`CameraDemo Returned with the flash light support status: ${flashStatus}`);
if (flashStatus) {
// 判断是否支持自动闪光灯模式
let flashModeStatus: boolean = false;
try {
let status: boolean = photoSession.isFlashModeSupported(camera.FlashMode.FLASH_MODE_AUTO);
flashModeStatus = status;
} catch (error) {
let err = error as BusinessError;
console.error(`CameraDemo Failed to check whether the flash mode is supported. error: ${JSON.stringify(err)}`);
}
if (flashModeStatus) {
// 设置自动闪光灯模式
try {
photoSession.setFlashMode(camera.FlashMode.FLASH_MODE_AUTO);
} catch (error) {
let err = error as BusinessError;
console.error(`CameraDemo Failed to set the flash mode. error: ${JSON.stringify(err)}`);
}
}
}
// 判断是否支持连续自动变焦模式
let focusModeStatus: boolean = false;
try {
let status: boolean = photoSession.isFocusModeSupported(camera.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO);
focusModeStatus = status;
} catch (error) {
let err = error as BusinessError;
console.error(`CameraDemo Failed to check whether the focus mode is supported. error: ${JSON.stringify(err)}`);
}
if (focusModeStatus) {
// 设置连续自动变焦模式
try {
photoSession.setFocusMode(camera.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO);
} catch (error) {
let err = error as BusinessError;
console.error(`CameraDemo Failed to set the focus mode. error: ${JSON.stringify(err)}`);
}
}
// 获取相机支持的可变焦距比范围
let zoomRatioRange: Array<number> = [];
try {
zoomRatioRange = photoSession.getZoomRatioRange();
} catch (error) {
let err = error as BusinessError;
console.error(`CameraDemo Failed to get the zoom ratio range. error: ${JSON.stringify(err)}`);
}
if (zoomRatioRange.length <= 0) {
return;
}
// 设置可变焦距比
try {
photoSession.setZoomRatio(zoomRatioRange[0]);
} catch (error) {
let err = error as BusinessError;
console.error(`CameraDemo Failed to set the zoom ratio value. error: ${JSON.stringify(err)}`);
}
}
}
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
- 28.
- 29.
- 30.
- 31.
- 32.
- 33.
- 34.
- 35.
- 36.
- 37.
- 38.
- 39.
- 40.
- 41.
- 42.
- 43.
- 44.
- 45.
- 46.
- 47.
- 48.
- 49.
- 50.
- 51.
- 52.
- 53.
- 54.
- 55.
- 56.
- 57.
- 58.
- 59.
- 60.
- 61.
- 62.
- 63.
- 64.
- 65.
- 66.
- 67.
- 68.
- 69.
- 70.
- 71.
- 72.
- 73.
- 74.
- 75.
- 76.
- 77.
- 78.
- 79.
- 80.
- 81.
- 82.
- 83.
- 84.
- 85.
- 86.
- 87.
- 88.
- 89.
- 90.
- 91.
- 92.
- 93.
- 94.
- 95.
- 96.
- 97.
- 98.
- 99.
- 100.
- 101.
- 102.
- 103.
- 104.
- 105.
- 106.
- 107.
- 108.
- 109.
- 110.
- 111.
- 112.
- 113.
- 114.
- 115.
- 116.
- 117.
- 118.
- 119.
- 120.
- 121.
- 122.
- 123.
- 124.
- 125.
- 126.
- 127.
- 128.
- 129.
- 130.
- 131.
- 132.
- 133.
- 134.
- 135.
- 136.
- 137.
- 138.
- 139.
- 140.
- 141.
- 142.
- 143.
- 144.
- 145.
- 146.
- 147.
- 148.
- 149.
- 150.
- 151.
- 152.
- 153.
- 154.
- 155.
- 156.
- 157.
- 158.
- 159.
- 160.
- 161.
- 162.
- 163.
- 164.
- 165.
- 166.
- 167.
- 168.
- 169.
- 170.
- 171.
- 172.
- 173.
- 174.
- 175.
- 176.
- 177.
- 178.
- 179.
- 180.
- 181.
- 182.
- 183.
- 184.
- 185.
- 186.
- 187.
- 188.
- 189.
- 190.
- 191.
- 192.
- 193.
- 194.
- 195.
- 196.
- 197.
- 198.
- 199.
- 200.
- 201.
- 202.
- 203.
- 204.
- 205.
- 206.
- 207.
- 208.
- 209.
- 210.
- 211.
- 212.
- 213.
- 214.
- 215.
- 216.
- 217.
- 218.
- 219.
- 220.
- 221.
- 222.
- 223.
- 224.
- 225.
- 226.
- 227.
- 228.
- 229.
- 230.
- 231.
- 232.
- 233.
- 234.
- 235.
- 236.
- 237.
- 238.
- 239.
- 240.
- 241.
- 242.
- 243.
- 244.
- 245.
- 246.
- 247.
- 248.
- 249.
- 250.
- 251.
- 252.
- 253.
- 254.
- 255.
- 256.
- 257.
- 258.
- 259.
- 260.
- 261.
- 262.
- 263.
- 264.
- 265.
- 266.
- 267.
- 268.
- 269.
- 270.
- 271.
- 272.
- 273.
- 274.
- 275.
- 276.
- 277.
- 278.
- 279.
- 280.
- 281.
- 282.
- 283.
- 284.
- 285.
- 286.
- 287.
- 288.
- 289.
- 290.
- 291.
- 292.
- 293.
- 294.
- 295.
- 296.
- 297.
- 298.
- 299.
- 300.
- 301.
- 302.
- 303.
- 304.
- 305.
- 306.
- 307.
- 308.
- 309.
- 310.
- 311.
- 312.
- 313.
- 314.
- 315.
- 316.
- 317.
- 318.
- 319.
- 320.
- 321.
- 322.
- 323.
- 324.
- 325.
- 326.
- 327.
- 328.
- 329.
- 330.
- 331.
- 332.
- 333.
- 334.
- 335.
- 336.
- 337.
- 338.
- 339.
- 340.
- 341.
- 342.
- 343.
- 344.
- 345.
- 346.
- 347.
- 348.
- 349.
- 350.
- 351.
- 352.
- 353.
- 354.
- 355.
- 356.
- 357.
- 358.
- 359.
- 360.
- 361.
- 362.
- 363.
- 364.
- 365.
- 366.
- 367.
- 368.
- 369.
- 370.
- 371.
- 372.
- 373.
- 374.
- 375.
- 376.
- 377.
- 378.
- 379.
- 380.
- 381.
- 382.
- 383.
- 384.
- 385.
- 386.
- 387.
- 388.
- 389.
- 390.
- 391.
- 392.
- 393.
- 394.
- 395.
- 396.
- 397.
- 398.
- 399.
- 400.
- 401.
- 402.
- 403.
- 404.
- 405.
- 406.
- 407.
- 408.
- 409.
- 410.
- 411.
- 412.
- 413.
- 414.
- 415.
- 416.
- 417.
- 418.
- 419.
- 420.
- 421.
- 422.
- 423.
- 424.
- 425.
- 426.
- 427.
- 428.
- 429.
- 430.
- 431.
- 432.
- 433.
- 434.
- 435.
- 436.
- 437.
- 438.
- 439.
- 440.
- 441.
- 442.
- 443.
- 444.
- 445.
- 446.
- 447.
- 448.
- 449.
- 450.
- 451.
- 452.
- 453.
- 454.
- 455.
- 456.
- 457.
- 458.
- 459.
- 460.
- 461.
- 462.
- 463.
- 464.
- 465.
- 466.
- 467.
- 468.
- 469.
- 470.
- 471.
- 472.
- 473.
- 474.
- 475.
- 476.
- 477.
- 478.
- 479.
- 480.
- 481.
- 482.
- 483.
- 484.
- 485.
- 486.
- 487.
- 488.
- 489.
- 490.
- 491.
- 492.
- 493.
- 494.
- 495.
- 496.
- 497.
- 498.
- 499.
- 500.
- 501.
- 502.
- 503.
- 504.
- 505.
- 506.
- 507.
- 508.
- 509.
- 510.
- 511.
- 512.
- 513.
- 514.
- 515.
- 516.
- 517.
- 518.
- 519.
- 520.
- 521.
- 522.
- 523.
- 524.
- 525.
- 526.
- 527.
- 528.
- 529.
- 530.
- 531.
- 532.
- 533.
- 534.
- 535.
- 536.
- 537.
- 538.
- 539.
- 540.
- 541.
- 542.
- 543.
- 544.
- 545.
- 546.
- 547.
- 548.
- 549.
- 550.
- 551.
- 552.
- 553.
- 554.
- 555.
- 556.
- 557.
- 558.
- 559.
- 560.
- 561.
- 562.
- 563.
- 564.
- 565.
- 566.
HarmonyOS
赞
收藏 0
回答 1
相关问题
HarmonyOS 拍完照后对图片实现拖动截取效果的demo
677浏览 • 1回复 待解决
HarmonyOS 拍完照获取设备方向,非屏幕方向
508浏览 • 1回复 待解决
HarmonyOS 自定义相机拍照后的图片位置略有偏移
790浏览 • 1回复 待解决
HarmonyOS 自定义相机预览问题
979浏览 • 1回复 待解决
HarmonyOS 有没有相对完整的自定义相机,拍照,保存图片的demo
1023浏览 • 1回复 待解决
HarmonyOS 自定义分辨率保存图片闪退问题
841浏览 • 1回复 待解决
HarmonyOS 自定义相机预览拉伸问题
878浏览 • 1回复 待解决
HarmonyOS 自定义dialog相关问题
746浏览 • 1回复 待解决
HarmonyOS 自定义相机拍照后数据展示
1808浏览 • 1回复 待解决
自定义弹窗使用相关问题
1725浏览 • 1回复 待解决
HarmonyOS 自定义相机demo
1607浏览 • 1回复 待解决
HarmonyOS 如何自定义相机
874浏览 • 1回复 待解决
HarmonyOS 自定义相机功能
1009浏览 • 1回复 待解决
HarmonyOS 关于自定义tab点击滑动相关问题
1210浏览 • 1回复 待解决
HarmonyOS 自定义相机,跳转至图库应用后再返回,自定义相机预览黑屏
1063浏览 • 1回复 待解决
HarmonyOS 关于自定义相机功能
993浏览 • 1回复 待解决
HarmonyOS 如何自定义相机背景
865浏览 • 1回复 待解决
HarmonyOS 自定义相机演示demo
1035浏览 • 1回复 待解决
HarmonyOS 图片自定义分辨率问题
827浏览 • 1回复 待解决
HarmonyOS 保存图片到相册有延时,如何在保存完之后立即刷新相册,需要相关代码的实现
845浏览 • 1回复 待解决
HarmonyOS 自定义相机拍照不成功
1141浏览 • 1回复 待解决
HarmonyOS 使用自定义相机左边有间距
790浏览 • 1回复 待解决
HarmonyOS 键盘弹起后,自定义弹框上移问题
915浏览 • 1回复 待解决
能够提供HarmonyOS自定义相机案例吗?
1148浏览 • 1回复 待解决
HarmonyOS 自定义扫码界面功能自定义高度后报错
812浏览 • 1回复 待解决
参考示例如下: