1# Interface (ZoomQuery) 2<!--Kit: Camera Kit--> 3<!--Subsystem: Multimedia--> 4<!--Owner: @qano--> 5<!--SE: @leo_ysl--> 6<!--TSE: @xchaosioda--> 7 8> **NOTE** 9> 10> - The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version. 11> - This interface was first introduced in API version 12. In this version, a compatibility change was made that preserved the initial version information of inner elements. As a result, you might see outer element's @since version number being higher than that of the inner elements. However, this discrepancy does not affect the functionality of the interface. 12 13ZoomQuery provides APIs to query the zoom feature of a device camera, including the API to obtain the supported zoom ratio range. 14 15## Modules to Import 16 17```ts 18import { camera } from '@kit.CameraKit'; 19``` 20 21## getZoomRatioRange<sup>11+</sup> 22 23getZoomRatioRange(): Array\<number\> 24 25Obtains the supported zoom ratio range. 26 27**Atomic service API**: This API can be used in atomic services since API version 19. 28 29**System capability**: SystemCapability.Multimedia.Camera.Core 30 31**Return value** 32 33| Type | Description | 34| ---------- | ----------------------------- | 35| Array\<number\> | Array containing the minimum and maximum zoom ratios. If the operation fails, an error code defined in [CameraErrorCode](arkts-apis-camera-e.md#cameraerrorcode) is returned.| 36 37**Error codes** 38 39For details about the error codes, see [Camera Error Codes](errorcode-camera.md). 40 41| ID | Error Message | 42| --------------- | --------------- | 43| 7400103 | Session not config, only throw in session usage. | 44 45**Example** 46 47```ts 48import { BusinessError } from '@kit.BasicServicesKit'; 49 50function getZoomRatioRange(photoSession: camera.PhotoSession): Array<number> { 51 let zoomRatioRange: Array<number> = []; 52 try { 53 zoomRatioRange = photoSession.getZoomRatioRange(); 54 } catch (error) { 55 // If the operation fails, error.code is returned and processed. 56 let err = error as BusinessError; 57 console.error(`The getZoomRatioRange call failed. error code: ${err.code}`); 58 } 59 return zoomRatioRange; 60} 61``` 62