CN111045764B - Interface adaptation method and device, electronic equipment and storage medium - Google Patents

Interface adaptation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111045764B
CN111045764B CN201911132062.7A CN201911132062A CN111045764B CN 111045764 B CN111045764 B CN 111045764B CN 201911132062 A CN201911132062 A CN 201911132062A CN 111045764 B CN111045764 B CN 111045764B
Authority
CN
China
Prior art keywords
interface
screen
pixel value
adaptation
parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911132062.7A
Other languages
Chinese (zh)
Other versions
CN111045764A (en
Inventor
代其祥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Joy Yangfan Technology Co ltd
Original Assignee
Beijing Joy Yangfan Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Joy Yangfan Technology Co ltd filed Critical Beijing Joy Yangfan Technology Co ltd
Priority to CN201911132062.7A priority Critical patent/CN111045764B/en
Publication of CN111045764A publication Critical patent/CN111045764A/en
Application granted granted Critical
Publication of CN111045764B publication Critical patent/CN111045764B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the invention discloses an interface adaptation method, an interface adaptation device, electronic equipment and a storage medium, relates to the technical field of computers, and can effectively achieve the compatibility of the adaptation complexity and the adaptation effect of a user interface. The method comprises the following steps: acquiring a screen adaptation parameter of a rectangular screen of a display device, wherein the screen adaptation parameter is equal to a ratio of a first pixel value to a second pixel value of the rectangular screen, and the first pixel value and the second pixel value are respectively different from each other in a horizontal pixel value and a vertical pixel value of the rectangular screen; the first pixel value is greater than or equal to the second pixel value; and if the screen adaptation parameter is larger than a first threshold value and smaller than a second threshold value, displaying the user interface to be displayed in a full screen mode in the rectangular screen according to the screen adaptation parameter, wherein the first threshold value is smaller than the second threshold value. The method is suitable for application such as interface adaptation and the like.

Description

Interface adaptation method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to an interface adaptation method, an interface adaptation device, an electronic device, and a storage medium.
Background
With the development of computer and communication technologies, various types of terminals such as mobile phones, pad, notebook computers, wearable devices and the like are endless. Each of which may in turn comprise multiple aspect ratios. In order to be able to interface presentation at the right scale on various terminals, applications need to adapt to screens of different aspect ratios.
However, some of the existing adapting schemes can achieve a satisfactory adapting effect, but the existing adapting schemes need a lot of tests and calculation, and the operation is quite complex. In contrast, simple adaptation operations are employed, but the adaptation interface is often severely distorted or incomplete.
Aiming at the problem that the complexity and the effect of the adaptation are difficult to be compatible when the user interface is adapted to screens with different aspect ratios, no effective solution exists in the related technology.
Disclosure of Invention
In view of the above, embodiments of the present invention provide an interface adaptation method, apparatus, electronic device, and storage medium, which can effectively make the adaptation complexity and the adaptation effect of the user interface compatible.
In a first aspect, an embodiment of the present invention provides an interface adaptation method, including: acquiring a screen adaptation parameter of a rectangular screen of a display device, wherein the screen adaptation parameter is equal to a ratio of a first pixel value to a second pixel value of the rectangular screen, and the first pixel value and the second pixel value are respectively different from each other in a horizontal pixel value and a vertical pixel value of the rectangular screen; the first pixel value is greater than or equal to the second pixel value; and if the screen adaptation parameter is larger than a first threshold value and smaller than a second threshold value, displaying the user interface to be displayed in a full screen mode in the rectangular screen according to the screen adaptation parameter, wherein the first threshold value is smaller than the second threshold value.
Optionally, before the user interface to be displayed is displayed in the rectangular screen in a full screen manner, the method further includes: acquiring an interface adaptation parameter of the user interface, wherein the interface adaptation parameter is equal to a ratio of a first interface pixel value to a second interface pixel value of the user interface, and the first interface pixel value and the second interface pixel value are respectively different from each other in a horizontal pixel value and a vertical pixel value of the user interface; the first interface pixel value is greater than or equal to the second interface pixel value; and determining the first threshold value and the second threshold value according to the size of the interface adaptation parameter.
Optionally, the determining the first threshold and the second threshold according to the magnitude of the interface adaptation parameter includes: and reducing the interface adaptation parameter by a first parameter to obtain the first threshold value, and increasing the interface adaptation parameter by a second parameter to obtain the second threshold value, wherein the first parameter is equal to or different from the second parameter.
Optionally, after the acquiring the screen adaptation parameter of the rectangular screen of the display device, before the user interface to be displayed in the rectangular screen is displayed in full screen, the method further includes: if the screen adaptation parameter is smaller than or equal to the first threshold value, adjusting the interface adaptation parameter of the user interface to the first threshold value to obtain a first intermediate interface; scaling the first intermediate interface in equal proportion until the first interface pixel value of the first intermediate interface is equal to the first pixel value of the rectangular screen, and forming a first adaptive interface; and displaying the first adapting interface.
Optionally, after the forming the first adapting interface, the method further includes: and filling the gap between the rectangular screen and the first adapting interface with the background, wherein the filled background and the first adapting interface are distributed along the direction of the second pixel value of the rectangular screen.
Optionally, after the screen adaptation parameters of the rectangular screen of the display device are acquired, before the user interface to be displayed in the rectangular screen is displayed in a full screen, the method further includes: if the screen adaptation parameter is greater than or equal to the second threshold, adjusting the interface adaptation parameter of the user interface to the second threshold to obtain a second intermediate interface; scaling the second intermediate interface in equal proportion until the second interface pixel value of the second intermediate interface is equal to the second pixel value of the rectangular screen, and forming a second adaptive interface; and displaying the second adapting interface.
Optionally, after the forming the second adapting interface, the method further includes: and filling the gap between the rectangular screen and the second adapting interface with the background, wherein the filled background and the second adapting interface are distributed along the direction of the first pixel value of the rectangular screen.
In a second aspect, an embodiment of the present invention further provides an interface adapting device, including: a first obtaining unit configured to obtain a screen adaptation parameter of a rectangular screen of a display device, where the screen adaptation parameter is equal to a ratio of a first pixel value to a second pixel value of the rectangular screen, the first pixel value and the second pixel value being different from each other in a horizontal pixel value and a vertical pixel value of the rectangular screen, respectively; the first pixel value is greater than or equal to the second pixel value; and the display unit is used for displaying the user interface to be displayed in a full screen mode in the rectangular screen according to the screen adaptation parameter if the screen adaptation parameter is larger than a first threshold value and smaller than a second threshold value, wherein the first threshold value is smaller than the second threshold value.
Optionally, the apparatus further includes: a second obtaining unit, configured to obtain an interface adaptation parameter of a user interface to be displayed before the user interface is displayed in full screen in the rectangular screen, where the interface adaptation parameter is equal to a ratio of a first interface pixel value to a second interface pixel value of the user interface, where the first interface pixel value and the second interface pixel value are respectively different from each other in a horizontal pixel value and a vertical pixel value of the user interface; the first interface pixel value is greater than or equal to the second interface pixel value; and the determining unit is used for determining the first threshold value and the second threshold value according to the magnitude of the interface adaptation parameter.
Optionally, the determining unit is specifically configured to: and reducing the interface adaptation parameter by a first parameter to obtain the first threshold value, and increasing the interface adaptation parameter by a second parameter to obtain the second threshold value, wherein the first parameter is equal to or different from the second parameter.
Optionally, the apparatus further includes: the first adjusting unit is used for adjusting the interface adaptation parameters of the user interface to the first threshold value to obtain a first interface if the screen adaptation parameters are smaller than or equal to the first threshold value before the user interface to be displayed in the rectangular screen is displayed in a full screen after the screen adaptation parameters of the rectangular screen of the display device are obtained; the first scaling unit is used for scaling the first interface in equal proportion until the first interface pixel value of the first interface is equal to the first pixel value of the rectangular screen, so as to form a first adaptive interface; the display unit is further used for displaying the first adaptation interface.
Optionally, the apparatus further includes: and the first filling unit is used for filling the background at the gap between the rectangular screen and the first adapting interface after the first adapting interface is formed, and the filled background and the first adapting interface are distributed along the direction of the second pixel value of the rectangular screen.
Optionally, the apparatus further includes: the second adjusting unit is used for adjusting the interface adaptation parameters of the user interface to the second threshold value to obtain a second interface if the screen adaptation parameters are larger than or equal to the second threshold value before the user interface to be displayed in the rectangular screen is displayed in a full screen after the screen adaptation parameters of the rectangular screen of the display device are acquired; the second scaling unit is used for scaling the second interface in equal proportion until the second interface pixel value of the second interface is equal to the second pixel value of the rectangular screen, so as to form a second adaptive interface; the display unit is further used for displaying the second adaptation interface.
Optionally, the device further includes a second filling unit, configured to fill a background at a gap between the rectangular screen and the second adapting interface after the second adapting interface is formed, where the filled background and the second adapting interface are distributed along the direction of the first pixel value of the rectangular screen.
In a third aspect, embodiments of the present invention further provide an electronic device, including: the device comprises a shell, a processor, a memory, a circuit board and a power circuit, wherein the circuit board is arranged in a space surrounded by the shell, and the processor and the memory are arranged on the circuit board; a power supply circuit for supplying power to each circuit or device of the electronic apparatus; the memory is used for storing executable program codes; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, for executing any one of the interface adaptation methods provided by the embodiments of the present invention.
In a fourth aspect, embodiments of the present invention also provide a computer-readable storage medium storing one or more programs executable by one or more processors to implement any of the interface adaptation methods provided by the embodiments of the present invention.
According to the interface adaptation method, the device, the electronic equipment and the storage medium, screen adaptation parameters of the rectangular screen of the display equipment can be obtained, if the screen adaptation parameters are larger than the first threshold and smaller than the second threshold, full-screen display is carried out on the user interface to be displayed in the rectangular screen according to the screen adaptation parameters, so that an ideal full-screen display effect can be obtained for the screen with the aspect ratio in a certain range without adjusting the aspect ratio of the user interface to adapt to the size of the screen, the workload of interface adaptation operation is greatly reduced while the display effect is ensured, and therefore the adaptation complexity and the adaptation effect of the user interface to the screen are both considered.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of an interface adaptation method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an effect of performing interface adaptation by applying the interface adaptation method provided by the embodiment of the invention;
FIG. 3 is a schematic diagram showing another effect of performing interface adaptation by applying the interface adaptation method provided by the embodiment of the present invention;
FIG. 4 is a schematic view of still another effect of performing interface adaptation by applying the interface adaptation method provided by the embodiment of the present invention;
FIG. 5 is a schematic view of still another effect of performing interface adaptation by applying the interface adaptation method provided by the embodiment of the present invention;
FIG. 6 is a schematic diagram of still another effect of performing interface adaptation by applying the interface adaptation method provided by the embodiment of the present invention;
FIG. 7 is a schematic view of still another effect of performing interface adaptation by applying the interface adaptation method according to the embodiment of the present invention;
FIG. 8 is a schematic view of still another effect of performing interface adaptation by applying the interface adaptation method provided by the embodiment of the present invention;
FIG. 9 is a schematic diagram of still another effect of performing interface adaptation by applying the interface adaptation method provided by the embodiment of the present invention;
FIG. 10 is a schematic structural diagram of an interface adapting device according to an embodiment of the present invention;
Fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
It should be understood that the described embodiments are merely some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In a first aspect, an embodiment of the present invention provides an interface adaptation method, which can make the adaptation complexity and the adaptation effect of a user interface on a screen compatible.
As shown in fig. 1, an interface adaptation method provided by an embodiment of the present invention may include:
s11, acquiring screen adaptation parameters of a rectangular screen of a display device, wherein the screen adaptation parameters are equal to the ratio of a first pixel value to a second pixel value of the rectangular screen, and the first pixel value and the second pixel value are respectively different from each other in a horizontal pixel value and a vertical pixel value of the rectangular screen; the first pixel value is greater than or equal to the second pixel value;
Alternatively, the display device may be a mobile phone, pad, notebook, desktop computer, smart wearable device, or other various terminals with display screens.
Alternatively, depending on the placement position of the display device or the screen design, the screen adaptation parameter may refer to the aspect ratio, or the aspect ratio, of the rectangular screen of the display device, as long as the pixel value ratio of one side of the larger pixel value to one side of the smaller pixel value (or two equal pixel value sides). For example, common screen adaptation parameters may include: 4:3, 16:9, 16:10, 5:4, 2:1, etc. Here, the width may refer to a side of the rectangular screen in the horizontal direction (corresponding to a horizontal pixel value), and the height may refer to a side of the rectangular screen perpendicular to the width (corresponding to a vertical pixel value).
And S12, if the screen adaptation parameter is larger than a first threshold value and smaller than a second threshold value, displaying the user interface to be displayed in a full screen mode in the rectangular screen according to the screen adaptation parameter, wherein the first threshold value is smaller than the second threshold value.
The first threshold and the second threshold are preset two parameter values, and are used for demarcating the screen adaptation parameters, wherein the first threshold is smaller than the second threshold. Alternatively, the specific values of the first threshold and the second threshold may be determined according to specific needs. For example, in one embodiment of the present invention, the first threshold and the second threshold may be determined as a ratio of pixel values of two screens that are more common on the market, e.g., the first threshold is 4:3 and the second threshold is 2:1.
The user interface to be displayed may refer to any user interface that needs to be displayed on a rectangular screen of the display device, such as a desktop, an interface of an application program, a file page, and the like.
Alternatively, in one embodiment of the present invention, if the screen adaptation parameter of one display device is 16:9, greater than the first threshold value 4:3 and less than the second threshold value 2:1, the user interface to be presented may be directly displayed in full screen on the screen of the display device. Because the screen adaptation parameter of the display device is between the first threshold value and the second threshold value, that is, the aspect ratio of the screen of the display device is in a relatively suitable middle range, the user interface can be directly displayed in a full screen without adjusting the aspect ratio of the user interface, and the user interface does not generate excessive deformation or distortion in the screen.
As shown in fig. 2 and 3, when the screen adaptation parameter of the display device is located between the first threshold value and the second threshold value, the user interface is displayed on both screens in a full screen manner, and the user interface does not generate serious distortion. Alternatively, even in extreme cases, some interfaces or buttons may be displayed with imperfections, requiring only fine tuning of the shape and/or position of the interface or button.
According to the interface adaptation method provided by the embodiment of the invention, the screen adaptation parameters of the rectangular screen of the display device can be obtained, if the screen adaptation parameters are larger than the first threshold and smaller than the second threshold, the user interface to be displayed is displayed in the rectangular screen in a full screen mode according to the screen adaptation parameters, so that an ideal full screen display effect can be obtained for the screen with the aspect ratio in a certain range without adjusting the aspect ratio of the user interface to adapt to the size of the screen, the display effect is ensured, the workload of interface adaptation operation is greatly reduced, and the adaptation complexity and the adaptation effect of the user interface to the screen are both considered.
Alternatively, the user interface is an interface displayed on a screen, the specific size of which may vary widely depending on the design of the user interface. In one embodiment of the invention, the user interface may be configured to accommodate as wide a range of different aspect ratio screens as possible, with a relatively popular market, high number of terminals having aspect ratio aspects.
In the embodiment of the invention, when the screen adaptation parameter of the display device is between the first threshold value and the second threshold value, the user interface can be directly displayed on the screen of the display device in a full screen mode without generating excessive distortion or deformation, and for this reason, the first threshold value and the second threshold value can be set to appropriate values.
For example, in one embodiment of the present invention, before the user interface to be displayed is displayed in the rectangular screen in full screen, step S12 may further include:
acquiring an interface adaptation parameter of the user interface, wherein the interface adaptation parameter is equal to a ratio of a first interface pixel value to a second interface pixel value of the user interface, and the first interface pixel value and the second interface pixel value are respectively different from each other in a horizontal pixel value and a vertical pixel value of the user interface; the first interface pixel value is greater than or equal to the second interface pixel value;
and determining the first threshold value and the second threshold value according to the size of the interface adaptation parameter.
That is, the first threshold and the second threshold may be determined according to the interface adaptation parameters of the user interface to be displayed, so that the first threshold and the second threshold do not deviate too far from the interface adaptation parameters of the user interface, and it is ensured that the user interface displayed in full screen is not excessively deformed or distorted. In this embodiment, the definition of the first interface pixel value and the second interface pixel value is similar to the definition of the first pixel value and the second pixel value of the rectangular screen in the foregoing embodiment, except that the object is changed from the screen to the interface.
Optionally, in an embodiment of the present invention, determining the first threshold and the second threshold according to the magnitude of the interface adaptation parameter may include: and reducing the interface adaptation parameter by a first parameter to obtain the first threshold value, and increasing the interface adaptation parameter by a second parameter to obtain the second threshold value, wherein the first parameter is equal to or different from the second parameter.
For example, in one embodiment of the present invention, if the interface adaptation parameter of a user interface is 16:10=1.6, the first threshold may be set to 1.3, the second threshold may be set to 1.9 (both the first parameter and the second parameter are 0.3), the first threshold may be set to 1.3, the second threshold may be set to 1.8 (the first parameter is 0.3, the second parameter is 0.2), the first threshold may be set to 1.5, the second threshold may be set to 1.9 (the first parameter is 0.1, the second parameter is 0.3), and so on.
Alternatively, in an embodiment of the present invention, the specific values of the first parameter and the second parameter may be different according to the specific content of the user interface, the size and distribution of the controls on the interface, and the display accuracy requirement of the interface. For example, if the content and controls of the user interface are both centrally distributed in a central region of the interface, the user interface is less sensitive to changes in aspect ratio, and the first parameter and the second parameter may be set to larger values. If some of the content and controls of the user interface are distributed in the edge region of the interface, the user interface is more sensitive to changes in aspect ratio, and the first parameter and the second parameter can be set to smaller values.
The above embodiment describes the case of interface adaptation of the screen adaptation parameter between the first threshold and the second threshold, but the embodiment of the present invention is not limited thereto. In other embodiments of the present invention, the technical effect of both the adaptation complexity and the adaptation effect may be achieved when the screen adaptation parameter is smaller than or equal to the first threshold value and the screen adaptation parameter is greater than or equal to the second threshold value.
Optionally, after acquiring the screen adaptation parameters of the rectangular screen of the display device in step S11, before performing full-screen display on the user interface to be displayed in the rectangular screen in step S12, the interface adaptation method provided by the embodiment of the present invention may further include:
if the screen adaptation parameter is smaller than or equal to the first threshold value, adjusting the interface adaptation parameter of the user interface to the first threshold value to obtain a first intermediate interface;
scaling the first intermediate interface in equal proportion until the first interface pixel value of the first intermediate interface is equal to the first pixel value of the rectangular screen, and forming a first adaptive interface;
the first interface is displayed.
For example, as shown in fig. 4, in one embodiment of the present invention, the interface adaptation parameter of the user interface is 1.4, the screen adaptation parameter of the display device is 1.1, which is smaller than the first threshold value 1.3, and then the interface adaptation parameter of the user interface may be adjusted from 1.4 to 1.3, so that the width of the user interface is properly reduced, the height is properly increased, and a first intermediate interface is obtained, and then the first intermediate interface is scaled in a width-height equal ratio until the first interface pixel value of the first intermediate interface is equal to the first pixel value of the rectangular screen, so as to form a first adaptation interface, that is, the width of the first adaptation interface is equal to the width of the rectangular screen of the display device.
In this way, when the interface is used for adapting the screen, the user interface is not required to perform complex adapting operation on the display devices with all the screen adapting parameters (such as the aspect ratio) one by one, but the display devices with all the screen adapting parameters smaller than the first threshold value are regarded as one type, and each time the user interface is required to adapt the display devices, the user interface is only required to adjust the interface adapting parameters (such as the aspect ratio) of the user interface to the first threshold value, so that the interface adapting operation is greatly simplified.
Moreover, the first threshold value is closer to the interface adaptation parameters of the user interface than to the screen adaptation parameters, and thus, adjusting the user interface to the first threshold value makes less changes to the interface layout, which is relatively simple to operate. Although there is still a difference between the first threshold value and the screen adaptation parameter, so that a gap is still left when the first adaptation interface is displayed on the display device, and the whole screen is not fully occupied, the display effect of the user interface is limited due to the fact that the gap is small in the screen. Therefore, in general, the method for adapting the interface to the screen provided by the embodiment of the invention greatly simplifies the adaptation complexity and simultaneously obtains the ideal adaptation effect, thereby effectively enabling the two to be combined.
In this embodiment, in order to trade-off between the adaptation complexity and the adaptation effect, the resulting first adaptation interface does not occupy the whole screen of the display device. In order to further improve the visual experience of the user interface, as shown in fig. 5, after forming the first adapting interface, the method for adapting the screen of the interface provided by the embodiment of the invention may further include:
and filling the gap between the rectangular screen and the first adapting interface with the background, wherein the filled background and the first adapting interface are distributed along the direction of the second pixel value of the rectangular screen.
For example, another schematic diagram with a screen adaptation parameter smaller than the first threshold may be as shown in fig. 6.
In the embodiment, the adaptation condition when the screen adaptation parameter is smaller than or equal to the first threshold is described, and in other embodiments of the present invention, when the screen adaptation parameter is larger than or equal to the second threshold, the technical effect that the adaptation complexity and the adaptation effect are both achieved can also be achieved.
Optionally, after acquiring the screen adaptation parameters of the rectangular screen of the display device in step S11, before performing full-screen display on the user interface to be displayed in the rectangular screen in step S12, the interface adaptation method provided by the embodiment of the present invention may further include:
If the screen adaptation parameter is greater than or equal to the second threshold, adjusting the interface adaptation parameter of the user interface to the second threshold to obtain a second intermediate interface;
scaling the second intermediate interface in equal proportion until the second interface pixel value of the second intermediate interface is equal to the second pixel value of the rectangular screen, and forming a second adaptive interface;
a second adaptation interface is displayed.
For example, as shown in fig. 7, in one embodiment of the present invention, the interface adaptation parameter of the user interface is 1.4, the screen adaptation parameter of the display device is 1.8, and is greater than the second threshold value of 1.6, the interface adaptation parameter of the user interface may be adjusted from 1.4 to 1.6, so that the width of the user interface is properly increased, the height of the user interface is properly reduced, and a second intermediate interface is obtained, and then the second intermediate interface is scaled in a width-height equal ratio until the second interface pixel value of the second intermediate interface is equal to the second pixel value of the rectangular screen, so as to form a second adaptation interface, that is, the height of the second adaptation interface is equal to the height of the rectangular screen of the display device.
In this way, when the interface is used for adapting the screen, the user interface is not required to perform complex adapting operation on the display devices with all the screen adapting parameters (such as the aspect ratio) one by one, but the display devices with all the screen adapting parameters larger than the second threshold are regarded as one type, and each time the user interface is required to adapt the display devices, the user interface is only required to adjust the interface adapting parameters (such as the aspect ratio) of the user interface to the second threshold, so that the interface adapting operation is greatly simplified.
Moreover, the second threshold value is closer to the interface adaptation parameters of the user interface than to the screen adaptation parameters, and thus, adjusting the user interface to the second threshold value makes less changes to the interface layout, which is relatively simple to operate. Although there is still a difference between the second threshold value and the screen adaptation parameter, so that a gap is still left when the second adaptation interface is displayed on the display device and the whole screen is not fully occupied, the display effect of the user interface is limited due to the fact that the gap is small in the screen. Therefore, in general, the method for adapting the interface to the screen provided by the embodiment of the invention greatly simplifies the adaptation complexity and simultaneously obtains the ideal adaptation effect, thereby effectively enabling the two to be combined.
In this embodiment, in order to trade-off between the adaptation complexity and the adaptation effect, the resulting first adaptation interface does not occupy the whole screen of the display device. In order to further improve the visual effect of the user interface, as shown in fig. 8, after forming the second adapting interface, the method for adapting the screen of the interface provided by the embodiment of the invention may further include:
and filling the gap between the rectangular screen and the second adapting interface with the background, wherein the filled background and the second adapting interface are distributed along the direction of the first pixel value of the rectangular screen.
For example, another schematic diagram with a screen adaptation parameter smaller than the first threshold may be as shown in fig. 9.
The interface adaptation method provided by the embodiment of the invention divides the screens of various display devices into three types, for one type, the full screen display is directly carried out without adjusting the aspect ratio or the aspect ratio of the user interface, for the other two types, the user interface is only required to be adjusted into two fixed aspect ratios or the aspect ratios, and the adaptation adjustment of the user interface is not carried out on the screens with different proportions, so that the complexity of the adaptation operation is greatly simplified. In addition, as the screens are properly classified according to the screen adaptation parameters (namely the aspect ratio or the aspect ratio), when the three types of screens are adapted, the user interface is adjusted to be in a relatively close proportion, and the interface cannot generate excessive deformation or distortion, so that the adaptation effect of the interface is effectively ensured.
It should be noted that in the above embodiment, when the user interface is displayed in full screen, or when the user interface is adjusted to be the first intermediate interface or the second intermediate interface, fine adjustment may be performed on the content, the size and/or the layout in the user interface, so as to obtain better user experience.
In a second aspect, an embodiment of the present invention further provides an interface adapting device, which can make the user interface achieve both of the complexity of the screen adaptation and the effect of the screen adaptation.
As shown in fig. 10, an interface adapting device provided by an embodiment of the present invention may include:
a first obtaining unit 31, configured to obtain a screen adaptation parameter of a rectangular screen of a display device, where the screen adaptation parameter is equal to a ratio of a first pixel value to a second pixel value of the rectangular screen, and the first pixel value and the second pixel value are respectively different from each other in a horizontal pixel value and a vertical pixel value of the rectangular screen; the first pixel value is greater than or equal to the second pixel value;
and the display unit 32 is configured to perform full-screen display on the user interface to be displayed in the rectangular screen according to the screen adaptation parameter if the screen adaptation parameter is greater than a first threshold and less than a second threshold, where the first threshold is less than the second threshold.
According to the interface adaptation device provided by the embodiment of the invention, the screen adaptation parameters of the rectangular screen of the display equipment can be obtained, if the screen adaptation parameters are larger than the first threshold and smaller than the second threshold, the user interface to be displayed is displayed in the rectangular screen in a full screen mode according to the screen adaptation parameters, so that an ideal full screen display effect can be obtained for the screen with the aspect ratio in a certain range without adjusting the aspect ratio of the user interface to adapt to the size of the screen, the display effect is ensured, the workload of interface adaptation operation is greatly reduced, and the adaptation complexity and the adaptation effect of the user interface to the screen are both considered.
Optionally, the apparatus may further include:
a second obtaining unit, configured to obtain an interface adaptation parameter of a user interface to be displayed before the user interface is displayed in full screen in the rectangular screen, where the interface adaptation parameter is equal to a ratio of a first interface pixel value to a second interface pixel value of the user interface, where the first interface pixel value and the second interface pixel value are respectively different from each other in a horizontal pixel value and a vertical pixel value of the user interface; the first interface pixel value is greater than or equal to the second interface pixel value;
and the determining unit is used for determining the first threshold value and the second threshold value according to the magnitude of the interface adaptation parameter.
Alternatively, the determining unit may specifically be configured to: and reducing the interface adaptation parameter by a first parameter to obtain the first threshold value, and increasing the interface adaptation parameter by a second parameter to obtain the second threshold value, wherein the first parameter is equal to or different from the second parameter.
Optionally, the apparatus may further include:
the first adjusting unit is used for adjusting the interface adaptation parameters of the user interface to the first threshold value to obtain a first intermediate interface if the screen adaptation parameters are smaller than or equal to the first threshold value before the user interface to be displayed in the rectangular screen is displayed in a full screen after the screen adaptation parameters of the rectangular screen of the display device are acquired;
And the first scaling unit is used for scaling the first intermediate interface in equal proportion until the first interface pixel value of the first intermediate interface is equal to the first pixel value of the rectangular screen, so as to form a first adaptive interface.
The display unit is further used for displaying the first adaptation interface.
Optionally, the apparatus may further include a first filling unit configured to fill a background at a gap between the rectangular screen and the first adapting interface after the first adapting interface is formed, and the filled background is distributed along a direction of a second pixel value of the rectangular screen together with the first adapting interface.
Optionally, the apparatus may further include:
the second adjusting unit is used for adjusting the interface adaptation parameters of the user interface to the second threshold value to obtain a second intermediate interface if the screen adaptation parameters are larger than or equal to the second threshold value before the user interface to be displayed in the rectangular screen is displayed in a full screen after the screen adaptation parameters of the rectangular screen of the display device are acquired;
the second scaling unit is used for scaling the second intermediate interface in equal proportion until the second interface pixel value of the second intermediate interface is equal to the second pixel value of the rectangular screen, so as to form a second adaptive interface;
The display unit is further used for displaying the second adaptation interface.
Optionally, the apparatus may further include a second filling unit, configured to fill a background at a gap between the rectangular screen and the second adapting interface after the second adapting interface is formed, where the filled background is distributed along a direction of the first pixel value of the rectangular screen together with the second adapting interface.
In a third aspect, an embodiment of the present invention further provides an electronic device, which can effectively improve accuracy of moving track drawing.
As shown in fig. 11, an electronic device provided by an embodiment of the present invention may include: the processor 52 and the memory 53 are arranged on the circuit board 54, wherein the circuit board 54 is arranged in a space surrounded by the shell 51; a power supply circuit 55 for supplying power to the respective circuits or devices of the above-described electronic apparatus; the memory 53 is for storing executable program code; the processor 52 executes a program corresponding to the executable program code by reading the executable program code stored in the memory 53 for executing the movement trace drawing method provided in any of the foregoing embodiments.
The specific implementation of the above steps by the processor 52 and the further implementation of the steps by the processor 52 through the execution of the executable program code may be referred to the description of the foregoing embodiments, and will not be repeated here.
Such electronic devices exist in a variety of forms including, but not limited to:
(1) A mobile communication device: such devices are characterized by mobile communication capabilities and are primarily aimed at providing voice, data communications. Such terminals include: smart phones (e.g., iPhone), multimedia phones, functional phones, and low-end phones, etc.
(2) Ultra mobile personal computer device: such devices are in the category of personal computers, having computing and processing functions, and generally also having mobile internet access characteristics. Such terminals include: PDA, MID, and UMPC devices, etc., such as iPad.
(3) Portable entertainment device: such devices may display and play multimedia content. The device comprises: audio, video players (e.g., iPod), palm game consoles, electronic books, and smart toys and portable car navigation devices.
(4) And (3) a server: the configuration of the server includes a processor, a hard disk, a memory, a system bus, and the like, and the server is similar to a general computer architecture, but is required to provide highly reliable services, and thus has high requirements in terms of processing capacity, stability, reliability, security, scalability, manageability, and the like.
(5) Other electronic devices with data interaction functions.
Accordingly, embodiments of the present invention further provide a computer readable storage medium storing one or more programs, where the one or more programs may be executed by one or more processors to implement any one of the moving track drawing methods provided in the foregoing embodiments, so that corresponding technical effects may be achieved, and the foregoing details have been set forth herein and are not repeated herein.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments.
In particular, for the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments in part.
For convenience of description, the above apparatus is described as being functionally divided into various units/modules, respectively. Of course, the functions of the various elements/modules may be implemented in the same piece or pieces of software and/or hardware when implementing the present invention.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), or the like.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any changes or substitutions easily contemplated by those skilled in the art within the scope of the present invention should be included in the present invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.

Claims (12)

1. An interface adaptation method, comprising:
acquiring a screen adaptation parameter of a rectangular screen of a display device, wherein the screen adaptation parameter is equal to a ratio of a first pixel value to a second pixel value of the rectangular screen, and the first pixel value and the second pixel value are respectively different from each other in a horizontal pixel value and a vertical pixel value of the rectangular screen; the first pixel value is greater than or equal to the second pixel value;
if the screen adaptation parameter is larger than a first threshold value and smaller than a second threshold value, displaying a user interface to be displayed in a full screen in the rectangular screen according to the screen adaptation parameter, wherein the first threshold value is smaller than the second threshold value;
before the user interface to be displayed is displayed in the rectangular screen in a full screen mode, the method further comprises the following steps:
Acquiring an interface adaptation parameter of the user interface, wherein the interface adaptation parameter is equal to a ratio of a first interface pixel value to a second interface pixel value of the user interface, and the first interface pixel value and the second interface pixel value are respectively different from each other in a horizontal pixel value and a vertical pixel value of the user interface; the first interface pixel value is greater than or equal to the second interface pixel value;
determining the first threshold value and the second threshold value according to the size of the interface adaptation parameter;
after the screen adaptation parameters of the rectangular screen of the display device are acquired, before the user interface to be displayed in the rectangular screen is displayed in a full screen mode, the method further comprises:
if the screen adaptation parameter is smaller than or equal to the first threshold value, adjusting the interface adaptation parameter of the user interface to the first threshold value to obtain a first intermediate interface;
scaling the first intermediate interface in equal proportion until the first interface pixel value of the first intermediate interface is equal to the first pixel value of the rectangular screen, and forming a first adaptive interface;
and displaying the first adapting interface.
2. The method of claim 1, wherein the determining the first threshold and the second threshold according to the magnitude of the interface adaptation parameter comprises:
and reducing the interface adaptation parameter by a first parameter to obtain the first threshold value, and increasing the interface adaptation parameter by a second parameter to obtain the second threshold value, wherein the first parameter is equal to or different from the second parameter.
3. The method of claim 1, wherein after the forming the first mating interfaceThe method further comprises the steps of:
and filling the gap between the rectangular screen and the first adapting interface with the background, wherein the filled background and the first adapting interface are distributed along the direction of the second pixel value of the rectangular screen.
4. The method of claim 1, wherein after the obtaining the screen adaptation parameter of the rectangular screen of the display device, before the user interface to be displayed in the rectangular screen is displayed in full screen, the method further comprises:
if the screen adaptation parameter is greater than or equal to the second threshold, adjusting the interface adaptation parameter of the user interface to the second threshold to obtain a second intermediate interface;
Scaling the second intermediate interface in equal proportion until the second interface pixel value of the second intermediate interface is equal to the second pixel value of the rectangular screen, and forming a second adaptive interface;
and displaying the second adapting interface.
5. The method of claim 4, wherein after the forming the second mating interface, the method further comprises:
and filling the gap between the rectangular screen and the second adapting interface with the background, wherein the filled background and the second adapting interface are distributed along the direction of the first pixel value of the rectangular screen.
6. An interface adaptation device, comprising:
a first obtaining unit configured to obtain a screen adaptation parameter of a rectangular screen of a display device, where the screen adaptation parameter is equal to a ratio of a first pixel value to a second pixel value of the rectangular screen, the first pixel value and the second pixel value being different from each other in a horizontal pixel value and a vertical pixel value of the rectangular screen, respectively; the first pixel value is greater than or equal to the second pixel value;
the display unit is used for displaying the user interface to be displayed in a full screen mode in the rectangular screen according to the screen adaptation parameters if the screen adaptation parameters are larger than a first threshold value and smaller than a second threshold value, wherein the first threshold value is smaller than the second threshold value;
Further comprises:
a second obtaining unit, configured to obtain an interface adaptation parameter of a user interface to be displayed before the user interface is displayed in full screen in the rectangular screen, where the interface adaptation parameter is equal to a ratio of a first interface pixel value to a second interface pixel value of the user interface, where the first interface pixel value and the second interface pixel value are respectively different from each other in a horizontal pixel value and a vertical pixel value of the user interface; the first interface pixel value is greater than or equal to the second interface pixel value;
the determining unit is used for determining the first threshold value and the second threshold value according to the magnitude of the interface adaptation parameter;
further comprises:
the first adjusting unit is used for adjusting the interface adaptation parameters of the user interface to the first threshold value to obtain a first interface if the screen adaptation parameters are smaller than or equal to the first threshold value before the user interface to be displayed in the rectangular screen is displayed in a full screen after the screen adaptation parameters of the rectangular screen of the display device are obtained;
the first scaling unit is used for scaling the first interface in equal proportion until the first interface pixel value of the first interface is equal to the first pixel value of the rectangular screen, so as to form a first adaptive interface;
The display unit is further used for displaying the first adaptation interface.
7. The apparatus according to claim 6, wherein the determining unit is specifically configured to:
and reducing the interface adaptation parameter by a first parameter to obtain the first threshold value, and increasing the interface adaptation parameter by a second parameter to obtain the second threshold value, wherein the first parameter is equal to or different from the second parameter.
8. The apparatus according to claim 6, further comprising a first filling unit for performing background filling at a gap between the rectangular screen and the first adaptation interface after forming the first adaptation interface, the filled background being distributed along a direction of the second pixel value of the rectangular screen together with the first adaptation interface.
9. The apparatus as recited in claim 6, further comprising:
the second adjusting unit is used for adjusting the interface adaptation parameters of the user interface to the second threshold value to obtain a second interface if the screen adaptation parameters are larger than or equal to the second threshold value before the user interface to be displayed in the rectangular screen is displayed in a full screen after the screen adaptation parameters of the rectangular screen of the display device are acquired;
The second scaling unit is used for scaling the second interface in equal proportion until the second interface pixel value of the second interface is equal to the second pixel value of the rectangular screen, so as to form a second adaptive interface;
the display unit is further used for displaying the second adaptation interface.
10. The apparatus according to claim 9, further comprising a second filling unit for performing background filling at a gap between the rectangular screen and the second adaptation interface after forming the second adaptation interface, the filled background being distributed along a direction of the first pixel value of the rectangular screen together with the second adaptation interface.
11. An electronic device, the electronic device comprising: the device comprises a shell, a processor, a memory, a circuit board and a power circuit, wherein the circuit board is arranged in a space surrounded by the shell, and the processor and the memory are arranged on the circuit board; a power supply circuit for supplying power to each circuit or device of the electronic apparatus; the memory is used for storing executable program codes; a processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory for performing the interface adaptation method of any of the preceding claims 1-5.
12. A computer readable storage medium storing one or more programs executable by one or more processors to implement the interface adaptation method of any one of the preceding claims 1 to 5.
CN201911132062.7A 2019-11-18 2019-11-18 Interface adaptation method and device, electronic equipment and storage medium Active CN111045764B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911132062.7A CN111045764B (en) 2019-11-18 2019-11-18 Interface adaptation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911132062.7A CN111045764B (en) 2019-11-18 2019-11-18 Interface adaptation method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111045764A CN111045764A (en) 2020-04-21
CN111045764B true CN111045764B (en) 2023-09-08

Family

ID=70232169

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911132062.7A Active CN111045764B (en) 2019-11-18 2019-11-18 Interface adaptation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111045764B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101192129A (en) * 2006-11-30 2008-06-04 重庆优腾信息技术有限公司 Table top background control method, device and system
CN102486918A (en) * 2010-12-02 2012-06-06 鸿富锦精密工业(深圳)有限公司 Adjusting system and method of display device
CN103970436A (en) * 2013-01-25 2014-08-06 人人游戏网络科技发展(上海)有限公司 Method and device for displaying on screen of electronic equipment
CN105653254A (en) * 2014-12-03 2016-06-08 科大讯飞股份有限公司 Native interface adaptive method, apparatus and electronic equipment employing same
WO2017084615A1 (en) * 2015-11-20 2017-05-26 北京金山安全软件有限公司 Information showing method and apparatus, and electronic device
CN107678672A (en) * 2017-09-30 2018-02-09 维沃移动通信有限公司 A kind of display processing method and mobile terminal
CN108628656A (en) * 2018-05-09 2018-10-09 平安普惠企业管理有限公司 Interface adaptation method, device, computer equipment and storage medium on ios device
CN109992337A (en) * 2017-12-29 2019-07-09 杭州海康威视系统技术有限公司 Webpage methods of exhibiting, device and storage medium
CN110286868A (en) * 2019-06-28 2019-09-27 北京金山安全软件有限公司 Video display adjustment method and device, electronic equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102377960B (en) * 2010-08-24 2014-11-05 腾讯科技(深圳)有限公司 Video picture displaying method and device
CN103546715A (en) * 2013-10-30 2014-01-29 乐视致新电子科技(天津)有限公司 Method and device for adjusting proportion of picture of smart television
US20190012067A1 (en) * 2017-07-10 2019-01-10 Canon Kabushiki Kaisha Image displaying apparatus, image display method, and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101192129A (en) * 2006-11-30 2008-06-04 重庆优腾信息技术有限公司 Table top background control method, device and system
CN102486918A (en) * 2010-12-02 2012-06-06 鸿富锦精密工业(深圳)有限公司 Adjusting system and method of display device
CN103970436A (en) * 2013-01-25 2014-08-06 人人游戏网络科技发展(上海)有限公司 Method and device for displaying on screen of electronic equipment
CN105653254A (en) * 2014-12-03 2016-06-08 科大讯飞股份有限公司 Native interface adaptive method, apparatus and electronic equipment employing same
WO2017084615A1 (en) * 2015-11-20 2017-05-26 北京金山安全软件有限公司 Information showing method and apparatus, and electronic device
CN107678672A (en) * 2017-09-30 2018-02-09 维沃移动通信有限公司 A kind of display processing method and mobile terminal
CN109992337A (en) * 2017-12-29 2019-07-09 杭州海康威视系统技术有限公司 Webpage methods of exhibiting, device and storage medium
CN108628656A (en) * 2018-05-09 2018-10-09 平安普惠企业管理有限公司 Interface adaptation method, device, computer equipment and storage medium on ios device
CN110286868A (en) * 2019-06-28 2019-09-27 北京金山安全软件有限公司 Video display adjustment method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111045764A (en) 2020-04-21

Similar Documents

Publication Publication Date Title
CN108211352B (en) Method and terminal for adjusting image quality
CN111552530B (en) Terminal screen adaptation method, device and equipment of user interface
CN107122107B (en) Visual angle adjusting method, device, medium and electronic equipment in virtual scene
US20170168705A1 (en) Method and electronic device for adjusting video progress
CN107357544B (en) Display method, display device, intelligent terminal and computer readable storage medium
US11924520B2 (en) Subtitle border-crossing processing method and apparatus, and electronic device
WO2020211422A1 (en) Video processing method and apparatus, and device
CN111330275B (en) Interaction method and device in game, storage medium and electronic equipment
CN105930464B (en) Web rich media cross-screen adaptation method and device
US10210630B2 (en) Picture compression method and apparatus, and mobile terminal
CN112988021B (en) Display method, display device, electronic equipment and computer-readable storage medium
JP7164637B2 (en) Volume display method, device, terminal device and storage medium
US20170171491A1 (en) Method and Electronic Device for Adjusting Video Subtitles
CN107978014B (en) Particle rendering method and device, electronic equipment and storage medium
CN109743625A (en) A kind of method for processing video frequency and television set
CN111045764B (en) Interface adaptation method and device, electronic equipment and storage medium
CN104516696B (en) A kind of information processing method and electronic equipment
US20170150014A1 (en) Method and electronic device for video denoising and detail enhancement
CN114339404B (en) Method and device for displaying screen protection wallpaper, electronic equipment and storage medium
US20220060801A1 (en) Panoramic Render of 3D Video
CN109684010B (en) Information display method and device and electronic equipment
CN109559319A (en) A kind of processing method and terminal of normal map
CN110276817B (en) Picture making method and device and electronic equipment
US20170169792A1 (en) Electronic device and method for releasing content to multiple terminals
CN114140560A (en) Animation generation method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20201204

Address after: Building 145, No.144, No.1, Jingshan Road, Beijing

Applicant after: Beijing joy Yangfan Technology Co.,Ltd.

Address before: 100085 Beijing City, Haidian District Road 33, two floor East Xiaoying

Applicant before: BEIJING KINGSOFT INTERNET SECURITY SOFTWARE Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant