From ac60f0f162dd728eb0f39b874af00ce6f7453351 Mon Sep 17 00:00:00 2001 From: wanglili12 Date: Wed, 10 Sep 2025 11:29:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=9F=E5=BC=83px2vp=E3=80=81vp2px=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wanglili12 --- api/arkui/component/common.static.d.ets | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/api/arkui/component/common.static.d.ets b/api/arkui/component/common.static.d.ets index ea405b7a48..41c75d321e 100644 --- a/api/arkui/component/common.static.d.ets +++ b/api/arkui/component/common.static.d.ets @@ -2693,6 +2693,36 @@ export declare function animateTo(value: AnimateParam, event: () => void): void; * @since 20 */ export declare function animateToImmediately(value: AnimateParam, event: () => void): void; +/** + * Converts a value in vp units to a value in px. + * By default, the virtual pixel ratio of the screen where the current UI instance is located is used for conversion. + * If no UI instance is available, the virtual pixel ratio of the default screen is used instead. + * + * @param { number } value + * Value range of value: (-∞, +∞). + * @returns { number } + * Value range of the return value: (-∞, +∞). + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + * @deprecated since 18 + * @useinstead ohos.arkui.UIContext.UIContext#vp2px + */ +export declare function vp2px(value: number): number; +/** + * Converts a number in units of px to a number in units of vp. + * By default, the virtual pixel ratio of the screen where the current UI instance is located is used for conversion. + * If no UI instance is available, the virtual pixel ratio of the default screen is used instead. + * + * @param { number } value + * Value range of value: (-∞, +∞). + * @returns { number } + * Value range of the return value: (-∞, +∞). + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + * @deprecated since 18 + * @useinstead ohos.arkui.UIContext.UIContext#px2vp + */ +export declare function px2vp(value: number): number; /** * Defines the namespace of focus controller. * -- Gitee