source
stringlengths
14
113
code
stringlengths
10
21.3k
application-dev\media\camera\camera-recording-case.md
import { camera } from '@kit.CameraKit'; import { BusinessError } from '@kit.BasicServicesKit'; import { media } from '@kit.MediaKit'; import { common } from '@kit.AbilityKit'; import { fileIo as fs } from '@kit.CoreFileKit'; async function videoRecording(context: common.Context, surfaceId: string): Promise<void> { ...
application-dev\media\camera\camera-recording.md
import { BusinessError } from '@kit.BasicServicesKit'; import { camera } from '@kit.CameraKit'; import { media } from '@kit.MediaKit';
application-dev\media\camera\camera-recording.md
async function getVideoSurfaceId(aVRecorderConfig: media.AVRecorderConfig): Promise<string | undefined> { // For details about aVRecorderConfig, see the next section. let avRecorder: media.AVRecorder | undefined = undefined; try { avRecorder = await media.createAVRecorder(); } catch (error) { ...
application-dev\media\camera\camera-recording.md
async function getVideoOutput(cameraManager: camera.CameraManager, videoSurfaceId: string, cameraOutputCapability: camera.CameraOutputCapability): Promise<camera.VideoOutput | undefined> { let videoProfilesArray: Array<camera.VideoProfile> = cameraOutputCapability.videoProfiles; if (!videoProfilesArray) { ...
application-dev\media\camera\camera-recording.md
async function startVideo(videoOutput: camera.VideoOutput, avRecorder: media.AVRecorder): Promise<void> { videoOutput.start(async (err: BusinessError) => { if (err) { console.error(`Failed to start the video output ${err.message}`); return; } console.info('Callback invoked to...
application-dev\media\camera\camera-recording.md
async function stopVideo(videoOutput: camera.VideoOutput, avRecorder: media.AVRecorder): Promise<void> { try { await avRecorder.stop(); } catch (error) { let err = error as BusinessError; console.error(`avRecorder stop error: ${err}`); } videoOutput.stop((err: BusinessError) => ...
application-dev\media\camera\camera-recording.md
function onVideoOutputFrameStart(videoOutput: camera.VideoOutput): void { videoOutput.on('frameStart', (err: BusinessError) => { if (err !== undefined && err.code !== 0) { return; } console.info('Video frame started'); }); }
application-dev\media\camera\camera-recording.md
function onVideoOutputFrameEnd(videoOutput: camera.VideoOutput): void { videoOutput.on('frameEnd', (err: BusinessError) => { if (err !== undefined && err.code !== 0) { return; } console.info('Video frame ended'); }); }
application-dev\media\camera\camera-recording.md
function onVideoOutputError(videoOutput: camera.VideoOutput): void { videoOutput.on('error', (error: BusinessError) => { console.error(`Video output error code: ${error.code}`); }); }
application-dev\media\camera\camera-session-management.md
import { camera } from '@kit.CameraKit'; import { BusinessError } from '@kit.BasicServicesKit';
application-dev\media\camera\camera-session-management.md
function getSession(cameraManager: camera.CameraManager): camera.Session | undefined { let session: camera.Session | undefined = undefined; try { session = cameraManager.createSession(camera.SceneMode.NORMAL_PHOTO) as camera.PhotoSession; } catch (error) { let err = error as BusinessError; ...
application-dev\media\camera\camera-session-management.md
function beginConfig(photoSession: camera.PhotoSession): void { try { photoSession.beginConfig(); } catch (error) { let err = error as BusinessError; console.error(`Failed to beginConfig. error: ${err}`); } }
application-dev\media\camera\camera-session-management.md
async function startSession(photoSession: camera.PhotoSession, cameraInput: camera.CameraInput, previewOutput: camera.PreviewOutput, photoOutput: camera.PhotoOutput): Promise<void> { try { photoSession.addInput(cameraInput); } catch (error) { let err = error as BusinessError; console.erro...
application-dev\media\camera\camera-session-management.md
async function switchOutput(photoSession: camera.PhotoSession, videoOutput: camera.VideoOutput, photoOutput: camera.PhotoOutput): Promise<void> { try { await photoSession.stop(); } catch (error) { let err = error as BusinessError; console.error(`Failed to stop. error: ${err}`); } ...
application-dev\media\camera\camera-shooting-case.md
import { camera } from '@kit.CameraKit'; import { image } from '@kit.ImageKit'; import { BusinessError } from '@kit.BasicServicesKit'; function setPhotoOutputCb(photoOutput: camera.PhotoOutput): void { // After the callback is set, call capture() of photoOutput to transfer the photo buffer back to the callback. ph...
application-dev\media\camera\camera-shooting.md
import { image } from '@kit.ImageKit'; import { camera } from '@kit.CameraKit'; import { fileIo as fs } from '@kit.CoreFileKit'; import { photoAccessHelper } from '@kit.MediaLibraryKit'; import { BusinessError } from '@kit.BasicServicesKit';
application-dev\media\camera\camera-shooting.md
function getPhotoOutput(cameraManager: camera.CameraManager, cameraOutputCapability: camera.CameraOutputCapability): camera.PhotoOutput | undefined { let photoProfilesArray: Array<camera.Profile> = cameraOutputCapability.photoProfiles; if (!photoProfilesArray) { console.error("createOutput photoProfile...
application-dev\media\camera\camera-shooting.md
function setPhotoOutputCb(photoOutput: camera.PhotoOutput, context: Context) { // After the callback is set, call capture() of photoOutput to transfer the photo buffer back to the callback. photoOutput.on('photoAvailable', (errCode: BusinessError, photo: camera.Photo): void => { console.info('getPhoto s...
application-dev\media\camera\camera-shooting.md
function configuringSession(photoSession: camera.PhotoSession): void { // Check whether the camera has flash. let flashStatus: boolean = false; try { flashStatus = photoSession.hasFlash(); } catch (error) { let err = error as BusinessError; console.error(`Failed to hasFlash. err...
application-dev\media\camera\camera-shooting.md
function capture(captureLocation: camera.Location, photoOutput: camera.PhotoOutput): void { let settings: camera.PhotoCaptureSetting = { quality: camera.QualityLevel.QUALITY_LEVEL_HIGH, // Set the photo quality to high. rotation: camera.ImageRotation.ROTATION_0, // The photo rotation angle, camera.Im...
application-dev\media\camera\camera-shooting.md
function onPhotoOutputCaptureStart(photoOutput: camera.PhotoOutput): void { photoOutput.on('captureStartWithInfo', (err: BusinessError, captureStartInfo: camera.CaptureStartInfo) => { if (err !== undefined && err.code !== 0) { return; } console.info(`photo capture started, captureId : ${ca...
application-dev\media\camera\camera-shooting.md
function onPhotoOutputCaptureEnd(photoOutput: camera.PhotoOutput): void { photoOutput.on('captureEnd', (err: BusinessError, captureEndInfo: camera.CaptureEndInfo) => { if (err !== undefined && err.code !== 0) { return; } console.info(`photo capture end, captureId : ${captureEndInfo.capture...
application-dev\media\camera\camera-shooting.md
function onPhotoOutputCaptureReady(photoOutput: camera.PhotoOutput): void { photoOutput.on('captureReady', (err: BusinessError) => { if (err !== undefined && err.code !== 0) { return; } console.info(`photo capture ready`); }); }
application-dev\media\camera\camera-shooting.md
function onPhotoOutputError(photoOutput: camera.PhotoOutput): void { photoOutput.on('error', (error: BusinessError) => { console.error(`Photo output error code: ${error.code}`); }); }
application-dev\media\camera\camera-torch-use.md
import { camera } from '@kit.CameraKit'; import { BusinessError } from '@kit.BasicServicesKit';
application-dev\media\camera\camera-torch-use.md
function isTorchSupported(cameraManager: camera.CameraManager) : boolean { let torchSupport: boolean = false; try { torchSupport = cameraManager.isTorchSupported(); } catch (error) { let err = error as BusinessError; console.error('Failed to torch. errorCode =...
application-dev\media\camera\camera-torch-use.md
function isTorchModeSupported(cameraManager: camera.CameraManager, torchMode: camera.TorchMode) : boolean { let isTorchModeSupport: boolean = false; try { isTorchModeSupport = cameraManager.isTorchModeSupported(torchMode); } catch (error) { let err = error as BusinessErro...
application-dev\media\camera\camera-torch-use.md
function setTorchModeSupported(cameraManager: camera.CameraManager, torchMode: camera.TorchMode) : void { cameraManager.setTorchMode(torchMode); let isTorchMode = cameraManager.getTorchMode(); console.info(`Returned with the torch mode supportd mode: ${isTorchMode}`); }
application-dev\media\camera\camera-torch-use.md
function onTorchStatusChange(cameraManager: camera.CameraManager): void { cameraManager.on('torchStatusChange', (err: BusinessError, torchStatusInfo: camera.TorchStatusInfo) => { if (err !== undefined && err.code !== 0) { console.error(`Callback Error, errorCode: ${err.code}`); retur...
application-dev\media\camera\camera-worker.md
import { BusinessError } from '@kit.BasicServicesKit'; import { camera } from '@kit.CameraKit'; import { ErrorEvent, MessageEvents, ThreadWorkerGlobalScope, worker } from '@kit.ArkTS';
application-dev\media\camera\camera-worker.md
class CameraService { private imageWidth: number = 1920; private imageHeight: number = 1080; private cameraManager: camera.CameraManager | undefined = undefined; private cameras: Array<camera.CameraDevice> | Array<camera.CameraDevice> = []; private cameraInput: camera.CameraInput | undefined = ...
application-dev\media\camera\camera-worker.md
let cameraService = new CameraService(); const workerPort: ThreadWorkerGlobalScope = worker.workerPort; // Custom message format. interface MessageInfo { hasResolve: boolean; type: string; context: Context; // The Worker thread cannot use getContext() to obtain the context of the host thread...
application-dev\media\camera\camera-worker.md
@Entry @Component struct Index { private mXComponentController: XComponentController = new XComponentController(); private surfaceId: string = ''; @State imageWidth: number = 1920; @State imageHeight: number = 1080; // Create a ThreadWorker object to obtain a Worker instance. private...
application-dev\media\drm\drm-arkts-dev-guide.md
import { drm } from '@kit.DrmKit';
application-dev\media\drm\drm-arkts-dev-guide.md
import { BusinessError } from '@kit.BasicServicesKit';
application-dev\media\drm\drm-arkts-dev-guide.md
let description: drm.MediaKeySystemDescription[] = drm.getMediaKeySystems();
application-dev\media\drm\drm-arkts-dev-guide.md
let isSupported: boolean = drm.isMediaKeySystemSupported("com.clearplay.drm", "video/mp4", drm.ContentProtectionLevel.CONTENT_PROTECTION_LEVEL_SW_CRYPTO);
application-dev\media\drm\drm-arkts-dev-guide.md
let mediaKeySystem: drm.MediaKeySystem = drm.createMediaKeySystem("com.clearplay.drm");
application-dev\media\drm\drm-arkts-dev-guide.md
mediaKeySystem.on('keySystemRequired', (eventInfo: drm.EventInfo) => { console.log('keySystemRequired' + 'extra:' + eventInfo.extraInfo + ' data:' + eventInfo.info); // Request and process the DRM certificate. });
application-dev\media\drm\drm-arkts-dev-guide.md
let certificateStatus: drm.CertificateStatus = mediaKeySystem.getCertificateStatus();
application-dev\media\drm\drm-arkts-dev-guide.md
if(certificateStatus != drm.CertificateStatus.CERT_STATUS_PROVISIONED) { mediaKeySystem.generateKeySystemRequest().then(async (drmRequest: drm.ProvisionRequest) => { console.info("generateKeySystemRequest success", drmRequest.data, drmRequest.defaultURL); }).catch((err:BusinessError) =>{ ...
application-dev\media\drm\drm-arkts-dev-guide.md
let mediaKeySession: drm.MediaKeySession = mediaKeySystem.createMediaKeySession();
application-dev\media\drm\drm-arkts-dev-guide.md
mediaKeySession.on('keyRequired', (eventInfo: drm.EventInfo) => { console.log('keyRequired' + 'info:' + eventInfo.info + ' extraInfo:' + eventInfo.extraInfo); // Request and process the media key. });
application-dev\media\drm\drm-arkts-dev-guide.md
mediaKeySession.on('keyExpired', (eventInfo: drm.EventInfo) => { console.log('keyExpired' + 'info:' + eventInfo.info + ' extraInfo:' + eventInfo.extraInfo); });
application-dev\media\drm\drm-arkts-dev-guide.md
mediaKeySession.on('expirationUpdate', (eventInfo: drm.EventInfo) => { console.log('expirationUpdate' + 'info:' + eventInfo.info + ' extraInfo:' + eventInfo.extraInfo); });
application-dev\media\drm\drm-arkts-dev-guide.md
mediaKeySession.on('keysChange', (keyInfo : drm.KeysInfo[], newKeyAvailable:boolean) => { for(let i = 0; i < keyInfo.length; i++){ console.log('keysChange' + 'info:' + keyInfo[i].keyId + ' extraInfo:' + keyInfo[i].value); } });
application-dev\media\drm\drm-arkts-dev-guide.md
try { let status: boolean = mediaKeySession.requireSecureDecoderModule("video/avc"); } catch (err) { let error = err as BusinessError; console.error(`requireSecureDecoderModule ERROR: ${error}`); }
application-dev\media\drm\drm-arkts-dev-guide.md
// Generate initData based on PSSH in the DRM information as required by the DRM solution. let initData = new Uint8Array([0x00, 0x00, 0x00, 0x00]); // Set optional data based on the DRM solution. let optionalData:drm.OptionsData[] = [{ name: "optionalDataName", value: "optionalDataValue" ...
application-dev\media\drm\drm-arkts-dev-guide.md
mediaKeySession.restoreOfflineMediaKeys(offlineMediaKeyId).then(() => { console.log("restoreOfflineMediaKeys success."); }).catch((err: BusinessError) => { console.error(`restoreOfflineMediaKeys: ERROR: ${err}`); });
application-dev\media\drm\drm-arkts-dev-guide.md
let mediaKeyStatus: drm.MediaKeyStatus[] try { mediaKeyStatus = mediaKeySession.checkMediaKeyStatus() } catch (err) { let error = err as BusinessError; console.error(`checkMediaKeyStatus: ERROR: ${error}`); }
application-dev\media\drm\drm-arkts-dev-guide.md
let offlineMediaKeyIds: Uint8Array[] = mediaKeySystem.getOfflineMediaKeyIds(); try { let offlineMediaKeyStatus: drm.OfflineMediaKeyStatus = mediaKeySystem.getOfflineMediaKeyStatus(offlineMediaKeyIds[0]); } catch (err) { let error = err as BusinessError; console.error(`getOfflineMediaKeyStatus ...
application-dev\media\drm\drm-arkts-dev-guide.md
// Release resources when the MediaKeySession instance is no longer needed. mediaKeySession.destroy();
application-dev\media\drm\drm-arkts-dev-guide.md
// Release resources when the MediaKeySystem instance is no longer needed. mediaKeySystem.destroy();
application-dev\media\drm\drm-avplayer-arkts-integration.md
import { drm } from '@kit.DrmKit' import { media } from '@kit.MediaKit'
application-dev\media\drm\drm-avplayer-arkts-integration.md
import { BusinessError } from '@kit.BasicServicesKit'
application-dev\media\drm\drm-avplayer-arkts-integration.md
let playerHandle: media.AVPlayer = await media.createAVPlayer() playerHandle.on('mediaKeySystemInfoUpdate', async (mediaKeySystemInfo: drm.MediaKeySystemInfo[]) => { console.info('player has received drmInfo signal: ' + JSON.stringify(mediaKeySystemInfo)) // Process DRM information. // Set a decryptio...
application-dev\media\drm\drm-avplayer-arkts-integration.md
let mediaKeySystem: drm.MediaKeySystem let mediaKeySession: drm.MediaKeySession let drmInfoArr: drm.MediaKeySystemInfo[] = mediaKeySystemInfo for (let i = 0; i < drmInfoArr.length; i++) { console.info('drmInfoArr - uuid: ' + drmInfoArr[i].uuid) console.info('drmInfoArr - pssh: ' + drmInfoArr[i].pssh)...
application-dev\media\drm\drm-avplayer-arkts-integration.md
let initData: Uint8Array = new Uint8Array(drmInfoArr[i].pssh); const optionsData: drm.OptionsData[] = [{ name: "optionalDataName", value: "optionalDataValue" }] mediaKeySession.generateMediaKeyRequest("video/mp4", initData, drm.MediaKeyType.MEDIA_KEY_TYPE_ONLINE, optionsData).then(async (licenseReque...
application-dev\media\drm\drm-avplayer-arkts-integration.md
let svp: boolean = mediaKeySession.requireSecureDecoderModule('video/avc'); playerHandle.setDecryptionConfig(mediaKeySession, svp)
application-dev\media\drm\drm-avplayer-arkts-integration.md
playerHandle.on('stateChange', async (state: string, reason: media.StateChangeReason) => { if (state == 'released') { mediaKeySession.destroy(); mediaKeySystem.destroy(); } } await this.playerHandle.release()
application-dev\media\image\image-allocator-type.md
import image from '@ohos.multimedia.image'; async CreatePixelMapUsingAllocator() { const context = getContext(); const resourceMgr = context.resourceManager; const rawFile = await resourceMgr.getRawFileContent("test.jpg"); // Test image. let imageSource: image.ImageSource | null = await image.createImageSourc...
application-dev\media\image\image-decoding.md
import { image } from '@kit.ImageKit';
application-dev\media\image\image-decoding.md
const context : Context = getContext(this); const filePath : string = context.cacheDir + '/test.jpg';
application-dev\media\image\image-decoding.md
import { fileIo as fs } from '@kit.CoreFileKit';
application-dev\media\image\image-decoding.md
const context = getContext(this); const filePath = context.cacheDir + '/test.jpg'; const file : fs.File = fs.openSync(filePath, fs.OpenMode.READ_WRITE); const fd : number = file?.fd;
application-dev\media\image\image-decoding.md
// Import the resourceManager module. import { resourceManager } from '@kit.LocalizationKit'; const context : Context = getContext(this); // Obtain a resource manager. const resourceMgr : resourceManager.ResourceManager = context.resourceManager;
application-dev\media\image\image-decoding.md
resourceMgr.getRawFileContent('test.jpg').then((fileData : Uint8Array) => { console.log("Succeeded in getting RawFileContent") // Obtain the array buffer of the image. const buffer = fileData.buffer.slice(0); }).catch((err : BusinessError) => { console.error("Failed to get RawF...
application-dev\media\image\image-decoding.md
// Import the resourceManager module. import { resourceManager } from '@kit.LocalizationKit'; const context : Context = getContext(this); // Obtain a resource manager. const resourceMgr : resourceManager.ResourceManager = context.resourceManager;
application-dev\media\image\image-decoding.md
resourceMgr.getRawFd('test.jpg').then((rawFileDescriptor : resourceManager.RawFileDescriptor) => { console.log("Succeeded in getting RawFileDescriptor") }).catch((err : BusinessError) => { console.error("Failed to get RawFileDescriptor") });
application-dev\media\image\image-decoding.md
// path indicates the obtained sandbox path. const imageSource : image.ImageSource = image.createImageSource(filePath);
application-dev\media\image\image-decoding.md
// fd is the obtained file descriptor. const imageSource : image.ImageSource = image.createImageSource(fd);
application-dev\media\image\image-decoding.md
const imageSource : image.ImageSource = image.createImageSource(buffer);
application-dev\media\image\image-decoding.md
const imageSource : image.ImageSource = image.createImageSource(rawFileDescriptor);
application-dev\media\image\image-decoding.md
import { BusinessError } from '@kit.BasicServicesKit'; import { image } from '@kit.ImageKit'; let img = await getContext(this).resourceManager.getMediaContent($r('app.media.image')); let imageSource:image.ImageSource = image.createImageSource(img.buffer.slice(0)); let decodingOptions : image.De...
application-dev\media\image\image-decoding.md
import { BusinessError } from '@kit.BasicServicesKit'; import { image } from '@kit.ImageKit'; let img = await getContext(this).resourceManager.getMediaContent($r('app.media.CUVAHdr')); let imageSource:image.ImageSource = image.createImageSource(img.buffer.slice(0)); let decodingOptions : image....
application-dev\media\image\image-decoding.md
pixelMap.release(); imageSource.release();
application-dev\media\image\image-effect-guidelines.md
XComponent({ id: 'xcomponentId', type: 'surface', controller: this.mXComponentController, libraryname: 'entry' }) .onLoad(() => { // Obtain the surface ID of the XComponent. this.mSurfaceId = this.mXComponentController.getXComponentSurfaceId() ...
application-dev\media\image\image-encoding.md
// Import the required module. import { image } from '@kit.ImageKit'; const imagePackerApi = image.createImagePacker();
application-dev\media\image\image-encoding.md
let packOpts : image.PackingOption = { format:"image/jpeg", quality:98 };
application-dev\media\image\image-encoding.md
packOpts.desiredDynamicRange = image.PackingDynamicRange.AUTO;
application-dev\media\image\image-encoding.md
import { BusinessError } from '@kit.BasicServicesKit'; imagePackerApi.packToData(pixelMap, packOpts).then( (data : ArrayBuffer) => { // data is the file stream obtained after encoding. You can write the file and save it to obtain an image. }).catch((error : BusinessError) => { console.error('Failed to ...
application-dev\media\image\image-encoding.md
import { BusinessError } from '@kit.BasicServicesKit'; imagePackerApi.packToData(imageSource, packOpts).then( (data : ArrayBuffer) => { // data is the file stream obtained after encoding. You can write the file and save it to obtain an image. }).catch((error : BusinessError) => { console.error('Faile...
application-dev\media\image\image-encoding.md
import { BusinessError } from '@kit.BasicServicesKit'; import { fileIo as fs } from '@kit.CoreFileKit'; const context : Context = getContext(this); const path : string = context.cacheDir + "/pixel_map.jpg"; let file = fs.openSync(path, fs.OpenMode.CREATE | fs.OpenMode.READ_WRITE); imagePackerApi.packToFi...
application-dev\media\image\image-encoding.md
import { BusinessError } from '@kit.BasicServicesKit'; import { fileIo as fs } from '@kit.CoreFileKit'; const context : Context = getContext(this); const filePath : string = context.cacheDir + "/image_source.jpg"; let file = fs.openSync(filePath, fs.OpenMode.CREATE | fs.OpenMode.READ_WRITE); imagePackerA...
application-dev\media\image\image-picture-decoding.md
import { image } from '@kit.ImageKit';
application-dev\media\image\image-picture-decoding.md
const context : Context = getContext(this); const filePath : string = context.cacheDir + '/test.jpg';
application-dev\media\image\image-picture-decoding.md
import { fileIo } from '@kit.CoreFileKit';
application-dev\media\image\image-picture-decoding.md
const context = getContext(this); const filePath = context.cacheDir + '/test.jpg'; const file : fileIo.File = fileIo.openSync(filePath, fileIo.OpenMode.READ_WRITE); const fd : number = file?.fd;
application-dev\media\image\image-picture-decoding.md
const context : Context = getContext(this); // Obtain a resource manager. const resourceMgr : resourceManager.ResourceManager = context.resourceManager;
application-dev\media\image\image-picture-decoding.md
resourceMgr.getRawFileContent('test.jpg').then((fileData : Uint8Array) => { console.log("Succeeded in getting RawFileContent") // Obtain the array buffer of the image. const buffer = fileData.buffer.slice(0); }).catch((err : BusinessError) => { console.error("Failed to get RawF...
application-dev\media\image\image-picture-decoding.md
const context : Context = getContext(this); // Obtain a resource manager. const resourceMgr : resourceManager.ResourceManager = context.resourceManager;
application-dev\media\image\image-picture-decoding.md
resourceMgr.getRawFd('test.jpg').then((rawFileDescriptor : resourceManager.RawFileDescriptor) => { console.log("Succeeded in getting RawFileDescriptor") }).catch((err : BusinessError) => { console.error("Failed to get RawFileDescriptor") });
application-dev\media\image\image-picture-decoding.md
// path indicates the obtained sandbox path. const imageSource : image.ImageSource = image.createImageSource(filePath);
application-dev\media\image\image-picture-decoding.md
// fd is the obtained file descriptor. const imageSource : image.ImageSource = image.createImageSource(fd);
application-dev\media\image\image-picture-decoding.md
const imageSource : image.ImageSource = image.createImageSource(buffer);
application-dev\media\image\image-picture-decoding.md
const imageSource : image.ImageSource = image.createImageSource(rawFileDescriptor);
application-dev\media\image\image-picture-decoding.md
import { BusinessError } from '@kit.BasicServicesKit'; import image from '@kit.ImageKit'; let img = await getContext(this).resourceManager.getMediaContent($r('app.media.picture')); let imageSource:image.ImageSource = image.createImageSource(img.buffer.slice(0)); let options: image.DecodingOption...
application-dev\media\image\image-picture-decoding.md
// Obtain an auxiliary picture. let type: image.AuxiliaryPictureType = image.AuxiliaryPictureType.GAINMAP; let auxPicture: image.AuxiliaryPicture | null = picture.getAuxiliaryPicture(type); // Obtain the information of the auxiliary picture. let auxinfo: image.AuxiliaryPictureInfo = auxPicture.getAuxiliaryP...
application-dev\media\image\image-picture-decoding.md
picture.release();
application-dev\media\image\image-picture-encoding.md
// Import the required module. import { image } from '@kit.ImageKit'; const imagePackerApi = image.createImagePacker();