Interface self-adaptive zooming method and system

By setting and rewriting DPI interface rules, a user interface control that adaptive DPI scaling is generated, and the DPI scaling is synchronized step by step when DPI changes, the problem of interface blurring and response lag under high DPI is solved, and the interface is realized in different ways. Clear consistency and efficient response under DPI settings.

CN119201328AActive Publication Date: 2024-12-27VISION MICROSYST (SHANGHAI) CO LTD
View PDF 20 Cites 0 Cited by

Patent Information

Application Number
CN202411708084.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2024-12-27
Estimated Expiration
2044-11-27

AI Technical Summary

Technical Problem

The existing technology has inconsistent interface effects, blurred or distorted when scaling at high DPI, and cannot be used normally, and performs differently under different operating systems.

Method used

By setting DPI interface rules and processing the scaling rules of DPI interface classes, rewriting the relevant interfaces of the user interface control and DPI interface classes, generating text user interface controls that adaptive DPI scaling, and synchronizing them step by step when DPI changes , combined with the delay response mechanism, avoid unnecessary scaling operations.

Benefits of technology

It realizes that the interface remains clear and consistent under different DPI settings, improves the user experience, avoids blurring problems, and reduces the interface response lag.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201328A_ABST
    Figure CN119201328A_ABST
Patent Text Reader

Abstract

The invention provides an interface self-adaptive zooming method and system. The method comprises the following steps: a setting step: setting a DPI interface class rule and a zooming rule for processing a DPI interface class; a rewriting step: rewriting the user interface control and an interface displayed in the DPI interface class according to a DPI interface class rule, and generating a text user interface control capable of self-adapting to DPI zooming; a creation step: creating an application program interface according to the text user interface control; and a zooming step: when the DPI of the display interface where the application program interface is located changes, zooming the interface step by step according to the zooming rule for processing the DPI interface class. By adopting a real window zooming technology, the problems that the window is too small in high-DPI display and is blurred after being amplified are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of digital display technology, and in particular to a method and system for adaptively scaling an interface. Background Art

[0002] There are currently two widely used high DPI scaling solutions. One is the built-in Windows system. The application itself does not need to do too much operation. It only needs to tell the operating system the scaling strategy the program wants to adopt. The disadvantage of this solution is very obvious, that is, the effect is different under different operating systems. The effect gradually gets better from Win7, Win10, and Win11. After zooming in twice under the Win7 operating system, the effect is very blurry and the software cannot be used normally. The other solution is the interface scaling technology that comes with the UI library itself. The advantage of this solution is that the effect is basically consistent under each operating system, but there are still many loopholes in actual use. For example, after the interface is scaled, it is not based on the original ratio, and some modules will still become blurred.

[0003] The Chinese patent document with publication number CN106170766A discloses a method and system for displaying and scaling an improved user interface of optional software commands and controls in at least one of a first strip area and a second strip area. Below the first strip area of ​​the top-level command label, the optional controls associated with the selected command label are presented in logical subgroups or blocks. The optional controls within the block are scaled at a granular level to adapt to different screen sizes or changes in window size. Scaling includes moving a subset of the optional controls within at least one block between the overflow pane and the second strip area. The invention only performs adaptive scaling on the text portion in the display.

[0004] Therefore, a method and system for adaptively scaling an interface is needed. Summary of the invention

[0005] In view of the defects in the prior art, an object of the present invention is to provide a method and system for adaptively scaling an interface.

[0006] A method for adaptively scaling an interface provided by the present invention includes: Setting steps: Setting DPI interface class rules and scaling rules for processing DPI interface classes; Rewriting steps: rewrite the interface displayed in the user interface control and the DPI interface class according to the DPI interface class rules to generate a text user interface control that can adaptively scale with DPI; Creation steps: Create application interface based on text user interface controls; Scaling steps: When the DPI of the display interface where the application interface is located changes, the interface is scaled step by step according to the scaling rules of the DPI interface class.

[0007] Preferably, the rewriting step comprises: Rewriting interface step: rewriting the relevant interface displayed in the DPI interface class according to the DPI interface class rule. Specifically, when the relevant interface is called, the snapshot information at the time of calling is saved to the subclass of the corresponding interface in the DPI interface class; wherein the displayed relevant interface includes: geometry size related interface and layout related interface; the snapshot information includes calling flag and calling parameter; Rewrite control steps: rewrite the user interface control according to the DPI interface class rules and the rewritten related interfaces to generate a text user interface control that can adapt to DPI scaling; Monitoring and notification steps: Let the text user interface control monitor the DPI of the interface. When the DPI change is detected, a scaling notification instruction is sent to the subclass of the text user interface; the subclass includes N levels of subclasses. When notifying the scaling, notifications are required from level 1 to level N.

[0008] Preferably, the rewriting step comprises: Get the current DPI scaling factor: DPI scaling factor = monitored DPI value / 96.0 Integrate the saved snapshot information and the current DPI scaling factor, and rewrite the display-related interfaces; The saved snapshot information also includes information that the initial defined zoom factor is 1.0.

[0009] Preferably, the scaling step comprises: Acquisition step: when the text user interface monitors that the DPI of the display interface where the application interface is located changes and issues a scaling notification instruction, the corresponding scaling factor is acquired according to the scaling rule of the DPI interface class; Transfer step: scale the display interface where the application interface is located according to the scaling factor, and pass the scaling factor to the relevant subclasses of the text user interface step by step; Scaling execution steps: The subclasses are scaled synchronously step by step, so that all components in the display interface are scaled synchronously until all subclasses complete the scaling task.

[0010] Preferably, it also includes: Delayed response steps: When facing multiple displays, the user drags the display interface to move between the multiple displays using a drag tool. If the user releases the drag tool, the interface is adaptively scaled. If the user does not release the drag tool, the display interface maintains the original size.

[0011] A system for adaptively scaling an interface provided by the present invention includes: Setting module: used to set DPI interface class rules and process scaling rules of DPI interface class; Rewrite module: used to rewrite all display-related interfaces in the user interface control and DPI interface class, generate text user interface controls, and provide preset rule information for creating application interface; Creation module: used to create application interface. When creating the interface, encapsulated components are used, which can be adaptively scaled to DPI. Scaling module: When the DPI of the display interface changes, it is used to synchronously scale the display interface and all its components.

[0012] Preferably, the rewriting module includes: Rewrite interface unit: used to rewrite the related interfaces displayed in the DPI interface class, specifically, save the snapshot information when calling to the corresponding subclass in the DPI interface class, so that the related interfaces and interface information displayed can be directly used when the DPI changes; Rewrite control unit: used to rewrite user interface controls and generate text user interface controls that can adapt to DPI scaling; Monitoring and notification unit: used to monitor the DPI of the interface. When the DPI changes, it sends a scaling notification instruction to the subclass.

[0013] Preferably, the rewriting module includes: Calculation unit: used to obtain the current DPI scaling factor: Rewrite interface subunit: used to rewrite the display-related interfaces according to the current DPI scaling factor; Save unit: used to save the snapshot information when calling and the information of the initial defined zoom factor of 1.0.

[0014] Preferably, the scaling module comprises: Acquisition unit: used to obtain the scaling factor when the DPI of the display interface changes; Transfer unit: used to pass the scaling factor to all subclasses corresponding to the scaling interface step by step; Scaling execution unit: used to synchronously scale the display interface and all components within the interface.

[0015] Preferably, it also includes: Delayed response unit: when facing multiple displays with changing DOI, adaptive scaling is performed only on the display interface within the target display, and non-target displays passing through the process are all delayed in response and no adaptive scaling is performed.

[0016] Compared with the prior art, the present invention has the following beneficial effects: 1. The present invention solves the problem that the window is too small when displayed at high DPI and blurry after being enlarged by adopting the technology of real scaling window. Specifically, the present invention abstracts the DPI interface class and the DPIHelper class, and generates a new TUI control. This method enables the application interface to adapt to the display under different DPI settings, thereby improving the adaptability of the interface and the user experience. No matter how much the user sets the display's DPI, the interface can remain clear, consistent and easy to use. 2. The present invention actively monitors the system DPI scaling events, eliminating the need to manually handle the DPI scaling problem, and combines a delayed response mechanism to solve the problem of interface response freeze when the display DPI changes frequently; the DPI change event is responded to only after the mouse movement is completed, thereby reducing unnecessary scaling operations; 3. The present invention achieves scaling by physically enlarging the interface, avoiding blurring caused by stretching. Even under high DPI settings, the interface can maintain clarity and provide better visual effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings: Figure 1 A flowchart of a method for adaptively scaling an interface according to the present invention; Figure 2 This is a flow chart of Example 1 of the present invention. DETAILED DESCRIPTION

[0018] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.

[0019] On the Windows operating system, when the DPI of the display where the application interface is located changes, the application interface is scaled through custom logic so that the entire interface can not only scale with the system but also will not be blurred.

[0020] A method for adaptively scaling an interface provided by the present invention includes: Setting steps: Setting DPI interface class rules and scaling rules for processing DPI interface classes; Rewriting steps: rewrite the interface displayed in the user interface control and the DPI interface class according to the DPI interface class rules to generate a text user interface control that can adaptively scale with DPI; Creation steps: Create application interface based on text user interface controls; Scaling steps: When the DPI of the display interface where the application interface is located changes, the interface is scaled step by step according to the scaling rules of the DPI interface class.

[0021] Specifically, the rewriting step includes: Rewriting interface step: rewriting the relevant interface displayed in the DPI interface class according to the DPI interface class rule. Specifically, when the relevant interface is called, the snapshot information at the time of calling is saved to the subclass of the corresponding interface in the DPI interface class; wherein the displayed relevant interface includes: geometry size related interface and layout related interface; the snapshot information includes calling flag and calling parameter; Rewrite control steps: rewrite the user interface control according to the DPI interface class rules and the rewritten related interfaces to generate a text user interface control that can adapt to DPI scaling; Monitoring and notification steps: Let the text user interface control monitor the DPI of the interface. When the DPI change is detected, a scaling notification instruction is sent to the subclass of the text user interface; the subclass includes N levels of subclasses. When notifying the scaling, notifications are required from level 1 to level N.

[0022] Specifically, the rewriting step includes: Get the current DPI scaling factor: DPI scaling factor = monitored DPI value / 96.0 Integrate the saved snapshot information and the current DPI scaling factor, and rewrite the display-related interfaces; The saved snapshot information also includes information that the initial defined zoom factor is 1.0.

[0023] Specifically, the scaling step includes: Acquisition step: when the text user interface monitors that the DPI of the display interface where the application interface is located changes and issues a scaling notification instruction, the corresponding scaling factor is acquired according to the scaling rule of the DPI interface class; Transfer step: scale the display interface where the application interface is located according to the scaling factor, and pass the scaling factor to the relevant subclasses of the text user interface step by step; Scaling execution steps: The subclasses are scaled synchronously step by step, so that all components in the display interface are scaled synchronously until all subclasses complete the scaling task.

[0024] Specifically, it also includes: Delayed response steps: When facing multiple displays, the user drags the display interface to move between the multiple displays using a drag tool. If the user releases the drag tool, the interface is adaptively scaled. If the user does not release the drag tool, the display interface maintains the original size.

[0025] Example 1 A method for adaptively scaling an interface, comprising: Step 1: Abstract DPI interface class. All UI controls need to inherit from the DPI interface class. Step 2: Abstract DPIHelper class to assist DPI interface class in performing application interface scaling operations; Step 3: Inherit the original UI control and DPI interface class, and rewrite the original UI control and display-related interfaces to generate a new TUI control; Step 4: Use TUI controls to create the application interface; Step 5: When the DPI of the window where the application interface is located changes, scale the interface level by level through the DPI interface class; The step 3 comprises the following steps: Step 3.1: Rewrite the interface related to the geometry size. When the interface is called, save the snapshot information at the time of calling to the implementation subclass of the DPI interface class; Step 3.2: Rewrite the layout-related interfaces. When the interface is called, save the snapshot information at the time of the call to the implementation subclass of the DPI interface class. Mark the call flag and call parameters, i.e. snapshot information, in the rewritten interface implementation. The purpose of saving this data is that when the DPI changes, the system will calculate a set of parameter information that meets the current DPI based on the snapshot information recorded at that time plus the current DPI, and call the marked call interface again.

[0026] Step 3.2.1: Get the current DPI scaling factor = monitored DPI value / 96.0. Assume that the calculated scaling factor is 2.

[0027] Step 3.2.2: Snapshot information records information at a zoom factor of 1.0. For example, if the button size is 80×25, then when the zoom factor is 2, the framework will automatically set the button size to 160×50. These zoom operations are imperceptible to people using TUI controls, and all zoom operations are completed by the framework.

[0028] The parameter information here refers to data related to geometric size, such as the button 80×25 in the above text.

[0029] Step 3.3: The top-level TUI control needs to monitor the display DPI change event and notify its direct subclass to scale. If the subclass contains subclasses, it needs to notify each level one by one. Step 4: 1. Use encapsulated components when creating interface components with TUI controls. The advantage is that it can be adaptively scaled with DPI. The technicians who develop the interface only need to focus on designing the interface, and the scaling of the interface has been adapted by the TUI encapsulation layer; the rewritten controls support adaptive DPI, and the interface created with the TUI control can perfectly adapt to the display DPI scaling.

[0030] The step 5 comprises the following steps: Step 5.1: The user actively changes the DPI of the display where the application is located; Step 5.2: After the top-level TUI control monitors the scaling event, it obtains the appropriate scaling factor through the DPIHelper base class; Among them, the scaling factor is calculated based on the current display DPI. The standard DPI value is 96, which is 100% scaling. When the user scales the display, for example, to 150%, the DPI value is 144, and the corresponding scaling factor is 1.5 (when DPI scaling, the system sets 150% scaling, and the change we can get is 144, which needs to be calculated to 1.5 by ourselves, which is 144 / 96.0).

[0031] Step 5.3: The top-level TUI control first uses the scaling factor to scale its own window size, then obtains all direct subclasses through the base DPI interface class, and transfers the scaling factor to all subclasses; Step 5.4: The subclass is scaled using the same process as the top-level TUI control until the subclass has no children.

[0032] The scaling of the window is based on DPI, that is, the user's magnification ratio of the display DPI determines the system's magnification ratio of the window; Specifically, the common scaling ratios for scaling DPI through the operating system are 100%, 125%, 150%, 175%, 200%, 225%, 250%, 275%, and 300%. For example, if you choose to scale by 200%, the scaling factor is 2. When the system detects that the user has enlarged the DPI to 200%, it will automatically enlarge all components that have been set to twice the size.

[0033] The existing zooming technologies all stretch the result data after the interface is drawn like a picture, which is definitely blurry. The zooming technology of the present invention does not stretch the window size, but directly achieves zooming through the physical magnification effect.

[0034] For example, there is a 400×400 window with two 80×25 buttons on it, when the DPI is enlarged by 2 times. Image stretching solution: Under normal circumstances, when the interface is drawn, the window and the two buttons will be drawn to a memory area respectively, and will not be blurred. When the DPI is enlarged by 2 times, the drawn window is still 400×400, but after the window is drawn to the memory, the window is enlarged to 800*800 by filling in the memory. There are generally many ways to fill in points. For example, if there are 2×2 with a total of 4 pixels, if it is enlarged to 3×3, then the possible solution is that the middle color value of the first row is the average of the left and right color values, and the other supplementary color value points are obtained by similar blurring, so the interface will look blurry.

[0035] The solution of the present invention: Under normal circumstances, the interface is drawn normally. When the DPI is enlarged by 2 times, the framework will enlarge the physical size of the interface by twice, that is, the interface is equivalent to becoming 800×800 in size. No additional color value is required during drawing, so the drawing logic is consistent with the process of not enlarging the DPI, so it will not be blurred.

[0036] Delayed response: For example, if there are multiple monitors and the DPI scaling is inconsistent, the mouse drags the form back and forth between the monitors. If the form is scaled in real time, there will be obvious lag. To solve this problem, a delayed response mechanism is implemented, which responds once the mouse has completed moving the form. That is to say, when the form moves back and forth between multiple monitors, it only responds to the DPI change event after the mouse pops up and the form has completed moving. If there is no change, no scaling is performed. This interaction is more user-friendly.

[0037] When setting the window size, since the setting interface has been called, the snapshot information of the setting interface has been saved, and the setting window size interface can be called again later, which is the supplementary explanation in step 3.2.

[0038] The present invention also provides a system for adaptive interface scaling, which can be implemented by executing the process steps of the method for adaptive interface scaling, that is, those skilled in the art can understand the method for adaptive interface scaling as a preferred implementation of the system for adaptive interface scaling.

[0039] A system for adaptive scaling of an interface provided by the present invention includes: a setting module: used for setting DPI interface class rules and processing scaling rules of the DPI interface class; a rewriting module: used for rewriting user interface controls and all display-related interfaces in the DPI interface class, generating text user interface controls, and providing preset rule information for creating an application interface; a creation module: used for creating an application interface, and when creating the interface, encapsulated components are used to enable adaptive DPI scaling; a scaling module: used for synchronously scaling the display interface and all components of the interface when the DPI of the display interface changes.

[0040] Specifically, the rewrite module includes: a rewrite interface unit: used to rewrite the relevant interfaces displayed in the DPI interface class, specifically, saving the snapshot information during the call to the corresponding subclass in the DPI interface class, so that when the DPI changes, the relevant interfaces and interface information displayed can be directly used; a rewrite control unit: used to rewrite the user interface control and generate a text user interface control that can adaptively scale with DPI; a monitoring and notification unit: used to monitor the DPI of the interface, and when the DPI changes, a scaling notification instruction is sent to the subclass.

[0041] Specifically, the rewrite module includes: a calculation unit: used to obtain the current DPI scaling factor; a rewrite interface subunit: used to rewrite the related display interfaces according to the current DPI scaling factor; a saving unit: used to save the snapshot information at the time of calling and the information that the initial defined scaling factor is 1.0.

[0042] Specifically, the scaling module includes: an acquisition unit: used to obtain the scaling factor when the DPI of the display interface changes; a transfer unit: used to pass the scaling factor to the subclasses corresponding to all scaling interfaces step by step; a scaling execution unit: used to make the display interface and all components in the interface scale synchronously.

[0043] Specifically, it also includes: a delayed response unit: when facing multiple displays with DOI changes, only the display interface within the target display is adaptively scaled, and non-target displays passing through the process are all delayed in response and no adaptive scaling is performed.

[0044] Those skilled in the art know that, in addition to realizing the system and its various devices, modules, and units provided by the present invention in a purely computer-readable program code, it is entirely possible to realize the same functions in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered as a hardware component, and the devices, modules, and units included therein for realizing various functions can also be regarded as structures within the hardware component; the devices, modules, and units for realizing various functions can also be regarded as both software modules for realizing the method and structures within the hardware component.

[0045] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.

Claims

1. A method for adaptively scaling an interface, characterized in that: include: Setting steps: Setting DPI interface class rules and processing DPI interface class scaling rules; Rewriting steps: rewrite the interface displayed in the user interface control and the DPI interface class according to the DPI interface class rules to generate a text user interface control that can adaptively scale with DPI; Creation steps: Create application interface based on text user interface controls; Scaling steps: When the DPI of the display interface where the application interface is located changes, the interface is scaled step by step according to the scaling rules of the DPI interface class.

2. The method for adaptively scaling an interface according to claim 1, characterized in that: The rewriting step comprises: Rewriting interface step: rewriting the relevant interface displayed in the DPI interface class according to the DPI interface class rule. Specifically, when the relevant interface is called, the snapshot information at the time of calling is saved to the subclass of the corresponding interface in the DPI interface class; wherein the displayed relevant interface includes: geometry size related interface and layout related interface; the snapshot information includes calling flag and calling parameter; Rewrite control steps: rewrite the user interface control according to the DPI interface class rules and the rewritten related interfaces to generate a text user interface control that can adapt to DPI scaling; Monitoring and notification steps: Let the text user interface control monitor the DPI of the interface. When the DPI change is detected, a scaling notification instruction is sent to the subclass of the text user interface; the subclass includes N levels of subclasses. When notifying the scaling, notifications are required from level 1 to level N.

3. The method for adaptively scaling an interface according to claim 2, characterized in that: The rewriting step comprises: Get the current DPI scaling factor: DPI scaling factor = monitored DPI value / 96.0 Integrate the saved snapshot information and the current DPI scaling factor, and rewrite the display-related interfaces; The saved snapshot information also includes information that the initial defined zoom factor is 1.

0.

4. The method for adaptively scaling an interface according to claim 1, characterized in that: The scaling step includes: Acquisition step: when the text user interface monitors that the DPI of the display interface where the application interface is located changes and issues a scaling notification instruction, the corresponding scaling factor is acquired according to the scaling rule of the DPI interface class; Transfer step: scale the display interface where the application interface is located according to the scaling factor, and pass the scaling factor to the relevant subclasses of the text user interface step by step; Scaling execution steps: The subclasses are scaled synchronously step by step, so that all components in the display interface are scaled synchronously until all subclasses complete the scaling task.

5. The method for adaptively scaling an interface according to claim 1, characterized in that: Also includes: Delayed response steps: When facing multiple displays, the user drags the display interface to move between the multiple displays using a drag tool. If the user releases the drag tool, the interface is adaptively scaled. If the user does not release the drag tool, the display interface maintains the original size.

6. A system for adaptive interface scaling, characterized in that: include: Setting module: used to set DPI interface class rules and process scaling rules of DPI interface class; Rewrite module: used to rewrite all display-related interfaces in the user interface control and DPI interface class, generate text user interface controls that can adapt to DPI scaling, and provide preset rule information for creating application interfaces; Creation module: used to create application interface. When creating the interface, encapsulated components are used, which can be adaptively scaled to DPI. Scaling module: When the DPI of the display interface changes, it is used to synchronously scale the display interface and all its components.

7. The system for adaptively scaling an interface according to claim 6, characterized in that: The rewrite module includes: Rewrite interface unit: used to rewrite the related interfaces displayed in the DPI interface class, specifically, save the snapshot information when calling to the corresponding subclass in the DPI interface class, so that the related interfaces and interface information displayed can be directly used when the DPI changes; Rewrite control unit: used to rewrite user interface controls and generate text user interface controls that can adapt to DPI scaling; Monitoring and notification unit: used to monitor the DPI of the interface. When the DPI changes, it sends a scaling notification instruction to the subclass.

8. The system for adaptively scaling an interface according to claim 7, characterized in that: The rewrite module includes: Calculation unit: used to obtain the current DPI scaling factor: Rewrite interface subunit: used to rewrite the display-related interfaces according to the current DPI scaling factor; Save unit: used to save the snapshot information when calling and the information of the initial defined zoom factor of 1.

0.

9. The system for adaptively scaling an interface according to claim 6, characterized in that: The scaling module comprises: Acquisition unit: used to obtain the scaling factor when the DPI of the display interface changes; Transfer unit: used to pass the scaling factor to all subclasses corresponding to the scaling interface step by step; Scaling execution unit: used to synchronously scale the display interface and all components within the interface.

10. The system for adaptively scaling an interface according to claim 6, characterized in that: Also includes: Delayed response unit: when facing multiple displays with changing DOI, adaptive scaling is performed only on the display interface within the target display, and non-target displays passing through the process are all delayed in response and no adaptive scaling is performed.

Citation Information

Patent Citations

  • Icon display method and system

    CN106445332A

  • Zoom processing method and device

    CN108734656A

  • Multi-level display method and device for child controls in nested parent control

    CN111176768A

  • Screen control zooming method and device, and mobile terminal equipment

    CN111522489A

  • Method and device for presenting hierarchical relationship of view components

    CN113835791A