[go: up one dir, main page]

CN120743398A - Method for switching horizontal screen and vertical screen, electronic device, readable medium and program product - Google Patents

Method for switching horizontal screen and vertical screen, electronic device, readable medium and program product

Info

Publication number
CN120743398A
CN120743398A CN202410605732.7A CN202410605732A CN120743398A CN 120743398 A CN120743398 A CN 120743398A CN 202410605732 A CN202410605732 A CN 202410605732A CN 120743398 A CN120743398 A CN 120743398A
Authority
CN
China
Prior art keywords
display window
interface
display
electronic device
image
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.)
Pending
Application number
CN202410605732.7A
Other languages
Chinese (zh)
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.)
Honor Device Co Ltd
Original Assignee
Honor Device 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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202410605732.7A priority Critical patent/CN120743398A/en
Publication of CN120743398A publication Critical patent/CN120743398A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/60Rotation of whole images or parts thereof

Landscapes

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

Abstract

The application provides a horizontal and vertical screen switching method, which comprises the steps that an electronic device displays a first interface in a first display mode, an image is displayed on the first interface, when the first display mode is switched to a second display mode, a screen snapshot of the first interface is obtained, the first display window is zoomed and rotated along a first direction to obtain a second display window, in the process of switching the first display mode to the second display mode, the electronic device displays a dynamic effect of transition from the screen snapshot of the first interface to the second interface, the second interface is restored by the second display window and rotated along a second direction, the size of the image displayed by the second interface is the same as the size of the image displayed by the first display window, and the smoothness of the dynamic effect display picture is ensured in the process of transition from the screen snapshot of the first interface to the dynamic effect of the second interface.

Description

Method for switching horizontal screen and vertical screen, electronic device, readable medium and program product
Technical Field
The present application relates to the field of display technologies, and in particular, to a horizontal and vertical screen switching method, an electronic device, a computer program product, and a computer readable storage medium.
Background
Currently, when an electronic device displays an image or plays a video, the handheld mode of a user is different, and the display state of the image or the playing state of the video is also different. The mobile phone is held vertically by a user, the electronic equipment displays images or plays videos in a vertical screen display mode, the mobile phone is held horizontally by the user, and the electronic equipment displays images or plays videos in a horizontal screen display mode.
In the process of displaying images or playing videos, the electronic equipment adjusts the holding mode, and can automatically switch the horizontal and vertical screen display modes, for example, the user can adjust the vertical holding mode to the horizontal holding mode, and the electronic equipment automatically switches the vertical screen display picture to the horizontal screen display picture. The transverse and vertical screen switching scheme is needed, so that the display picture is smoother when the electronic equipment performs transverse and vertical screen display switching.
Disclosure of Invention
The application provides a horizontal and vertical screen switching method, electronic equipment, a computer program product and a computer readable storage medium, which can realize smoother display picture when the electronic equipment performs horizontal and vertical screen display switching.
In order to achieve the above object, the present application provides the following technical solutions:
The application provides a method for switching a horizontal screen and a vertical screen, which comprises the steps that an electronic device displays a first interface in a first display mode, the first interface displays images, when the electronic device receives an operation of switching from the first display mode to a second display mode, the electronic device obtains a screen snapshot of the first interface, and zooms and rotates the first display window in a first direction to obtain a second display window, wherein the first display window refers to a window when the electronic device displays images in the second display mode, the long side of the screen snapshot of the first interface is in the same direction as the long side of the first display window, the long side of the second display window is in the same direction as the short side of the first display window, the size of an image displayed by the second display window is the same as the size of an image displayed by the screen snapshot of the first interface, in the process of switching from the first display mode to the second display mode, the second interface is restored and rotated in the second direction by the second display window, the size of the second display window is the same as the size of the image displayed by the second display window in the first direction.
In the transverse and vertical screen switching method provided by the application, when the electronic equipment displays a first interface in the vertical screen display mode, the first interface displays an image which can be a static image or a first frame image in a video, when the electronic equipment receives an operation of switching the vertical screen display mode to the transverse screen display mode, a screen snapshot of the first interface is obtained, the long side of the screen snapshot is in the same direction as the long side of a window displayed in the transverse screen display mode, namely, the screen snapshot of the first interface is in the same direction as the long side of the window displayed in the transverse screen display mode, namely, the window (namely, the first display window) of the image displayed in the transverse screen display mode is subjected to scaling and reduction, and the purpose of reducing the size of the second display window is that the size of the second display window is changed from the first side to the second side of the second window in the same manner as the first window in the first interface, namely, the second window is scaled and the second window is restored from the first side of the first window to the second window in the same manner.
From the above, it can be seen that the electronic device zooms and rotates the first display window to obtain the second display window, the size of the image of the zoomed display window is the same as the size of the image in the screen shot of the first interface, and the electronic device displays the dynamic effect of the screen shot of the first interface transiting to the second interface in the process of switching the first display mode to the second display mode, the second interface is obtained by restoring and reversely rotating the second display window, the size of the image displayed by the restored second display window is the same as the size of the image displayed by the first display window, so that the second interface displayed by the screen is gradually transited to the first display window by the second display window with the same size of the image in the screen shot of the first interface in the process of transiting to the dynamic effect of the second interface, and the smoothness of the dynamic effect display picture is ensured.
In one possible implementation, the electronic device obtains a screen shot of the first interface, and the long side of the screen shot of the first interface is in the same direction as the long side of the first display window, including that the electronic device obtains an initial screen shot when the first interface is displayed in a first display mode; and the electronic equipment rotates the initial screen shot along the first direction to obtain the screen shot of the first interface so as to realize that the long side of the screen shot of the first interface and the long side of the first display window are in the same direction.
In one possible implementation, the method for the electronic device to rotate the initial screen shot along the first direction to obtain the screen shot of the first interface and the method for the electronic device to zoom the first display window and rotate along the first direction to obtain the second display window comprise the steps that the electronic device zooms the first display window to obtain the third display window, the size of an image displayed by the third display window is the same as that of an image in the initial screen shot, then the initial screen shot is positioned on the top layer, the third display window is positioned on the lower layer of the initial screen shot, the initial screen shot and the third display window are combined, and then the combined initial screen shot and the third display window are rotated along the first direction, wherein the second display window refers to the rotated third display window.
In one possible implementation, the electronic device combines the initial screen shot and the third display window in a manner that the initial screen shot is positioned on the top layer and the third display window is positioned on the lower layer of the initial screen shot, and further comprises a bottom plate arranged on the lower layer of the third display window by the electronic device, wherein the size of the bottom plate is the same as that of the initial screen shot, and the electronic device rotates the combined initial screen shot and the combined third display window along the first direction, and the electronic device rotates the combined initial screen shot, the third display window and the bottom plate along the first direction.
In one possible implementation, after the electronic device sets the bottom plate at the lower layer of the third display window, the method further includes that the electronic device sets a background color of the window for the bottom plate, and the background color of the window refers to a background color of an image in the first interface.
In one possible implementation, the electronic device displays a dynamic effect of transition from the screen snapshot of the first interface to the second interface in the process of switching from the first display mode to the second display mode, wherein the electronic device firstly displays the combined screen snapshot of the first interface and the second display window in the process of switching from the first display mode to the second display mode, then controls the combined screen snapshot of the first interface and the second display window to rotate along a second direction, and gradually transparencies the combined screen snapshot of the first interface and the combined screen snapshot of the second display window in the process of rotating along the second direction, and gradually reduces the size of the second display window to the size of the first display window.
In the above possible embodiment, in the process of switching from the first display mode to the second display mode, since the size of the image displayed by the second display window is the same as the size of the image in the screen shot of the first interface, the combined image content of the screen shot of the first interface can completely cover the image content in the second display window, and no ghost exists in the two, even when the screen shot of the first interface is semitransparent, the second display window gradually reduces, and the ghost of the screen shot of the first interface and the ghost of the second display window can be ignored, thereby ensuring the definition and smoothness of the moving effect picture.
In one possible implementation, the lower layer of the combined screen shot of the first interface and the second display window further comprises a bottom plate, the size of the bottom plate is the same as that of the screen shot of the first interface, and controlling the combined screen shot of the first interface and the second display window to rotate along the second direction comprises controlling the combined screen shot of the first interface, the second display window and the bottom plate to rotate along the second direction, and the width of the bottom plate is gradually changed into high and the height is gradually changed into wide in the process of rotating the combined screen shot of the first interface, the second display window and the bottom plate along the second direction.
In one possible implementation, in the process of combining the screen snapshot of the first interface, the second display window and the bottom plate to rotate along the second direction, the method further comprises cutting out the area of the second display window beyond the bottom plate, so that the second display window is gradually restored to the size of the first display window in the regular size of the bottom plate.
In one possible implementation manner, before the electronic device zooms the first display window and rotates along the first direction to obtain the second display window, the electronic device further includes determining that the first interface does not display the popup window and that the image displayed by the first interface is not in an editing state, so that the problem that the image with the same size as the second display window cannot be displayed due to the display of the popup window or the screen snapshot of the first interface in the editing state of the image is avoided, and the first display window is zoomed, so that the problem of wasting power consumption occurs.
In one possible implementation, the electronic device scaling the first display window includes the electronic device scaling the first display window by a scaling factor, where the scaling factor refers to a scaling factor of the image due to switching between the first display mode and the second display mode, and the second interface is restored by the second display window, including that the second interface is restored by the second display window by the scaling factor.
In a second aspect, the application provides an electronic device comprising one or more processors, a memory and a display screen, the memory and the display screen being coupled to the one or more processors, the memory being for storing computer program code comprising computer instructions which, when executed by the one or more processors, cause the electronic device to perform a method of screen switching as described in the first aspect and any one of its possible embodiments.
In a third aspect, the present application provides a computer readable storage medium storing a computer program, which when executed is specifically adapted to implement a method for switching between landscape and portrait screens as described in the first aspect and any of its possible embodiments.
In a fourth aspect, the present application provides a computer program product for, when run on a computer, causing the computer to perform a method of landscape switching as described in the first aspect and any of its possible embodiments.
Drawings
Fig. 1 is a scene diagram of switching mobile phone vertical screen display to horizontal screen display according to an embodiment of the present application;
Fig. 2 is another scene diagram of switching a mobile phone vertical screen display to a horizontal screen display according to an embodiment of the present application;
Fig. 3 and fig. 4 are explanatory views of a technical concept of horizontal-vertical screen switching provided by an embodiment of the present application;
FIG. 5 is a schematic diagram of a combination of a screen shot and a display window according to an embodiment of the present application;
fig. 6 is a hardware configuration diagram of an electronic device according to an embodiment of the present application;
FIG. 7 is a software framework diagram of an electronic device according to an embodiment of the present application;
Fig. 8 is an interaction diagram of a horizontal-vertical screen switching method provided by an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. The terminology used in the following examples is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include, for example, "one or more" such forms of expression, unless the context clearly indicates to the contrary. It should also be understood that in embodiments of the present application, "one or more" means one, two or more than two, "and/or" describes an association of associated objects, meaning that three relationships may exist, e.g., A and/or B may mean that A alone exists, while A and B together, B alone exists, wherein A, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
The plurality of the embodiments of the present application is greater than or equal to two. It should be noted that, in the description of the embodiments of the present application, the terms "first," "second," and the like are used for distinguishing between the descriptions and not necessarily for indicating or implying a relative importance, or alternatively, for indicating or implying a sequential order.
When the electronic equipment displays images or plays videos, the display mode can be automatically switched based on the mode of the holding equipment adjusted by a user. Fig. 1 and fig. 2 are respectively interface diagrams for illustrating the manner in which a user adjusts the holding mode of the device and the device automatically switches the display mode of the image, taking the display image of the mobile phone as an example.
Illustratively, the mobile phone is held vertically by the user, the user selects an image in the gallery application of the mobile phone, and the mobile phone responds to the selection operation of the user, as shown in fig. 1 (a), the image 101 is displayed vertically. The user rotates the mobile phone to adjust the mobile phone from the vertical grip to the horizontal grip, and then the mobile phone displays the image 101 horizontally as shown in fig. 1 (b) following the user operation.
The user inputs an operation in the browsing interface of the image 101 shown in fig. 1 (a), controls the mobile phone to vertically and fully display the image 101 (or immersive browsing image) as shown in fig. 2 (a), for example, a click operation input in the browsing interface of the image 101, or other applications of the mobile phone save the image 101, the user inputs an operation in the interface of other applications to browse the image 101, and the mobile phone responds to the operation, as shown in fig. 2 (a), to vertically and fully display the image 101. After that, the user adjusts the mobile phone from the portrait holding to the landscape holding, and the mobile phone displays the image 101 horizontally and in full screen as shown in fig. 2 (b) following the operation of the user.
Fig. 1 and 2 show the operation of following the user's vertical grip to adjust to the horizontal grip, and the mobile phone switches from the vertical display image to the horizontal display image. Similarly, the user horizontally holds and adjusts to be vertically held, and the mobile phone can also be switched from a horizontal display image to a vertical display image along with the operation of the user.
The embodiment of the application provides a transverse screen and vertical screen switching scheme which can be applied to the transverse screen and vertical screen switching scene provided by the content, and can enable electronic equipment such as a mobile phone to follow the operation of a user for adjusting the holding mode of the equipment, so that the transverse and vertical display switching is completed in a mode of displaying the rotary movement effect of the transverse screen and vertical screen switching, and the picture of the rotary movement effect is smooth and clear.
Taking the example that the displayed image of the mobile phone vertical screen is switched to the horizontal screen display image shown in fig. 1 as an example, the technical idea of the horizontal and vertical screen switching scheme provided by the embodiment of the application is described with reference to fig. 3 and fig. 4.
Referring to fig. 3, at a first moment, a user holds a mobile phone vertically and the mobile phone displays an image 101 vertically.
At the second moment, the user starts to adjust the holding mode of the mobile phone, and at the third moment, the mobile phone is adjusted to be in a transverse holding mode. The mobile phone detects the operation of the user at the second moment, and captures the interface displayed by the mobile phone at the second moment to obtain the first screen shot 301. The user starts to adjust the holding mode of the mobile phone at the second moment, so that the interface displayed by the mobile phone at the second moment is the same as the interface displayed at the first moment, and is an interface for vertically displaying the image 101. The mobile phone rotates the first screen shot from 0 degrees to 90 degrees, so that a state that the second screen shot 302,0 degrees indicates vertical display and a state that the second screen shot 90 degrees indicates clockwise rotation by 90 degrees is obtained. In some embodiments, the screen of the cell phone displays a second screen shot 302.
The mobile phone determines that the third moment is the gesture of the landscape display image, so the mobile phone can obtain the display window corresponding to the landscape display image 101, which is called as the first display window 303. The handset zooms the first display window 303 first and then rotates it 90 ° clockwise to obtain the second display window 304. It will be appreciated that the first display window 303 and the second display window 304 comprise image content of the image 101 that is displayed laterally, and that the image content of the second display window 304 is the same size as the image content in the second screen shot 302.
The mobile phone combines the second screen shot 302, the second display window 304 and the bottom plate in a superposition manner, the second screen shot 302 is located at the upper layer, the second display window 304 is located at the middle layer, and the bottom plate is located at the lower layer.
Fig. 4 shows a second screen shot 302, a second display window 304 and a variation of the base panel rotated from 90 deg. to 0 deg.. To clearly show the second screen shot 302, the second display window 304 and the change in the base plate during rotation, the base plate is shown in light gray in FIG. 4, but this does not constitute a limitation on the base plate background color.
Referring to fig. 4, the second screen shot 302, the second display window 304 and the base plate 305 are combined in a superimposed manner, and the handset controls the superimposed second screen shot 302, the second display window 304 and the base plate 305 to rotate counterclockwise by 90 °. During rotation, the second screen shot 304 slowly changes from opaque to fully transparent, the second display window 304 reverts to the pre-zoom size, and the bottom panel 305 slowly adjusts to wide to high and high to wide.
After the second screen shot 302, the second display window 304 and the bottom plate 305 are rotated 90 ° counterclockwise, the second screen shot 302 is completely transparent, the content of the second display window 304 is completely displayed, and the size is restored, that is, the size is enlarged to the initial value of the window for horizontally displaying the image 101, the width of the bottom plate 305 is adjusted to be high, and the height is adjusted to be wide, so that the mobile phone is switched from vertical screen display to horizontal screen display.
In some embodiments, the overlapping second screen shot 302, second display window 304, and base 305 may be cut out during rotation of the second display window 304 beyond the area of the base 305.
It should be noted that, the mobile phone zooms the first display window 303 to the size that includes the image content that is the same as the image content in the second screen shot 302, that is, the image content of the second display window 304 is the same as the image content in the second screen shot 302, the mobile phone stacks the second screen shot 302 and the second display window 304 together, the second screen shot 302 can completely cover the image content of the second display window 304, the problem that the image content in the second screen shot 302 is not completely aligned with the image content in the second display window 304 and a ghost appears, and in the process that the second screen shot 302 and the second display window 304 rotate together, the rotating effective picture is clear and fluent, that is, the rotating picture observed by the user is gradually transited to the image content in the second display window by the image content in the second screen shot, and the user can feel that the picture is clear and fluent due to the fact that the image content in the two images are the same in size.
Fig. 5 shows a schematic view of the first display window 303 superimposed with the second screen shot 302 after the first display window 303 has been rotated 90 ° without scaling. As can be seen from fig. 5, the second screen shot 302 is located at the upper layer, the first display window 303 is located at the lower layer, and the second screen shot 302 cannot completely cover the image content of the first display window 303 due to the different sizes of the image areas of the two, and when the second screen shot 302 is in an opaque state and transits to a semitransparent state, the image content in the second screen shot 302 and the image content in the second display window 304 have ghost, so that in the superimposed second screen shot 302, the second display window 304 and the bottom plate 305 have unclear images and are not smooth in the rotation process.
The horizontal and vertical screen switching scheme provided by the embodiment of the application can be applied to electronic equipment with display screens such as mobile phones, tablet computers and the like, and the electronic equipment is not limited to the mobile phones, the tablet computers, personal digital assistants (Personal DIGITAL ASSISTANT, PDA), desktop, laptop, notebook computers, ultra-mobile Personal computers (Ultra-mobile Personal Computer, UMPC), handheld computers, netbooks, wearable equipment and the like. The present application is not particularly limited as to the type of electronic device.
Taking a mobile phone as an example, fig. 6 is a composition example of an electronic device according to an embodiment of the present application. As shown in fig. 6, the electronic device 100 may include a processor 110, an internal memory 120, a display 130, an audio module 140, and a sensor module 150, among others.
It is to be understood that the structure illustrated in the present embodiment does not constitute a specific limitation on the electronic apparatus 100. The electronic device 100 may include more or fewer components than shown, or may combine certain components, or split certain components, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (IMAGE SIGNAL processor, ISP), a controller, a video codec, a digital signal processor (DIGITAL SIGNAL processor, DSP), a baseband processor, a smart sensor hub (sensor hub) and/or a neural-network processing unit, NPU, etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
The internal memory 120 may be used to store computer-executable program code that includes instructions.
In some embodiments, the internal memory 120 stores instructions for a landscape-portrait switching scheme. The processor 110 may implement, by executing the instruction stored in the internal memory 120, that the device follows the operation of the user to adjust the holding mode of the device, so as to complete the horizontal-vertical display switching in a manner of displaying the rotation effect of the horizontal-vertical screen switching, where the picture of the rotation effect is smooth and clear.
The electronic device implements display functions through the GPU, the display 130, and the application processor, etc. The GPU is a microprocessor for image processing, and is connected to the display 130 and the application processor. GPUs are used for image rendering by performing mathematical and geometric calculations. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display 130 is used to display images, video interfaces, etc. In some embodiments, the electronic device may include 1 or N display screens 130, N being a positive integer greater than 1.
The electronic device may implement audio functions through the audio module 140, speaker 140A, receiver 140B, microphone 140C, headphone interface 140D, and application processor, among others. Such as music playing, recording, etc.
The audio module 140 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. Speaker 140A, also known as a "horn," is used to convert audio electrical signals into sound signals. The electronic device may listen to music, or to hands-free conversations, through speaker 140A. A receiver 140B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. When the electronic device picks up a phone call or voice message, the voice can be picked up by placing the receiver 140B close to the human ear. Microphone 140C, also referred to as a "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can sound near the microphone 140C through the mouth, inputting a sound signal to the microphone 140C. The earphone interface 140D is used to connect a wired earphone. The headset interface 140D may be a USB interface or a 3.5mm open mobile electronic device platform (open mobile terminal platform, OMTP) standard interface, a american cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
In the sensor module 150, the pressure sensor 150A is configured to sense a pressure signal, and may convert the pressure signal into an electrical signal. The electronics determine the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 130, the electronic device detects the touch operation intensity according to the pressure sensor 150A. The electronic device may also calculate the location of the touch based on the detection signal of the pressure sensor 150A.
The touch sensor 150B is also referred to as a "touch device". The touch sensor 150B may be disposed on the display screen 130, and the touch sensor 150B and the display screen 130 form a touch screen, which is also referred to as a "touch screen". The touch sensor 150B is used to detect a touch operation acting thereon or thereabout. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to the touch operation may be provided through the display screen 130.
The acceleration sensor 150C may detect the magnitude of acceleration of the electronic device in various directions (typically three axes). The gravity and direction can be detected when the electronic equipment is static, and the gravity and direction can be used for identifying the gesture of the electronic equipment.
The gyro sensor 150D may be used to determine a motion gesture of the electronic device.
The electronic device also runs an operating system on top of the hardware components shown in fig. 6. For exampleThe operating system is such that the operating system,The operating system is such that the operating system,An operating system, etc. An application such as a runtime library may be installed on the operating system.
Fig. 7 is a schematic software structure of an electronic device according to an embodiment of the present application.
The layered architecture divides the operating system of the electronic device into several layers, each layer having distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the operating system of the electronic device is an Android system. The Android system can be divided into five layers, namely an Application (APP) layer, an application framework layer (FWK for short), a system library, a hardware abstraction layer (Hardware Abstraction Layer, HAL) and a kernel layer from top to bottom.
The application layer may include a series of application packages. As shown in fig. 7, the application package may include an application such as gallery, video, etc.
In some embodiments, the gallery includes two modules of photo management and video management, and may include other modules, where the photo management is used to parse image data, calculate scaling factors based on the wide-high value of the image, and query the gallery whether the image is in an editing state, a popup state, and whether the gallery is in an immersive browsing state, and send the scaling factors and the background color of the window to a window manager based on the query result. The video management is used for analyzing video data, calculating scaling factors based on the wide and high values of one frame of image in the video, inquiring whether the video is in an editing state, a popup state and whether the gallery is in an immersive browsing state or not from the gallery, and sending the scaling factors and the background color of a window to a window manager based on the inquiring result.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for the application of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 7, the application framework layer may include a window manager (WindowManager), a view system, and the like.
The window manager is used for managing window programs. The window manager can realize the addition, deletion, display, hiding control and the like of the window. The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. In some embodiments, the window manager is further configured to adjust the size of the window, add and execute dynamic effects to the window.
Android run time includes a core library and virtual machines. Android runtime is responsible for scheduling and management of the android system. In some embodiments of the present application, the application cold start may run in Android runtime, android runtime obtains the optimized file state parameter of the application from this, and Android runtime may determine whether the optimized file is outdated due to the system upgrade by using the optimized file state parameter, and return the determination result to the application management and control module.
The core library comprises two parts, wherein one part is a function required to be called by java language, and the other part is an android core library.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. Such as surface manager (surface manager), media library (Media Libraries), three-dimensional graphics processing library (e.g., openGL ES), etc.
The surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications. Media libraries support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio and video encoding formats, such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc. The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like. The two-dimensional graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The kernel layer at least comprises a display driver, a sensor driver and the like. In some embodiments, the display driver is used to control the display screen to display an image. The sensor drive is used to control the operation of a plurality of sensors, such as an acceleration sensor, a gyro sensor, a pressure sensor, and a touch sensor.
It should be noted that although the embodiments of the present application are described in the followingThe system is described by way of example, but the basic principle is equally applicable to the system based onAnd the like operating the electronic device of the system.
The following describes a horizontal-vertical screen switching scheme provided by the embodiment of the application in combination with a module in a software structure of electronic equipment. It should be noted that, in the following embodiments, the display image is applied to the gallery of the electronic device, and the electronic device is automatically switched from the portrait display image to the landscape display image based on the operation that the user vertically holds the device to adjust to horizontally hold, which does not limit the application scenario of the landscape-portrait screen switching method.
As shown in fig. 8, the method for switching between horizontal and vertical screens provided by the embodiment of the application includes:
s801, a user inputs a browse image operation.
The gallery application of the electronic device stores images, and a user can input an image browsing operation on an interface of the gallery application. In some embodiments, the image browsing operation may refer to a user selecting an image in the gallery application interface, or may refer to a user selecting an image in the gallery application interface, where the electronic device displays the image browsing interface in response to the user operation, and then the user inputs a click operation on the image browsing interface to perform the immersive browsing of the image.
It should be noted that other applications of the electronic device may also save images. Based on this, in other application scenarios, the user-input browsing image operation may also refer to a browsing image operation input by the user at an interface of other applications.
S802, the gallery sends a message to the photo management to inform the browsing image.
As described above, the present embodiment is described by taking the gallery application display image as an example. The user inputs a browsing image operation at an interface of the gallery application, and the gallery application may monitor the browsing image operation input by the user based on a touch sensor or the like.
The gallery application monitors the user input browsing image operations and, in one aspect, the gallery application sends a message (which may be referred to as a first message) to the photo management, the first message being used to inform the photo management user of the input image browsing operations. In some embodiments, the first message may carry an identification of an image corresponding to the image browsing operation input by the user, and the image corresponding to the image browsing operation may be understood as an image designated by the user through the image browsing operation. On the other hand, the gallery application also displays an image browsing interface that presents images specified by the user through an image browsing operation. By way of example, fig. 1 (a) and fig. 2 (a) show an image browsing interface of the image 101.
It should be noted that, the photo management belongs to a module of the gallery application, and the gallery sends the first message to the photo management, which can be understood that other modules of the gallery monitor the browsing image operation input by the user and send the first message to the photo management.
S803, photograph management acquires the width and height of the image.
The photo management receives the first message, and knows that the user inputs the image browsing operation. Because the horizontal and vertical screen switching method provided by the embodiment includes scaling the image, the photo service firstly obtains the width w and the height h of the image corresponding to the image browsing operation to obtain the scaling multiple of the image.
In some embodiments, the photograph management may obtain image data based on the identification of the image carried by the first message, and then parse the image data to obtain the width w and the height h of the image.
S804, photo management calculates a scaling multiple n based on the width and height of the image.
Photo management calculates a horizontal screen scaling and a vertical screen scaling based on the width and the height of the image, and calculates a scaling multiple n based on the horizontal screen scaling and the vertical screen scaling. After the photograph management calculation obtains the scaling factor n, it may be cached.
In some embodiments, the manner in which the photograph management calculates the horizontal and vertical screen scales includes the photograph management obtaining the width W and height H of the screen, and the photograph management calculates the vertical screen scale 1=min (W/W, H/H), the horizontal screen scale 2=min (W/H, H/W). Or photograph management calculates vertical screen scale 1=max (W/W, H/H), horizontal screen scale 2=max (W/H, H/W).
The vertical screen scaling scale1 refers to a scaling scale of displaying an image on a screen of a vertical screen display interface completely in a vertical screen manner, namely, the image can be displayed on the screen of the vertical screen display interface completely after being scaled in the vertical screen scaling scale1, and the horizontal screen scaling scale2 refers to a scaling scale of displaying an image on a screen of a horizontal screen display interface completely in a horizontal screen manner, namely, the image can be displayed on the screen of the horizontal screen display interface completely after being scaled in the horizontal screen scaling scale 2.
In some embodiments, photograph management calculates scaling factor n based on the horizontal and vertical screen scaling in such a way that n=scale 2/scale1. Photograph management can explain the zoom magnification of an image due to the switching of a horizontal screen and a vertical screen based on the zoom magnification n calculated by n=scale 2/scale1. Therefore, the window manager scales the display window based on the scaling multiple n, which can be understood as scaling the display window according to the scaling multiple of the image switched by the horizontal screen and the vertical screen, and can ensure that the size of the scaled display window is the same as that of the image area in the screen snapshot.
The width W and the height H of the image, and the width W and the height H of the screen are defined below.
The electronic device is located in a spatial coordinate system XYZ, the edge of the screen in the XOY plane is defined as the width W of the screen, and the edge of the screen in the XOZ plane is defined as the height H of the screen. The side of the image parallel to the width W of the screen is defined as the width W of the image and the side of the image parallel to the height of the screen is defined as the height h of the image.
The electronic device is held vertically or horizontally by a user, and the width W and the height H of the screen and the width W and the height H of the image are different.
S805, the user inputs an operation of rotating the screen by 90 °.
The user inputs an image browsing operation through step S801, and the gallery application control screen displays an image specified by the user through the image browsing operation. And then, the user can adjust the holding mode of the electronic equipment. The embodiment uses the electronic equipment holding mode input by the user to adjust, namely, the user rotates the screen of the electronic equipment displayed by the vertical screen clockwise by 90 degrees to display the screen horizontally as an example.
The electronic apparatus receives an operation of rotating the screen clockwise by 90 ° input by the user, and in response to the user operation, step S806 and step S807 may be performed. Here, the execution sequence of step S806 and step S807 is not limited, and fig. 8 shows that step S806 is executed first and then step S807 is executed only as an example.
S806, the window manager acquires a screen shot.
In some embodiments, the window manager may sense an operation of the user to rotate the screen clockwise by 90 ° through the acceleration sensor and/or the gyro sensor. And responding to the operation of the user, the window manager captures a screen of the interface currently displayed by the screen, and acquires a screen snapshot. The interface currently displayed on the screen may refer to an interface displayed on the screen before the electronic device rotates the screen by 90 ° in response to an operation input by the user to adjust the image display state.
In an example, before the user inputs the operation of rotating the screen by 90 ° through step S805, the screen is displayed with an image corresponding to the image browsing operation on the vertical screen, and after the user inputs step S805, the window manager acquires the screen snapshot as an interface of the image corresponding to the image browsing operation on the vertical screen because the screen needs to be gradually transitioned from the vertically displayed image to the horizontally displayed image. In some embodiments, after the window manager takes the screen shot, the screen shot may be displayed.
S807, the window manager sends a message to the gallery to inform the screen rotation.
The window manager sends a message (which may be referred to as a second message) to the gallery in response to the user inputting the 90 deg. rotation of the screen, the second message being for notifying the gallery that the user has inputted the 90 deg. rotation of the screen.
In some embodiments, the second message may carry a parameter that rotates the screen 90 °, such as a parameter that indicates rotating the screen 90 ° clockwise or counterclockwise, or the like.
S808, the gallery sends a message to the photo management to notify the screen rotation.
The gallery receives the second message sent by the window manager and forwards the second message to the photo management.
S809, photo management inquires whether the image is in an editing state or a popup state from a gallery.
After the photograph management receives the second message, step S809 and step S812 may be performed. Here, the execution sequence of step S809 and step S812 is not limited, and fig. 8 shows that step S809 is executed first and then step S812 is executed only as an example.
Photo management inquires of the gallery whether the image is in an edit state or a popup state through step S809. In some embodiments, the photo management sends a request message to the gallery requesting a query as to whether the image is in an edit state or a pop-up state.
The image being in the editing state may refer to a user clicking an "edit" button in the image browsing interface shown in fig. 1 (a), and the gallery controls the image to be in the editing state in response to a clicking operation. In some embodiments, the gallery application controls the image to be in an edited state, and the image may be recorded in an edited state with the parameters synchronized. Based on this, the gallery may query the parameter to determine whether the image is in an edited state.
The image being in a popup state may refer to the image browsing interface displaying a popup, and illustratively, the user clicks a "delete" button in the image browsing interface illustrated in (a) of fig. 1, and the gallery displays the popup to remind the user whether to delete the image in response to the clicking operation. In some embodiments, the gallery display popup may also be recorded with parameters. Thus, the gallery may also query parameters to determine whether the image is in a popup state.
S810, the gallery sends a scaling multiple n with a value of 0 to the window manager.
And if the gallery query image is in an editing state or a popup state, sending a scaling multiple n of 0 to a window manager. The scaling multiple is 0, which is used for indicating that the window manager does not need to perform scaling processing on the display window. Of course, 0 is an exemplary value, and when the image is in the editing state or the popup state, the zoom factor sent by the gallery to the window manager may be other values, as long as it is ensured that the value calculated in step S804 is not the value.
S811, the gallery returns the query result of the image state to the photo management.
The gallery inquires whether the image is in an editing state or a popup state, and sends the inquired result to photo management.
S812, inquiring whether the gallery is in an immersive image browsing state by photo management.
After the photograph management receives the second message, it queries the gallery whether the gallery is in an immersive view image state, via step S812. In some embodiments, the photograph management sends a request message to the gallery requesting a query as to whether the gallery is in an immersive view image state.
S813, the gallery returns the background color of the window to the photo management based on the query result.
The gallery receives a request message sent by photo management, and in response to the request message, the query gallery is in an immersive browsing image state. The immersive view image state may refer to the gallery control screen displaying an image full screen, not displaying other interface elements such as buttons, as illustrated in (a) or (b) of fig. 2. It should be noted that, due to the difference between the image size and the screen size, the full screen display image does not mean that the image content of the image occupies the screen, but means that the screen only displays the image content and the background, and other interface elements such as buttons are not displayed.
The user may input a click operation to the image browsing interface shown in fig. 1 (a), and in response to the operation, the gallery displays an interface for immersive browsing of images as shown in fig. 2 (a). In synchronization, the gallery applies recording parameters to indicate that the gallery is in an immersive view image state. The gallery application may query the parameters to determine whether it is in an immersive view image state.
As can be seen from fig. 1 (a) and fig. 2 (a), the gallery displays images in a non-immersive manner and images in an immersive manner, with differences in the background color of the images. Illustratively, the image is displayed non-immersively, the background color of the image is light, such as white, light gray, etc., and the background color of the image is dark, such as black. The background color of an image can be understood to be the background color of the window displaying the image. Thus, the gallery application may return the background color of the window to the photo management based on the query results of whether the gallery is in an immersive view image state.
S814, the photo management sends the zoom multiple n and the background color of the window to the window manager.
The photo management, through step S811, sets the zoom factor n as a buffer value if the image is not in the editing state or in the popup state, that is, the value calculated in step S804, so that the photo management sends the zoom factor n and the background color of the window to the window manager.
S815, the window manager judges whether n is greater than 0.
The window manager determines whether the scaling multiple n is greater than 0, wherein the window manager may perform step S815 if the scaling multiple n is not greater than 0, and may perform steps S816 to S819 if the scaling multiple n is greater than 0.
S816, the window manager executes a conventional flow.
The window manager judges that the scaling multiple n is not more than 0, and executes a conventional process, wherein the conventional process can be understood as that screen shots, display windows and bottom plates are sequentially combined, the screen shots are positioned on the top layer, the color of the bottom plates is set to be the background color of the windows, the screen shots, the display windows and the bottom plates are rotated by 90 degrees from 0 degrees and then rotated by 90 degrees back to 0 degrees, in the rotating process, the screen shots slowly become transparent, the width change of the bottom plates is high, and the height change is wide.
In some embodiments, the background color of the window may be obtained by the window manager to the gallery, or may be obtained by other means.
It should be noted that, the window manager judges that the scaling multiple n is not greater than 0, and indicates that the image is in an editing state or a popup state, and the window manager does not scale the display window, and executes a conventional process with the original size display window, which is because the image is in the editing state or the popup state, the image content in the interface displayed before the screen rotates (i.e., the image content in the screen snapshot) is different from the image content in the interface displayed after the screen rotates (i.e., the image content in the display window), for example, the size and the position of the popup are different, the screen snapshot transitions to a semitransparent state, and the image content in the screen snapshot and the image content in the display window have ghost, even if the display window is scaled, the ghost still exists, the image in the rotating process is unclear and is not smooth. Thus, scaling the display window is an inefficient operation, wasting only power consumption.
S817, the window manager zooms the display window to 1/n, the control screen snapshot is located at the top layer, the display window is located at the next layer, a bottom plate is arranged at the lower layer of the display window, and the color of the bottom plate is the background color of the window.
The window manager judges that the scaling multiple n is larger than 0, and indicates that the image is not in an editing state and is not in a popup state. The window manager may acquire a display window first, where the display window may be understood as an interface of an image displayed on a horizontal screen drawn by the electronic device in response to an operation of rotating the screen by 90 ° by a user, where the display window displays image content, and may also display status bars including content such as "share", "collect" and the like shown in fig. 1 (b). The display window includes a plurality of layers, and the layer at the top layer includes image content and status bars.
The window manager firstly zooms the display window to 1/n, so that the size of the image content in the display window is ensured to be the same as that of the image content in the screen snapshot, and double images of the display window and the screen snapshot are avoided. The window manager also adds a backplane to the display window, and in some embodiments, the window manager uses the SurfaceControll. Transaction. Setcolor () method to set the background color of the window to the backplane, which is the same size as the display window before scaling.
The arrangement mode of the screen snapshot, the display window and the bottom plate window from top to bottom is that the screen snapshot is located on the top layer, the display window is located on the next layer, the bottom plate is located on the bottom layer, and the upper layer content shields the lower layer content. Thus, the screen shot obscures the display window, which obscures the bottom plate.
In some embodiments, the window manager controls the screen shots to be at the top layer and the display windows to be at the next layer may be in such a way that the window manager controls the display screen shots and controls the electronic device to draw the display windows at the next layer of the screen shots.
It should be noted that, scaling the display window to 1/n by the window manager means scaling the display window to 1/n as a whole, and the display window includes multiple layers, that is, scaling multiple images to 1/n. The display window includes image content and status bars that are both scaled to 1/n.
It should be further noted that, in the example illustrated in fig. 3, the image 101 belongs to an image captured by a horizontal screen, and is displayed in a vertical screen display manner, and the image area is smaller than the image area when it is displayed in a horizontal screen display manner, that is, the size of the image 101 in the first screen shot 301 in fig. 3 is smaller than the size of the image 101 in the first display window 303. In this case, the zoom factor n calculated by the photograph management 804 is a value greater than 1, and the window manager zooms the display window to 1/n, which is to zoom out the display window, such as the first display window 303 shown in fig. 3, and then to obtain the second display window 304 after being zoomed out and rotated.
When the image is an image captured by a vertical screen, the image area when displayed by the vertical screen display is larger than the image area when displayed by a horizontal screen display, in which case the zoom factor n calculated by the photograph management 804 is a value smaller than 1, and the window manager zooms the display window to 1/n, which is to enlarge the display window, and of course, the size of the enlarged image area of the display window is the same as the size of the image area of the screen snapshot.
S818, the window manager controls the screen shot and the display window to rotate 90 degrees.
As described in the previous step S805, the screen is rotated by the user by 90 ° along the pointer, and in order to enable the screen shot to fit the rotated screen, the window manager controls the screen shot and the display window to be rotated by 90 ° along the pointer. And, the screen shot is positioned at the upper layer of the display window, and the screen can display the screen shot.
It should be noted that, step S817 and step 818 illustrate that the window manager controls the zoom of the display window to 1/n, controls the display window to rotate 90 °, controls the screen shot to be located at the top layer, the display window to be located at the next layer, and sets the bottom plate at the lower layer of the display window, where the color of the bottom plate is the execution sequence of several steps of the background color of the window, but this does not limit the execution sequence of these several steps. Fig. 3 also illustrates, by way of example, another execution sequence of the several steps described above.
In some embodiments, the window manager may further obtain a screen shot, zoom the display window to 1/n, control the screen shot to be located at the top layer, and the display window to be located at the next layer, set a bottom plate at the lower layer of the display window, where the color of the bottom plate is the background color of the window, and the size is the same as the screen shot, and rotate the screen shot, the display window, and the bottom plate together by 90 ° along the pointer.
And S819, adding 90-0 degree rotary animations to the screen shot, the display window and the bottom plate by the window manager, adding animations with transparency from 1 to 0 to the screen shot, adding animations with high and high widths to the bottom plate, adding a restore animation and a clipping animation to the display window.
The user rotates the screen by 90 degrees, the electronic equipment needs to gradually transition from the vertical screen display image to the horizontal screen display image, and based on the display, the electronic equipment adopts a rotary animation mode to realize the gradual transition from the vertical screen display image to the horizontal screen display image. Since the screen shot and the display window are rotated by 90 ° along the pointer by step S818, the rotational animation added to the screen shot, the display window, and the base plate includes a rotational animation of 90 ° to 0 °, i.e., a rotational animation rotated 90 ° counterclockwise.
Because the screen shots are positioned on the top layer, the display window is positioned on the next layer, and the display window is blocked by the screen shots. When the electronic equipment is adjusted to be a horizontal screen, the screen can display a display window, so that the screen snapshot needs to be changed into transparent slowly, and based on the screen window, the window manager adds an animation with the transparency from 1 to 0 to the screen snapshot, wherein the transparency is 1 to indicate non-transparency, and the transparency is 0 to indicate complete transparency. Animation with transparency from 1 to 0 includes controlling the screen shot to slowly change from transparency 1 to transparency 0 in a step size, which may be a set value, of course, 1 and 0 are exemplary values shown.
The bottom plate is positioned at the next layer of the display window, the size of the bottom plate is the same as that of the display window, the bottom plate rotates from 90 degrees to 0 degrees, the width of the bottom plate is gradually reduced to be high, and the height is gradually increased to be wide, so that the window manager adds the animation of increasing the width to be high and increasing the width to the bottom plate. In some embodiments, the animation of the base plate becoming higher in width and higher in width is also changed in a certain step, and the step can also be a set value.
Since the display window is scaled to 1/n by step S817, the display window is restored to the original size after the rotation animation of 90 ° to 0 ° is completed, and thus the window manager adds the restoration animation to the display window. The reduction animation may refer to a gradual reduction of the display window from 1/n to 1 in size, i.e. a gradual expansion by a factor of n. In some embodiments, the window manager also expands the display window by n times slowly with a step size, which is a set point.
In the process that the screen snapshot, the display window and the bottom plate rotate according to the rotation animation of 90 degrees to 0 degrees, the screen snapshot is slowly transparent, the display window is slowly expanded, when the screen snapshot is in a semitransparent state, the content of the display window can be slowly visible to a user, in order to ensure that the display window presented to the user by the screen is of a regular size, a cutting animation can be added to the display window, and the cutting animation is used for cutting out the area of the display window beyond the bottom plate, so that the display window is slowly expanded and slowly presented in the regular size of the bottom plate.
In some embodiments, the clip width of the clip animation gradually changes from d to 0, d= (H/n-W)/2, H is the height of the screen, W is the width of the screen, and n is the zoom factor. The clipping width can also be gradually changed from d to 0 in a certain step length, the step length is a set value, and the step length can be in a linear relation. d= (H/n-W)/2 is understood as an initial value of the calculated clipping width, and as shown in the first diagram of fig. 4, H/n is the height of the second display window 304, W is the width of the screen, i.e. the height of the second screen snapshot 302, and (H/n-W)/2 is the width of the second display window beyond the area of the bottom plate, i.e. the height of the second display window 304 beyond the upper half area of the bottom plate, and is also the height of the second display window 304 beyond the lower half area of the bottom plate. The electronic device cuts out the area of the second display window 304 beyond the bottom plate at the top and bottom of the second display window 304 in such a way that the cutting width gradually changes from d to 0.
The window manager adds a rotation animation of 90 ° to 0 ° to the display window, and when the rotation animation is executed, the whole display window rotates, that is, all of the multiple layers included in the display window rotate. Of course, the image content and the status bar included in the display window are also rotated, so that the limitation caused by that only the image content rotates and the status bar does not rotate can be avoided.
In addition, the window manager adds the 90-0 degree rotation animation and executes the rotation effect, so that the system level module of the electronic equipment can be understood to execute the rotation effect without adopting the gallery application to execute the rotation effect, the operation of the gallery application main thread can not be influenced, the operation pressure can not be brought to the gallery application, and the fluency of the rotation effect is ensured to a certain extent.
S820, the window manager executes the added animation on the screen shot, the display window and the bottom plate.
After adding animation to the screen snapshot, the display window and the bottom plate, the window manager executes the added animation, so that smooth and clear transition of the vertical screen display image into the horizontal screen display image is realized.
The horizontal and vertical screen switching method provided by the embodiment of the application can also be applied to scenes of video display of electronic equipment.
The user inputs a browse video operation through step S801, and the gallery transmits a first message to the video management to notify the video management user of browsing videos. Video management acquires video data, acquires the width and height of a frame of image in a video, and calculates a scaling multiple n based on the width and height of the image. After the window manager receives the operation of rotating the screen by 90 ° input by the user through step S805, the gallery and the video management interact to perform steps S808 to S813, and the video management also performs step S814. Therefore, in the scene of the video displayed by the electronic equipment through the gallery, the user rotates the screen to adjust the mode of holding the equipment, and the screen displays the display mode of the video in a clear and smooth dynamic effect.
It should be noted that in the embodiment of the present application, the rotation effect is executed by a system level module such as a window manager, and is not executed by applications such as a gallery, so that the horizontal-vertical screen switching method provided by the embodiment of the present application can be ensured to be applicable to a scene of displaying an image, and also can be applied to a scene of playing a video. Especially in the scene of playing video, the window manager executes the rotation effect, so that smooth display of the rotation effect can be ensured to be completed when the video is played.
Another embodiment of the application also provides a computer-readable storage medium having instructions stored therein, which when run on a computer or processor, cause the computer or processor to perform one or more steps of any of the methods described above.
The computer readable storage medium may be a non-transitory computer readable storage medium, for example, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Another embodiment of the application also provides a computer program product containing instructions. The computer program product, when run on a computer or processor, causes the computer or processor to perform one or more steps of any of the methods described above.

Claims (13)

1.一种横竖屏切换方法,其特征在于,包括:1. A method for switching between horizontal and vertical screens, comprising: 电子设备以第一显示方式显示第一界面,所述第一界面显示有图像;The electronic device displays a first interface in a first display mode, where the first interface displays an image; 在所述电子设备接收到由所述第一显示方式切换为第二显示方式的操作时,所述电子设备获取所述第一界面的屏幕快照,以及将第一显示窗口进行缩放和沿第一方向的旋转处理得到第二显示窗口;其中,所述第一显示窗口指代所述电子设备以第二显示方式显示所述图像时的窗口,所述第一界面的屏幕快照的长边与所述第一显示窗口的长边同向,所述第二显示窗口的长边与所述第一显示窗口的短边同向,所述第二显示窗口显示的图像的尺寸与所述第一界面的屏幕快照中图像的尺寸相同;所述第一显示方式和所述第二显示方式指代竖屏显示方式和横屏显示方式中的一个;When the electronic device receives an operation to switch from the first display mode to the second display mode, the electronic device obtains a screenshot of the first interface, and scales and rotates the first display window along a first direction to obtain a second display window; wherein the first display window refers to a window when the electronic device displays the image in the second display mode, the long side of the screenshot of the first interface is in the same direction as the long side of the first display window, the long side of the second display window is in the same direction as the short side of the first display window, and the size of the image displayed in the second display window is the same as the size of the image in the screenshot of the first interface; the first display mode and the second display mode refer to one of a portrait display mode and a landscape display mode; 所述电子设备在由所述第一显示方式切换为所述第二显示方式的过程中,显示由所述第一界面的屏幕快照过渡到第二界面的动效,所述第二界面由所述第二显示窗口进行还原和沿第二方向的旋转得到,所述第二方向为所述第一方向的反向方向,所述第二界面显示的图像的尺寸与所述第一显示窗口显示的图像的尺寸相同。During the process of switching from the first display mode to the second display mode, the electronic device displays a dynamic effect of transitioning from a screenshot of the first interface to the second interface. The second interface is obtained by restoring the second display window and rotating along a second direction. The second direction is the opposite direction of the first direction. The size of the image displayed on the second interface is the same as the size of the image displayed in the first display window. 2.根据权利要求1所述的横竖屏切换方法,其特征在于,所述电子设备获取所述第一界面的屏幕快照,所述第一界面的屏幕快照的长边与所述第一显示窗口的长边同向,包括:2. The method for switching between horizontal and vertical screen orientations according to claim 1, wherein the electronic device obtains a screenshot of the first interface, wherein a long side of the screenshot of the first interface is in the same direction as a long side of the first display window, comprising: 所述电子设备获取所述第一界面以所述第一显示方式显示时的初始屏幕快照;The electronic device obtains an initial screen snapshot when the first interface is displayed in the first display mode; 所述电子设备将所述初始屏幕快照沿所述第一方向旋转得到所述第一界面的屏幕快照,以实现所述第一界面的屏幕快照的长边与所述第一显示窗口的长边同向。The electronic device rotates the initial screenshot along the first direction to obtain a screenshot of the first interface, so that the long side of the screenshot of the first interface is in the same direction as the long side of the first display window. 3.根据权利要求2所述的横竖屏切换方法,其特征在于,所述电子设备将所述初始屏幕快照沿所述第一方向旋转得到所述第一界面的屏幕快照,以及所述电子设备将第一显示窗口进行缩放和沿第一方向的旋转处理得到第二显示窗口的方式,包括:3. The method for switching between landscape and portrait orientations according to claim 2, wherein the electronic device rotates the initial screenshot along the first direction to obtain a screenshot of the first interface, and the electronic device scales the first display window and rotates the first display window along the first direction to obtain the second display window, comprising: 所述电子设备将所述第一显示窗口进行缩放得到第三显示窗口,所述第三显示窗口显示的图像的尺寸与所述初始屏幕快照中图像的尺寸相同,再以所述初始屏幕快照位于顶层,所述第三显示窗口位于所述初始屏幕快照的下层的方式组合所述初始屏幕快照和所述第三显示窗口,再将组合后的所述初始屏幕快照和所述第三显示窗口沿所述第一方向旋转;The electronic device scales the first display window to obtain a third display window, where the size of the image displayed in the third display window is the same as the size of the image in the initial screenshot, combines the initial screenshot and the third display window in such a manner that the initial screenshot is located on a top layer and the third display window is located below the initial screenshot, and rotates the combined initial screenshot and the third display window along the first direction; 其中,所述第二显示窗口指代旋转后的所述第三显示窗口。The second display window refers to the rotated third display window. 4.根据权利要求3所述的横竖屏切换方法,其特征在于,所述电子设备以所述初始屏幕快照位于顶层,所述第三显示窗口位于所述初始屏幕快照的下层的方式组合所述初始屏幕快照和所述第三显示窗口过程中还包括:4. The method for switching between horizontal and vertical screens according to claim 3, wherein the electronic device further comprises: 所述电子设备在所述第三显示窗口的下层设置底板,所述底板的尺寸与所述初始屏幕快照的尺寸相同;The electronic device is provided with a bottom plate in a lower layer of the third display window, wherein the size of the bottom plate is the same as the size of the initial screenshot; 其中,所述电子设备将组合后的所述初始屏幕快照和所述第三显示窗口沿所述第一方向旋转包括:所述电子设备将组合后的初始屏幕快照,所述第三显示窗口以及所述底板沿所述第一方向旋转。The electronic device rotating the combined initial screen snapshot and the third display window along the first direction includes: the electronic device rotating the combined initial screen snapshot, the third display window and the bottom plate along the first direction. 5.根据权利要求4所述的横竖屏切换方法,其特征在于,所述述电子设备在所述第三显示窗口的下层设置底板之后,还包括:5. The method for switching between horizontal and vertical screens according to claim 4, wherein after the electronic device sets a bottom plate below the third display window, the electronic device further comprises: 所述电子设备为所述底板设置窗口的背景颜色;所述窗口的背景颜色指代所述第一界面中图像的背景颜色。The electronic device sets a background color of a window for the bottom panel; the background color of the window refers to the background color of the image in the first interface. 6.根据权利要求1至5中任一所述的横竖屏切换方法,其特征在于,所述电子设备在由所述第一显示方式切换为所述第二显示方式的过程中,显示由所述第一界面的屏幕快照过渡到第二界面的动效,包括:6. The method for switching between horizontal and vertical screens according to any one of claims 1 to 5, wherein, when the electronic device switches from the first display mode to the second display mode, displaying a transition effect from a screenshot of the first interface to the second interface comprises: 所述电子设备在所述由所述第一显示方式切换为所述第二显示方式的过程中,先显示组合后的所述第一界面的屏幕快照和所述第二显示窗口,再控制所述组合后的所述第一界面的屏幕快照和所述第二显示窗口沿所述第二方向旋转,且在所述组合后的所述第一界面的屏幕快照和所述第二显示窗口沿所述第二方向旋转的过程中,所述第一界面的屏幕快照逐渐透明,所述第二显示窗口的尺寸逐渐还原到所述第一显示窗口的尺寸;During the process of switching from the first display mode to the second display mode, the electronic device first displays the combined screenshot of the first interface and the second display window, and then controls the combined screenshot of the first interface and the second display window to rotate along the second direction. During the process of rotating the combined screenshot of the first interface and the second display window along the second direction, the screenshot of the first interface gradually becomes transparent, and the size of the second display window gradually returns to the size of the first display window. 其中:所述第一界面的屏幕快照和所述第二显示窗口的组合方式包括:所述第一界面的屏幕快照位于顶层,所述第二显示窗口位于所述第一界面的屏幕快照的下层。The combination of the screenshot of the first interface and the second display window includes: the screenshot of the first interface is located at the top layer, and the second display window is located at the bottom layer of the screenshot of the first interface. 7.根据权利要求6所述的横竖屏切换方法,其特征在于,所述组合后的所述第一界面的屏幕快照和所述第二显示窗口的下层还包括底板,所述底板的尺寸与所述第一界面的屏幕快照的尺寸相同;7. The method for switching between landscape and portrait modes according to claim 6, wherein the lower layer of the combined screenshot of the first interface and the second display window further comprises a bottom plate, and the size of the bottom plate is the same as the size of the screenshot of the first interface; 所述控制所述组合后的所述第一界面的屏幕快照和所述第二显示窗口沿所述第二方向旋转,包括:控制所述组合后的所述第一界面的屏幕快照、所述第二显示窗口和所述底板沿所述第二方向旋转;The controlling the combined screenshot of the first interface and the second display window to rotate along the second direction includes: controlling the combined screenshot of the first interface, the second display window, and the bottom plate to rotate along the second direction; 所述在所述组合后的所述第一界面的屏幕快照、所述第二显示窗口和所述底板沿所述第二方向旋转的过程中,所述底板的宽逐渐变化为高,高逐渐变化为宽。During the process of the combined screenshot of the first interface, the second display window, and the bottom plate rotating along the second direction, the width of the bottom plate gradually changes to the height, and the height gradually changes to the width. 8.根据权利要求7所述的横竖屏切换方法,其特征在于,所述在所述组合后的所述第一界面的屏幕快照、所述第二显示窗口和所述底板沿所述第二方向旋转的过程中,还包括:裁剪掉所述第二显示窗口超出所述底板的区域。8. The method for switching between horizontal and vertical screens according to claim 7 is characterized in that, during the process of rotating the combined screenshot of the first interface, the second display window and the bottom plate along the second direction, it also includes: cropping the area of the second display window that exceeds the bottom plate. 9.根据权利要求1所述的横竖屏切换方法,其特征在于,所述电子设备将所述第一显示窗口进行缩放和沿第一方向的旋转处理得到第二显示窗口之前,还包括:9. The method for switching between landscape and portrait modes according to claim 1, wherein before the electronic device scales the first display window and rotates it along a first direction to obtain the second display window, the method further comprises: 所述电子设备确定所述第一界面没有显示弹窗以及所述第一界面显示的图像不处于编辑状态。The electronic device determines that no pop-up window is displayed on the first interface and the image displayed on the first interface is not in an editing state. 10.根据权利要求1至9中任一所述的横竖屏切换方法,其特征在于,所述电子设备将所述第一显示窗口进行缩放包括:所述电子设备将所述第一显示窗口按照缩放倍数进行缩放,所述缩放倍数指代所述图像因第一显示方式和第二显示方式之间切换的缩放倍数;10. The method for switching between landscape and portrait modes according to any one of claims 1 to 9, wherein the electronic device scaling the first display window comprises: scaling the first display window by a scaling factor, wherein the scaling factor refers to a scaling factor of the image due to switching between the first display mode and the second display mode; 所述第二界面由所述第二显示窗口进行还原,包括:所述第二界面由所述第二显示窗口按照所述缩放倍数还原。The second interface is restored by the second display window, including: the second interface is restored by the second display window according to the zoom factor. 11.一种电子设备,其特征在于,包括:11. An electronic device, comprising: 一个或多个处理器、存储器以及显示屏;one or more processors, memory, and display screens; 所述存储器和所述显示屏与所述一个或多个所述处理器耦合,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,当所述一个或多个处理器执行所述计算机指令时,所述电子设备执行如权利要求1至10任一项所述的横竖屏切换方法。The memory and the display screen are coupled to the one or more processors, the memory is used to store computer program code, and the computer program code includes computer instructions. When the one or more processors execute the computer instructions, the electronic device executes the horizontal and vertical screen switching method as described in any one of claims 1 to 10. 12.一种计算机可读存储介质,其特征在于,用于存储计算机程序,所述计算机程序被执行时,具体用于实现如权利要求1至10任一项所述的横竖屏切换方法。12. A computer-readable storage medium, characterized in that it is used to store a computer program, and when the computer program is executed, it is specifically used to implement the horizontal and vertical screen switching method according to any one of claims 1 to 10. 13.一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得计算机执行如权利要求1至10任一项所述的横竖屏切换方法。13. A computer program product, characterized in that when the computer program product is run on a computer, it enables the computer to execute the method for switching between horizontal and vertical screens according to any one of claims 1 to 10.
CN202410605732.7A 2024-05-15 2024-05-15 Method for switching horizontal screen and vertical screen, electronic device, readable medium and program product Pending CN120743398A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410605732.7A CN120743398A (en) 2024-05-15 2024-05-15 Method for switching horizontal screen and vertical screen, electronic device, readable medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410605732.7A CN120743398A (en) 2024-05-15 2024-05-15 Method for switching horizontal screen and vertical screen, electronic device, readable medium and program product

Publications (1)

Publication Number Publication Date
CN120743398A true CN120743398A (en) 2025-10-03

Family

ID=97184321

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410605732.7A Pending CN120743398A (en) 2024-05-15 2024-05-15 Method for switching horizontal screen and vertical screen, electronic device, readable medium and program product

Country Status (1)

Country Link
CN (1) CN120743398A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120084726A1 (en) * 2010-10-01 2012-04-05 Imerj LLC Minimizing application windows
CN102520842A (en) * 2011-11-18 2012-06-27 广东欧珀移动通信有限公司 A horizontal and vertical screen switching rotation control method for a handheld device
CN103176689A (en) * 2011-12-26 2013-06-26 腾讯科技(深圳)有限公司 Interface switching method and interface switching system
CN109126131A (en) * 2018-07-09 2019-01-04 网易(杭州)网络有限公司 Game picture display methods, storage medium and terminal
CN110399064A (en) * 2019-07-22 2019-11-01 腾讯科技(深圳)有限公司 Switching method and apparatus, storage medium and the electronic device of display interface
CN114640743A (en) * 2020-12-15 2022-06-17 华为技术有限公司 Display method and device for interface dynamic effect
CN114816602A (en) * 2021-01-27 2022-07-29 华为技术有限公司 Application display method, device, chip system, medium and program product
CN115361468A (en) * 2022-10-21 2022-11-18 荣耀终端有限公司 Display optimization method and device during screen rotation and storage medium
CN117376659A (en) * 2022-06-30 2024-01-09 华为技术有限公司 A display method and related device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120084726A1 (en) * 2010-10-01 2012-04-05 Imerj LLC Minimizing application windows
CN102520842A (en) * 2011-11-18 2012-06-27 广东欧珀移动通信有限公司 A horizontal and vertical screen switching rotation control method for a handheld device
CN103176689A (en) * 2011-12-26 2013-06-26 腾讯科技(深圳)有限公司 Interface switching method and interface switching system
CN109126131A (en) * 2018-07-09 2019-01-04 网易(杭州)网络有限公司 Game picture display methods, storage medium and terminal
CN110399064A (en) * 2019-07-22 2019-11-01 腾讯科技(深圳)有限公司 Switching method and apparatus, storage medium and the electronic device of display interface
CN114640743A (en) * 2020-12-15 2022-06-17 华为技术有限公司 Display method and device for interface dynamic effect
CN114816602A (en) * 2021-01-27 2022-07-29 华为技术有限公司 Application display method, device, chip system, medium and program product
CN117376659A (en) * 2022-06-30 2024-01-09 华为技术有限公司 A display method and related device
CN115361468A (en) * 2022-10-21 2022-11-18 荣耀终端有限公司 Display optimization method and device during screen rotation and storage medium

Similar Documents

Publication Publication Date Title
US12197809B2 (en) Systems, methods, and graphical user interfaces for selecting audio output modes of wearable audio output devices
US9817487B2 (en) Rotation smoothing of a user interface
US9881353B2 (en) Buffers for display acceleration
US20230419454A1 (en) Control blurring method and apparatus, terminal device, and readable storage medium
CN115097994B (en) Data processing method and related device
EP4047464B1 (en) Screenshot display method and apparatus, and terminal device
WO2015131767A1 (en) Video processing method and apparatus
CN113747199A (en) Video editing method, video editing apparatus, electronic device, storage medium, and program product
WO2024222356A1 (en) Special-effect generation method and apparatus, and computer device and storage medium
WO2022062949A1 (en) Dynamic element control method, electronic device and computer-readable storage medium
CN116095249B (en) Video processing method and electronic device
US11393164B2 (en) Device, method, and graphical user interface for generating CGR objects
CN115018692A (en) Image rendering method and electronic equipment
CN111031377B (en) Mobile terminal and video production method
CN120743398A (en) Method for switching horizontal screen and vertical screen, electronic device, readable medium and program product
CA2799016A1 (en) Updating graphical display content
CN119631044A (en) Window display method, electronic device and computer readable storage medium
CN119645540A (en) Window display method, electronic device and computer storage medium
CN114723871B (en) Picture data processing method and device, electronic equipment and storage medium
CN117131296B (en) Content presentation method, device, equipment and storage medium
CN118426892B (en) Interface switching method, electronic equipment and storage medium
US20250156024A1 (en) Application display method and electronic device
CN121143912A (en) Rotation effect display method, chip, electronic equipment and medium
CN119179413A (en) Menu display method, electronic device, and computer-readable storage medium
CN116095460A (en) Video recording method, device 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