Disclosure of Invention
The invention provides an interface switching method, electronic equipment and a computer readable storage medium, and aims to solve the technical problem that in the prior art, in a recovery mode of the electronic equipment, a user cannot watch display content or the display content cannot be completely displayed in the field of view of the user.
In order to achieve the above object, the present invention provides an interface switching method, which includes:
in a recovery mode, acquiring first coordinate information of a datum point of a target interface in a vertical screen display mode;
acquiring an observation area in a transverse screen display mode, and determining second coordinate information of the datum point in the transverse screen display mode according to the first coordinate information and a preset position offset;
determining third coordinate information of other pixel points in the target interface in the transverse screen display mode based on the second coordinate information;
and displaying the target interface according to the second coordinate information and the third coordinate information so that the target interface is positioned in the observation area.
Optionally, the reference point is a center pixel point or an edge pixel point of the target interface.
Optionally, the step of determining third coordinate information of other pixels in the target interface in the landscape display mode based on the second coordinate information includes:
acquiring a first offset of a first pixel point of the target interface and the datum point in the vertical screen display mode, wherein the first pixel point is other pixel points except the datum point in the vertical screen display mode;
determining second offset of other pixel points and the datum point in the transverse screen display mode according to the first offset;
and determining the third coordinate information of other pixel points in the target interface in the transverse screen display mode according to the second coordinate information and the second offset.
Optionally, the step of determining the second offset between the reference point and the other pixel points in the landscape display mode according to the first offset includes:
acquiring a first relative offset of the first offset along a first direction and a second relative offset of the first offset along a second direction, wherein the first direction and the second direction are mutually perpendicular;
determining a fourth relative offset along the second direction in the horizontal screen display mode according to the first relative offset, wherein the absolute value of the first relative offset is equal to the absolute value of the fourth relative offset;
determining a third relative offset along the first direction in the horizontal screen display mode according to the second relative offset, wherein the absolute value of the second relative offset is equal to that of the third relative offset;
and determining the second offset according to the third relative offset and the fourth relative offset.
Optionally, after the step of determining third coordinate information of other pixels in the target interface in the landscape display mode based on the second coordinate information, the method further includes:
when the pixel points in the target interface exceed the observation area in the transverse screen display mode, determining the sizes of the target interface and the observation area;
determining a scaling according to the size of the target interface and the observation area;
and determining the third coordinate information adjusted in the horizontal screen display mode based on a preset algorithm according to the scaling ratio.
Optionally, the step of determining the scaling according to the target interface and the size of the observation area includes:
acquiring a first length of the target interface along a first direction and a second length of the observation area along a second direction in the transverse screen display mode, wherein the first direction and the second direction are mutually perpendicular;
and determining the scaling according to the first length and the second length.
Optionally, the step of determining the adjusted third coordinate information in the landscape display mode based on the preset algorithm according to the scaling ratio includes:
determining the size information of the target interface in the vertical screen display mode by the preset algorithm according to the scaling;
and determining the third coordinate information in the transverse screen display mode according to the datum point and the size information.
Optionally, the step of displaying the target interface according to the second coordinate information and the third coordinate information, so that the target interface is located in the observation area includes:
acquiring pixel information of pixel points on the target interface;
and displaying the target interface according to the second coordinate information, the third coordinate information and the pixel information so that the target interface is positioned in the observation area.
To achieve the above object, the present application proposes an electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program when executed by the processor further implementing the steps of the interface switching method according to any one of the above embodiments.
To achieve the above object, the present application proposes a computer-readable storage medium comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program when executed by the processor further implementing the steps of the interface switching method according to any one of the above embodiments.
According to the technical scheme, the interface switching method is applied to the electronic equipment, under a recovery mode, first coordinate information of a datum point of a target interface of the electronic equipment in a vertical screen display mode is obtained, after the first coordinate information is determined, an observation area of the electronic equipment in a horizontal screen display mode is obtained, second coordinate information of the electronic equipment in the horizontal screen display mode is determined according to the first coordinate position and a preset position offset, and the first coordinate information in the vertical screen display mode corresponds to the second coordinate information in the horizontal screen display mode. After the second coordinate information is acquired, the pixel point position in the vertical screen display mode corresponds to the pixel point position in the horizontal screen display mode, so that third coordinate information of the target interface in the horizontal screen display mode can be determined according to the second coordinate information, and the target interface in the observation area in the horizontal screen display mode can be determined through the second coordinate information and the third coordinate information, and the problem that in the prior art, in the recovery mode, a user cannot watch display content in the horizontal screen display mode or the display content cannot be completely presented in the user field of view is solved.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only 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.
It should be noted that all directional indicators (such as up, down, left, right, front, and rear … …) in the embodiments of the present invention are merely used to explain the relative positional relationship, movement, etc. between the components in a particular posture (as shown in the drawings), and if the particular posture is changed, the directional indicator is changed accordingly.
Furthermore, descriptions such as those referred to as "first," "second," and the like, are provided for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implying an order of magnitude of the indicated technical features in the present disclosure. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present invention, the meaning of "plurality" means at least two, for example, two, three, etc., unless specifically defined otherwise.
In the present invention, unless specifically stated and limited otherwise, the terms "connected," "affixed," and the like are to be construed broadly, and for example, "affixed" may be a fixed connection, a removable connection, or an integral body; can be mechanically or electrically connected; either directly or indirectly, through intermediaries, or both, may be in communication with each other or in interaction with each other, unless expressly defined otherwise. The specific meaning of the above terms in the present invention can be understood by those of ordinary skill in the art according to the specific circumstances.
In addition, the technical solutions of the embodiments of the present invention may be combined with each other, but it is necessary to be based on the fact that those skilled in the art can implement the technical solutions, and when the technical solutions are contradictory or cannot be implemented, the combination of the technical solutions should be considered as not existing, and not falling within the scope of protection claimed by the present invention.
Referring to fig. 1, fig. 1 is a schematic diagram of an apparatus structure of a hardware running environment according to an embodiment of the present invention.
The device of the embodiment of the invention can comprise a control device of a shooting device such as a camera, a mobile phone and the like, such as a server, mobile electronic equipment, a centralized controller and the like.
As shown in fig. 1, the apparatus may include: a controller 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the controller 1001 described above.
It will be appreciated by those skilled in the art that the device structure shown in fig. 1 is not limiting of the device and may include more or fewer components than shown, or may be combined with certain components, or a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and application programs may be included in the memory 1005, which is a type of computer storage medium.
In the server shown in fig. 1, the user interface 1003 is mainly used to display the contents of the device structure, and the controller 1001 may be used to call an application program stored in the memory 1005 and perform the following operations:
in a recovery mode, acquiring first coordinate information of a datum point of a target interface in a vertical screen display mode;
acquiring an observation area in a transverse screen display mode, and determining second coordinate information of the datum point in the transverse screen display mode according to the first coordinate information and a preset position offset;
determining third coordinate information of other pixel points in the target interface in the transverse screen display mode based on the second coordinate information;
and displaying the target interface according to the second coordinate information and the third coordinate information so that the target interface is positioned in the observation area.
Further, the controller 1001 may call an application program stored in the memory 1005, and also perform the following operations:
acquiring a first offset of a first pixel point of the target interface and the datum point in the vertical screen display mode, wherein the first pixel point is other pixel points except the datum point in the vertical screen display mode;
determining second offset of other pixel points and the datum point in the transverse screen display mode according to the first offset;
and determining the third coordinate information of other pixel points in the target interface in the transverse screen display mode according to the second coordinate information and the second offset.
Further, the controller 1001 may call an application program stored in the memory 1005, and also perform the following operations:
acquiring a first relative offset of the first offset along a first direction and a second relative offset of the first offset along a second direction, wherein the first direction and the second direction are mutually perpendicular;
determining a fourth relative offset along the second direction in the horizontal screen display mode according to the first relative offset, wherein the absolute value of the first relative offset is equal to the absolute value of the fourth relative offset;
determining a third relative offset along the first direction in the horizontal screen display mode according to the second relative offset, wherein the absolute value of the second relative offset is equal to that of the third relative offset;
and determining the second offset according to the third relative offset and the fourth relative offset.
Further, the controller 1001 may call an application program stored in the memory 1005, and also perform the following operations:
when the pixel points in the target interface exceed the observation area in the transverse screen display mode, determining the sizes of the target interface and the observation area;
determining a scaling according to the size of the target interface and the observation area;
and determining the third coordinate information adjusted in the horizontal screen display mode based on a preset algorithm according to the scaling ratio.
Further, the controller 1001 may call an application program stored in the memory 1005, and also perform the following operations:
acquiring a first length of the target interface along a first direction and a second length of the observation area along a second direction in the transverse screen display mode, wherein the first direction and the second direction are mutually perpendicular;
and determining the scaling according to the first length and the second length.
Further, the controller 1001 may call an application program stored in the memory 1005, and also perform the following operations:
determining the size information of the target interface in the vertical screen display mode by the preset algorithm according to the scaling;
and determining the third coordinate information in the transverse screen display mode according to the datum point and the size information.
Further, the controller 1001 may call an application program stored in the memory 1005, and also perform the following operations:
acquiring pixel information of pixel points on the target interface;
and displaying the target interface according to the second coordinate information, the third coordinate information and the pixel information so that the target interface is positioned in the observation area.
The invention provides an interface switching method, electronic equipment and a computer readable storage medium.
First embodiment
Referring to fig. 2 to 4, the interface switching method includes:
s100, under a recovery mode, acquiring first coordinate information of a datum point of a target interface in a vertical screen display mode;
the screen display modes of the electronic equipment comprise the vertical screen display mode and the horizontal screen display mode. The reference point may be used to determine a position of the target interface on the electronic device, and in particular, the reference point is a pixel point of a screen on the electronic device.
Preferably, the electronic device is a VR device, and in particular, the VR device may be a headset VR device integrated machine, or may also be a VR device used in combination with a mobile terminal. The screen of the electronic device can be a display screen in the head-mounted VR device integrated machine, and can also be the mobile terminal for content display in the VR device.
S200, acquiring an observation area in the transverse screen display mode, and determining second coordinate information of the datum point in the transverse screen display mode according to the first coordinate position and a preset position offset;
in order to ensure the binocular viewing effect of the user in the horizontal screen display mode, the viewing area in the horizontal screen display mode comprises a first viewing area and a second viewing area, and the first viewing area and the second viewing area are arranged at intervals or adjacently.
In a specific embodiment, when the first observation area and the second observation area are included in the landscape display mode, in order to determine the reference point positions in different observation areas in the landscape display mode according to the first coordinate information conveniently, the preset position offset is obtained, the preset position offset includes a first preset position offset and a second preset position offset, the first preset position offset is used for determining the position information of the reference point of the first observation area in the landscape display mode according to the first coordinate information, and the second preset position offset is used for determining the position information of the reference point of the second observation area in the landscape display mode according to the first coordinate information.
S300, determining third coordinate information of other pixel points in the target interface in the transverse screen display mode based on the second coordinate information;
the third coordinate information is used for indicating the position information of other pixels except the reference point in the horizontal screen display mode, specifically, after the first coordinate information and the second coordinate information are determined, the positions of other pixels except the reference point in the horizontal screen display mode in the vertical screen display mode on the observation area in the horizontal screen display mode can be determined according to the relation between the vertical screen display mode and the horizontal screen display mode.
And S400, displaying the target interface according to the second coordinate information and the third coordinate information so that the target interface is positioned in the observation area.
According to the second coordinate information and the third coordinate information, all pixels of the target interface in the vertical screen display mode can be switched to the horizontal screen display mode for display, so that a user can observe conveniently through the horizontal screen display mode.
In a specific embodiment of the present application, the interface switching method is applied to an electronic device, and obtains first coordinate information of a reference point of a target interface of the electronic device in a vertical screen display mode, and after determining the first coordinate information, obtains an observation area of the electronic device in a horizontal screen display mode, and determines, according to the first coordinate position and a preset position offset, second coordinate information of the electronic device in the horizontal screen display mode, where the first coordinate information in the vertical screen display mode corresponds to the second coordinate information in the horizontal screen display mode. After the second coordinate information is acquired, the pixel point position in the vertical screen display mode corresponds to the pixel point position in the horizontal screen display mode, so that third coordinate information of the target interface in the horizontal screen display mode can be determined according to the second coordinate information, and the target interface in the observation area in the horizontal screen display mode can be determined through the second coordinate information and the third coordinate information, and the problem that in the prior art, in the recovery mode, a user cannot watch display content in the horizontal screen display mode or the display content cannot be completely presented in the user field of view is solved.
In a preferred embodiment, the reference point is a center pixel point or an edge pixel point of the target interface, specifically, the reference point is a center position or an edge endpoint position of the target interface, it may be understood that the reference point may be any position on the target interface or any other position outside the target interface, and the reference point is capable of determining a relative position of the target interface on the screen of the electronic device.
Second embodiment
Referring to fig. 5, in the first embodiment, the step S300 includes:
s310, acquiring a first offset of a first pixel point of the target interface and the datum point in the vertical screen display mode, wherein the first pixel point is other pixel points except the datum point in the vertical screen display mode;
the first pixel point is other pixel points of the electronic device except the datum point in the vertical screen display mode, and the first offset is used for representing the distance between the first pixel point and the datum point.
S320, determining a second offset of other pixel points and the datum point in the transverse screen display mode according to the first offset;
the other pixel points are other pixel points of the electronic device in the horizontal screen display mode except the reference point, and the second offset is used for indicating the distance between the other pixel points and the reference point in the horizontal screen display mode.
S330, determining the third coordinate information of other pixel points in the target interface in the transverse screen display mode according to the second coordinate information and the second offset.
The third coordinate information is used for representing position information of other pixel points, and specifically, when the second coordinate information and the second offset are obtained, the third coordinate information can be determined according to the second coordinate information and the second offset of the reference point in the horizontal screen display mode.
Third embodiment
Referring to fig. 6, in the first embodiment, the step S320 includes:
s321, acquiring a first relative offset of the first offset along a first direction and a second relative offset along a second direction, wherein the first direction and the second direction are mutually perpendicular;
s322, determining a fourth relative offset along the second direction in the horizontal screen display mode according to the first relative offset, wherein the absolute value of the first relative offset is equal to the absolute value of the fourth relative offset;
s323, determining a third relative offset along the first direction in the horizontal screen display mode according to the second relative offset, wherein the absolute value of the second relative offset is equal to that of the third relative offset;
s324, determining the second offset according to the third relative offset and the fourth relative offset.
The first offset includes the first relative offset and the second relative offset, the first relative offset and the second relative offset are perpendicular to each other, the second offset includes the third relative offset and the fourth relative offset, the third relative offset and the fourth relative offset are perpendicular to each other, the first relative offset and the fourth relative offset are the same in offset direction, and the second relative offset and the third relative offset are the same in offset direction. And in order to ensure that the size of the target interface in the vertical screen display mode is equal to that in the horizontal screen display mode, the absolute value of the first relative offset is equal to that of the fourth relative offset, and the absolute value of the second relative offset is equal to that of the third relative offset.
Fourth embodiment
Referring to fig. 7, in the first embodiment, after the step S300, the method further includes:
s500, when the pixel points in the target interface exceed the observation area in the horizontal screen display mode, determining the sizes of the target interface and the observation area;
s600, determining a scaling ratio according to the size of the target interface and the observation area;
s700, determining the third coordinate information adjusted in the horizontal screen display mode based on a preset algorithm according to the scaling;
when the length of the target interface along the horizontal direction or the vertical direction is too long and the pixel point of the target interface displayed in the horizontal screen display mode exceeds the observation area, the size of the target interface needs to be determined again in order to ensure the display effect of the target interface in the horizontal screen display mode.
In a specific embodiment, the dimensions of the target interface may include dimensions in a horizontal direction and dimensions in a vertical direction, and after determining the dimensions of the target interface in the horizontal direction and the dimensions in the vertical direction, the dimensions of the observation area in the horizontal direction and the dimensions in the vertical direction passing through the reference point may be determined in the landscape display mode, and the scaling of the target interface may be determined according to the dimensions of the observation area in the horizontal direction and the dimensions in the vertical direction and the dimensions of the target interface.
After the scaling is determined, the target interface in the horizontal screen display mode can be determined according to the preset algorithm to adjust, and specifically, the preset algorithm can be a nearest interpolation algorithm, a bilinear interpolation algorithm, a bicubic interpolation algorithm or other algorithms capable of being used for carrying out interface scaling.
After determining the size of the target interface in the horizontal screen display mode according to the scaling, the third coordinate information of other pixel points of the target interface in the horizontal screen display mode can be determined according to the first coordinate information, so that the scaled target interface can be conveniently displayed in the observation area in the horizontal screen display mode.
By scaling the target interface, a user can conveniently observe the target interface in the horizontal screen display mode, so that the user can conveniently operate the target interface. It is to be understood that the zooming of the target interface is not limited to the zooming-out operation of the target interface, and when the target interface size in the portrait display mode is smaller, the target interface may be zoomed in and displayed in the observation area in the landscape display mode.
Fifth embodiment
Referring to fig. 8, in the third embodiment, after the step S330, the method further includes:
s610, acquiring a first length of the target interface along a first direction and a second length of the observation area along the first direction in the transverse screen display mode, wherein the first direction and the second direction are mutually perpendicular;
s620, determining the scaling according to the first length and the second length.
In a specific embodiment, the first direction is a horizontal direction, the second direction is a vertical direction, when the electronic device displays the target interface along the first direction in the vertical screen display mode, the electronic device displays the target interface along the second direction in the horizontal screen display mode, and in order to avoid that the pixel point of the target interface exceeds the observation area in the horizontal screen display mode, a first length of the target interface along the first direction and a second length of the observation area along the second direction in the horizontal screen display mode are respectively determined.
To determine the scaling, the scaling may be determined by a ratio of the first length to the second length. Specifically, when the first length is 40mm and the second length is 35mm, the scaling ratio is a ratio of the second length to the first length, the scaling ratio is 0.875, and the target interface in the vertical screen display mode is scaled according to a ratio of 0.875.
Sixth embodiment
Referring to fig. 9, in a fourth embodiment, the step S700 includes:
s710, determining the size information of the target interface in the vertical screen display mode by the preset algorithm according to the scaling;
s720, determining the third coordinate information in the transverse screen display mode according to the datum point and the size information;
in order to scale the target interface in the vertical screen display mode, after determining the scaling ratio, the preset algorithm is used for firstly scaling the target interface in the vertical screen display mode, after re-determining the size of the target interface, according to the adjusted target interface and the coordinate positions of the datum point in the vertical screen display mode and the horizontal screen display mode, the third coordinate information of other pixels except the datum point in the horizontal screen display mode is determined, and by scaling the target interface, the whole content of the target interface in the vertical screen display mode can be ensured to be normally displayed in the horizontal screen display mode, and the problem that the display of the target interface in the horizontal screen display mode is abnormal when the size of the target interface is oversized or undersized is avoided.
Seventh embodiment
Referring to fig. 10, in the first embodiment, the step S400 includes:
s410, acquiring pixel information of the first pixel point;
the pixel information includes a pixel color, a pixel brightness and other related information related to the display of the first pixel.
And S420, displaying the target interface according to the second coordinate information, the third coordinate information and the pixel information so that the target interface is positioned in the observation area.
The second coordinate information is used for representing the position of the reference point in the horizontal screen display mode, the third coordinate information is used for representing the positions of other pixel points except the reference point in the horizontal screen display mode, after the corresponding position of the pixel point of the target interface in the horizontal screen display mode is determined, the pixel information of the pixel point is obtained, and the pixel information is displayed in the corresponding coordinate position according to the pixel information, so that the switching process of the target interface in the horizontal screen display mode is completed.
It should be noted that, in the recovery mode, the vertical screen display mode is adopted by default, and the technical scheme provided by the embodiment can be adopted to realize the adoption of the horizontal screen display mode in the recovery mode.
In addition, in the recovery mode, the display mode of the screen can be detected in advance; after detecting that the display mode of the screen needs to be switched from the vertical screen display mode to the horizontal screen display mode, executing the scheme provided by the embodiment.
To achieve the above object, the present application proposes an electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program when executed by the processor further implementing the steps of the interface switching method according to any one of the above embodiments.
The present application also provides a computer readable storage medium, on which a target interface switching program is stored, which when executed by a processor, implements the steps of the interface switching method according to any one of the above embodiments.
In some alternative embodiments, the processor may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSPs), application specific integrated circuits (Application Specific Integrated Circuit, ASICs), field programmable gate arrays (Field-Programmable Gate Array, FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory may be an internal storage unit of the device, such as a hard disk or a memory of the device. The memory may also be an external storage device of the device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the device. Further, the memory may also include both internal storage units of the device and external storage devices. The memory is used for storing the computer program and other programs and data required by the device. The memory may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the invention, and all equivalent structural changes made by the description of the present invention and the accompanying drawings or direct/indirect application in other related technical fields are included in the scope of the invention.