Display method and electronic device

By setting the DPI of the first electronic device consistent with the DPI of the second electronic device and scaling the window image, the compatibility problems caused by inconsistency in the screen projection process and the problem of excessive window resources are solved, and the user experience is improved.

CN115686405BActive Publication Date: 2025-05-02HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202110877514.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-31
Publication Date
2025-05-02
Estimated Expiration
2041-07-31

AI Technical Summary

Technical Problem

During the screen projection process, due to the different display pixel density of the mobile phone and the monitor, compatibility issues such as refreshing the application interface or restarting the application may occur. After the mobile phone is projected to the monitor, the resources on the window such as fonts and pictures are too large, resulting in poor user experience.

Method used

By obtaining the DPI of the second electronic device and setting the DPI of the first electronic device to be the same as the DPI of the second electronic device, the image of the creation window is scaled, and the problem of excessive window resources after the screen projection is solved.

Benefits of technology

It effectively solves the problem of large display of fonts, pictures, etc. on the window after the screen projection, improves the user experience, and avoids compatibility issues such as refreshing or restarting the application interface.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115686405B_ABST
    Figure CN115686405B_ABST
Patent Text Reader

Abstract

The present application provides a display method and an electronic device. In the method, a first electronic device is connected to a second electronic device, the first electronic device obtains the display pixel density DPI of the second electronic device, and sets the DPI of the first electronic device to the same DPI as the DPI of the second electronic device; the first electronic device receives a first trigger event, which is a trigger operation of a first application icon by a user; the first electronic device responds to the trigger event and creates a first window; the first electronic device obtains an image of the first window based on the first window; the first electronic device scales the image of the first window to obtain a first image; the first electronic device obtains a second image based on the first image, and sends the second image to the second electronic device for display. The method of the present application can solve the problem of large display of window images, fonts, etc. on the projection device, and can improve the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a display method and an electronic device. Background Art

[0002] At present, in order to meet the needs of users in different scenarios, screen projection technology has been used more and more widely, such as projecting the mobile phone screen to a monitor and then displaying the mobile phone interface on the monitor. Due to the different display pixel densities (dots per inch, DPI) of mobile phones and monitors, and the DPI of mobile phones is generally greater than the DPI of monitors, when the mobile phone screen is projected to the monitor, compatibility issues such as application interface refresh or application restart may occur.

[0003] To avoid the above situation, it is necessary to ensure that the DPI of the mobile phone is consistent with the DPI of the display displayed on the monitor. However, due to the different screen resolutions of the mobile phone and the monitor, when the screen resolution of the mobile phone is relatively large, if the mobile phone is projected to the monitor, the resources on the mobile phone window displayed on the monitor, such as fonts and pictures, will be larger, resulting in a poor user experience. Summary of the invention

[0004] The present application provides a display method and an electronic device for solving the problem of large display of fonts, pictures, etc. on the window of a projection device, thereby improving the user experience.

[0005] In a first aspect, the present application provides a display method, which includes: first, a first electronic device is connected to a second electronic device, and then the first electronic device obtains the DPI of the second electronic device, and sets its own DPI to the same DPI as the DPI of the second electronic device. Based on this, the first electronic device can receive a first trigger event, which is a user's trigger operation on a first application icon; then, the first electronic device responds to the first trigger event and creates a first window, which is an application window corresponding to the first application; then, the first electronic device obtains an image of the first window based on the first window, and scales the image of the first window to obtain a first image; finally, the first electronic device obtains a second image based on the first image, and sends the second image to the second electronic device for display.

[0006] In the above technical solution, the first electronic device obtains the DPI of the second electronic device, sets its own DPI to the same DPI as that of the second electronic device, and then scales the image used to create the first window on this basis, thereby reducing the image of the window. This can solve major problems such as fonts and images displayed on the second electronic device and improve user experience.

[0007] In one possible design, the DPI of the first electronic device includes a DPI preset at the factory of the first electronic device and a DPI of a virtual display created by the first electronic device.

[0008] It should be noted that in the same-source screen projection scenario, the DPI of the first electronic device includes only one, namely the factory preset DPI. In the different-source screen projection scenario, the DPI of the first electronic device may include two, namely the factory preset DPI and the DPI of the virtual display.

[0009] In one possible design, the first electronic device sets the DPI of the first electronic device and the DPI of the second electronic device to the same DPI, including: the first electronic device sets its own factory-preset DPI to the same DPI as the DPI of the second electronic device, or the first electronic device sets the DPI of the second electronic device to the same DPI as its own factory-preset DPI.

[0010] In one possible design, the first electronic device sets the DPI of the first electronic device and the DPI of the second electronic device to the same DPI, including: the first electronic device sets its own factory-preset DPI to the same DPI as the DPI of the second electronic device; or the first electronic device sets the DPI of the second electronic device to the same DPI as its own factory-preset DPI; or the first electronic device sets the DPI of a created virtual display to the same DPI as the DPI of the second electronic device; or the first electronic device sets the DPI of the second electronic device to the same DPI as the DPI of the created virtual display.

[0011] In a possible design, the first electronic device creates a first window, including: the first electronic device obtains a size and a preset zoom ratio of a preset window, and creates the first window according to the size and the preset zoom ratio of the preset window.

[0012] In a possible design, the first electronic device scales the image of the first window to obtain the first image, including: the first electronic device scales the image of the first window according to the preset scaling ratio to obtain the first image.

[0013] In one possible design, the preset zoom ratio is the ratio between the DPI preset at the factory of the first electronic device and the DPI preset at the factory of the second electronic device, or the preset zoom ratio is the ratio between the DPI preset at the factory of the first electronic device and the DPI preset at the factory of the second electronic device.

[0014] In one possible design, the first electronic device receives a first trigger event, including: the first electronic device receives a first trigger event triggered by a user on the first electronic device; or the first electronic device receives a first trigger event sent by the second electronic device, and the first trigger event is triggered by the user on the second electronic device.

[0015] In a possible design, the image of the first window is displayed on a display of the first electronic device or a virtual display created by the first electronic device.

[0016] In one possible design, the first electronic device obtains the second image based on the first image, including: the first electronic device synthesizes the layer where the first image is located and the layer where the background is located to obtain the second image.

[0017] In one possible design, the first electronic device is connected to the second electronic device, including: the first electronic device is connected to the second electronic device via Wi-Fi, Bluetooth, or wired connection.

[0018] In a possible design, the window type of the first window is a floating window, a full-screen window, or a parallel view.

[0019] In a second aspect, the present application provides an electronic device, comprising a display screen; one or more processors; one or more memories; one or more sensors; multiple applications; and one or more computer programs; wherein the one or more computer programs are stored in the one or more memories, and the one or more computer programs include instructions, which, when called and executed by the one or more processors, enable the electronic device to execute the above-mentioned first aspect and any possible design of the first aspect.

[0020] In a third aspect, the present application also provides an electronic device, which includes modules / units for executing the first aspect or any possible design method of the first aspect; these modules / units can be implemented by hardware, or corresponding software can be implemented by hardware.

[0021] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, and when the instructions are executed on an electronic device, the electronic device executes the method of the first aspect and any possible design of the first aspect.

[0022] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device executes the method of the first aspect of the embodiment of the present application and any possible design of the first aspect.

[0023] For each aspect from the second to the fifth aspect and the technical effects that may be achieved by each aspect, please refer to the above description of the technical effects that can be achieved by various possible solutions in the first aspect, and no further details will be given here. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;

[0025] Figure 2 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0026] Figure 3 A flow chart of a display method provided in an embodiment of the present application;

[0027] Figure 4 A schematic diagram of a user interface provided in an embodiment of the present application;

[0028] Figure 5 A schematic diagram of a user interface provided in an embodiment of the present application;

[0029] Figure 6 A schematic diagram of another user interface provided in an embodiment of the present application;

[0030] Figure 7 A flow chart of a display method provided in an embodiment of the present application;

[0031] Figure 8 A schematic diagram of the structure of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] The technical solutions in the embodiments of the present application will be described in detail below in conjunction with the drawings in the following embodiments of the present application.

[0033] First, concepts related to the embodiments of the present application are explained.

[0034] 1) Screen resolution: refers to the number of pixels in the vertical and horizontal directions, and the unit is px. For screens of the same size, when the screen resolution is low (for example, 640*480), fewer pixels are displayed on the screen, and the size of a single pixel is relatively large. When the screen resolution is high (for example, 1600*1200), more pixels are displayed on the screen, and the size of a single pixel is relatively small. Display resolution is the number of pixels displayed on the screen. A resolution of 160*128 means that there are 160 pixels in the horizontal direction and 128 pixels in the vertical direction. When the screen size is the same, the higher the resolution, the finer and more delicate the display effect.

[0035] 2) Display pixel density (dots per inch, DPI): refers to the number of pixels that can be sampled, displayed, and output per inch. It describes the pixel density of the software when it is displayed. It is a software property and can be configured. DPI is related to image size and image resolution. When the image size is the same, the higher the image resolution, the greater the DPI; when the image resolution is the same, the smaller the image size, the greater the DPI. The higher the DPI value, the clearer the image. In this application, DPI can be calculated by screen size and screen resolution.

[0036] 3) Screen pixel density (pixels per inch, PPI): can be used to indicate the number of physical pixels per inch of the screen. Screen resolution describes the number of pixels on the display itself. It is an inherent hardware physical property of the display and cannot be changed. One way to calculate PPI is: Height and width are the number of pixels corresponding to the height and width of the display screen, respectively. Size represents the diagonal length of the display screen in inches. This means that the calculation method is to calculate the number of pixels on the diagonal line based on the height and width of the display screen using the Pythagorean theorem, and then divide it by the diagonal size of the display screen to get the PPI. The higher the PPI value, the higher the density at which the display screen can display images, the higher the degree of realism, and the closer to the real image.

[0037] 4) Application (APP): referred to as application, which is a software program that can realize one or more specific functions. Usually, multiple applications can be installed in an electronic device. For example, camera application, SMS application, email application, video application, music application, WeLink, etc. The applications mentioned below can be applications installed on the electronic device when it leaves the factory, or they can be applications downloaded from the Internet or obtained from other electronic devices by the user during the use of the electronic device.

[0038] like Figure 1 FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1 As shown, the application scenario may include a mobile phone 10 and a display 20. The mobile phone 10 is a mobile phone that can support screen projection, and the interface of the mobile phone 10 can be projected onto the display 20 for display.

[0039] In some embodiments, the mobile phone 10 and the display 20 can be interconnected through a communication network. Exemplarily, the communication network can be a local area network, such as a wireless fidelity (Wi-Fi) hotspot network, a wireless fidelity point-to-point (Wi-Fi P2P) network, a Bluetooth network, a zigbee network, or a near field communication (NFC) network. As a possible implementation, the multiple electronic devices can also be connected based on a mobile network. For example, the mobile network includes a mobile network based on 2G, 3G, 4G, 5G and subsequent standard protocols. As a possible implementation, the multiple electronic devices can also establish a connection with at least one server through a mobile network, and each device transmits data, and / or, messages, and / or, information, and / or, signaling, and / or, instructions through the server.

[0040] In other embodiments, the mobile phone 10 and the display 20 may also be connected by wire, such as by a data cable, which is not specifically limited in this application. Based on the above two communication methods, the mobile phone 10 can project the mobile phone interface onto the display 20 by wireless projection or wired projection.

[0041] It should be noted that Figure 1 This is just an illustrative explanation. The mobile phone 10 can also project the screen onto other large-screen devices, such as a smart screen, etc. This application does not limit this.

[0042] It should be noted that the window scaling method provided in the embodiment of the present application can be applied to any electronic device with a display screen, such as mobile phones, tablet computers, wearable devices (e.g., watches, bracelets, smart helmets, smart glasses, etc.), vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), etc., and the embodiment of the present application is not limited thereto. In addition, exemplary embodiments of electronic devices include but are not limited to devices equipped with Or other electronic devices with operating systems.

[0043] Below Figure 1 Taking the mobile phone in the shown scene as an example, the structure of the electronic device is introduced.

[0044] like Figure 2As shown, the mobile phone 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0045] 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 memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural-network processing unit (neural-network processing unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors. Among them, the controller can be the nerve center and command center of the mobile phone 100. The controller can generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions. The processor 110 can also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a high-speed cache memory. The memory can save instructions or data that the processor 110 has just used or circulated. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated access is avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.

[0046] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the mobile phone 100, and can also be used to transmit data between the mobile phone 100 and peripheral devices. The charging management module 140 is used to receive charging input from the charger. The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160.

[0047] The wireless communication function of the mobile phone 100 can be realized by antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the mobile phone 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antenna. For example, antenna 1 can be reused as a diversity antenna of a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0048] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the mobile phone 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0049] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the mobile phone 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of the signal, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2. Exemplarily, in an embodiment of the present application, different electronic devices can establish a communication connection through BT or WLAN.

[0050] In some embodiments, the antenna 1 of the mobile phone 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the mobile phone 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), the fifth generation (5G) mobile communication system, future communication systems such as the sixth generation (6G) system, BT, GNSS, WLAN, NFC, FM and / or IR technology, etc. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0051] The display screen 194 is used to display the display interface of the application, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light emitting diode (QLED), etc. In some embodiments, the mobile phone 100 may include 1 or N display screens 194, where N is a positive integer greater than 1. In an embodiment of the present application, the display screen 194 can be used to display the application interface.

[0052] The camera 193 is used to capture still images or videos. The camera 193 may include a front camera and a rear camera.

[0053] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the mobile phone 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, and software code of at least one application (such as iQiyi application, WeChat application, etc.). The data storage area can store data (such as images, videos, etc.) generated during the use of the mobile phone 100. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0054] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as pictures and videos are stored in the external memory card.

[0055] The mobile phone 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor.

[0056] The button 190 includes a power button, a volume button, etc. The button 190 can be a mechanical button. It can also be a touch button. The mobile phone 100 can receive the button input and generate a key signal input related to the user settings and function control of the mobile phone 100. The motor 191 can generate a vibration prompt. The motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. The indicator 192 can be an indicator light, which can be used to indicate the charging status, power changes, and can also be used to indicate messages, missed calls, notifications, etc. The SIM card interface 195 is used to connect the SIM card. The SIM card can be inserted into the SIM card interface 195, or pulled out from the SIM card interface 195 to achieve contact and separation with the mobile phone 100.

[0057] Understandably, Figure 2 The components shown do not constitute a specific limitation on the mobile phone. The mobile phone may also include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. Figure 2 The mobile phone 100 shown is taken as an example for introduction.

[0058] The following embodiments are applied in Figure 2 The architecture shown in the mobile phone 100 is used as an example for description.

[0059] In addition, at least one of the following embodiments includes one or more, wherein more means greater than or equal to two. In addition, it should be understood that in the description of this application, the words "first", "second" and the like are only used for the purpose of distinguishing the description.

[0060] Below Figure 1 Taking the mobile phone and the display in the illustrated scene as an example, the method of the embodiment of the present application is introduced. Figure 3 As shown, it is a flow chart of a display method provided by an embodiment of the present application, see Figure 3 As shown, the method may include the following steps:

[0061] S301: The mobile phone establishes a connection with the display.

[0062] Among them, a connection relationship can be established between the mobile phone and the display through Bluetooth, Wi-Fi, wired connection, etc. to realize the screen projection function. The screen projection function refers to mirroring the content displayed on the first device to the second device, so that the content displayed on the first device and the second device is the same, such as mirroring the content displayed on the mobile phone to the display, so that the interface displayed on the mobile phone and the interface displayed on the display are the same interface. Moreover, in the embodiment of the present application, the mobile phone and the display can be a heterogeneous screen projection scene or a homogeneous screen projection scene, and the present application does not limit this. It can be understood that the display referred to in the present application can be a display screen (such as a computer display, a large screen, a projection screen, etc.), or it can be an electronic device with display capabilities such as a mobile phone, a laptop computer, an ARVR device, etc.

[0063] It should be understood that in the same-source screen projection scenario, the content displayed on the local display of the mobile phone can be projected to the monitor; in the different-source screen projection scenario, a virtual display (virtual display) can be created on the mobile phone, and then when the application interface is opened, the application interface window of the application is displayed on the virtual display, and finally the graphic data of the application is drawn, rendered, and synthesized, and mixed and output in sequence to obtain 2D graphics, and then the video code stream corresponding to the 2D graphics is transmitted to the monitor for display.

[0064] In some embodiments, the mobile phone and the display can be wirelessly projected. The mobile phone can respond to the user's operation to establish a connection between the mobile phone and the display. For example, the user can slide down from the top of the mobile phone display to open the status bar, for example Figure 4 Then the user can Figure 4 Click the "Wireless Screen Mirroring" icon in the status bar shown in (a) of FIG. 1 , and the mobile phone can respond to the user's click operation and display a list of devices that can be cast, such as Figure 4 As shown in (b) in the figure. Users can Figure 4 Select a screen projection device from the list of screen projection devices shown in (b), such as a HUASHAN display, and then the mobile phone can establish a connection with the HUASHAN display. It should be noted that the mobile phone and the display can be in the same local area network or not when establishing a connection, and this application does not limit this.

[0065] In other embodiments, the screen can be projected between the mobile phone and the display through a wired connection. Exemplarily, the screen can be projected between the mobile phone and the display through a Type-C adapter cable. Among them, one end of the Type-C adapter cable is Type-C, and the other end is HDMI, DP or MiniDP. For example, when the mobile phone is projected to the display, the mobile phone end is connected to the Type-C port, the display end is connected to the HDMI port, and then the input signal source on the display end is switched to the HDMI inlet corresponding to the conversion cable, so that the content displayed on the mobile phone can be projected to the display. It should be noted that the port types of different devices may be different. In the embodiment of the present application, the adapter cable can be selected according to the port type of the device.

[0066] For the convenience of description, the DPI of the mobile phone can be recorded as the "first DPI", the DPI of the created virtual display can be recorded as the "second DPI", and the DPI of the display can be recorded as the "third DPI". The DPI of the mobile phone can be understood as the factory preset DPI or the pre-set DPI.

[0067] In order to avoid compatibility issues such as re-refreshing the application interface due to the different DPIs of the first device and the second device, in some embodiments, when the mobile phone and the display are co-projected, the mobile phone can set the DPI of the mobile phone and the DPI of the display to be the same. That is, the mobile phone can set the first DPI and the third DPI to the same DPI. Specifically, the mobile phone can change the third DPI according to the first DPI (that is, change the third DPI to the first DPI), or can change the first DPI according to the third DPI (that is, change the first DPI to the third DPI).

[0068] In other embodiments, when the mobile phone and the display are projected from different sources, the mobile phone can set the DPI of the local device and the DPI of the display to be the same, or obtain the DPI of the display, and set the DPI of the virtual display to the DPI of the display when creating a virtual display. That is, the mobile phone can set the first DPI and the third DPI to the same DPI, and the mobile phone can also set the second DPI and the third DPI to the same DPI. Specifically, the mobile phone can change the third DPI according to the first DPI, or change the first DPI according to the third DPI, or the mobile phone can also change the third DPI according to the second DPI, or change the second DPI according to the third DPI.

[0069] In some embodiments, during the process of establishing a connection between the mobile phone and the display, or before the mobile phone and the display establish a screen projection relationship, the DPI of the local device and the DPI of the display can be set to the same, or the DPI of the virtual display can be set to the DPI of the display.

[0070] It should be noted that when a mobile phone is connected to a display, taking the heterogeneous screen projection scenario as an example, a virtual display (virtual display) can be created on the mobile phone, and then the content displayed on the virtual display can be projected onto the display. Among them, the virtual display can be the same size (or aspect ratio) as the display of the display, so as to ensure the integrity of the content displayed on the display.

[0071] S302: In response to a first operation of the user, create a first window.

[0072] The first window is a window where the application interface corresponding to the first operation is located.

[0073] In some embodiments, after the mobile phone is connected to the display, the user can perform a first operation on the display, and the first operation can be an operation for the user to open an application, such as a click operation of the user on the application icon, or a double-click operation of the user on the application using a mouse, etc. Then, the display can respond to the user's first operation and send a first request message to the mobile phone, so that the mobile phone creates a first window according to the first request message. Exemplarily, assuming that the display screen of the display is a touch-supported display screen, the first operation can be a click operation of the user on the memo application icon, and then the display can send a first request message to the mobile phone, so that the mobile phone creates an application window of the memo application.

[0074] The first request message may include: an application identifier of the first application. The first application may be the first application corresponding to the first operation, that is, the first operation may be a user clicking operation on the application icon of the first application. Specifically, after receiving the first request message, the mobile phone may create a window of the first application, that is, the first window, according to the first application identifier included in the first request message.

[0075] In other embodiments, after the mobile phone is connected to the display, the user can perform a first operation on the mobile phone, which can be a user clicking an application icon (e.g., an application icon of a first application), or can also be a user triggering an operation to open an application through voice, and then the mobile phone can respond to the user's first operation and create a first window, which is used to display the first application. The mobile phone then sends the content of the first window (the first application) to the display and displays it on the display. Exemplarily, the user can click on the application icon of a gallery application on the mobile phone, and the mobile phone can respond to the user's clicking operation on the gallery application icon, create an application window corresponding to the gallery application, and display the gallery application window on the display.

[0076] As a possible implementation, the first window can be displayed on the virtual display in the form of a floating window. Among them, the width and height of the first window displayed on the virtual display can be calculated according to a preset scaling ratio (for example, the scaling ratio can be denoted as k, and the value range of k can be: 0 < k < 1) and the width and height of the preset window. The preset window refers to the window created according to the set ratio, that is, the window after the first window is scaled and displayed on the display. Exemplarily, for example, the width and height of the preset window are X1 and Y1 respectively, and the preset scaling ratio is k. Then the width of the first window displayed on the virtual display is X1 / k, and the height of the first window is Y1 / k.

[0077] It should be understood that the mobile phone can create the first window after calculating the width and height of the first window, that is, obtaining the size information of the first window.

[0078] Among them, the height of the preset window can be obtained from the parameter information of the display. For example, it can be determined according to the screen height, status bar height, and DOCK height of the display. In a possible implementation, the width and height of the preset window can be calculated in the following way:

[0079] Height of the preset window = (Screen height - Status bar height - DOCK height) / 2.

[0080] Width of the preset window = Height of the preset window * Proportionality coefficient x. For example, when the proportionality coefficient x is 0.48, the width of the preset window = Height * 0.48. Of course, in this application, the proportionality coefficient x can also be other values, and no specific limitation is made here. It should be understood that DOCK refers to the quick window on the display screen of the electronic device for task display and switching, and the content in the DOCK area generally does not change with the window switching.

[0081] Based on the above introduction, it can be known that when the mobile phone creates the first window, it can obtain the preset scaling ratio. In the embodiments of this application, the preset scaling ratio can be obtained in the following way:

[0082] Method 1: The preset scaling ratio can be the ratio between the DPI of the mobile phone itself and the DPI preset for the display.

[0083] Exemplarily, assuming that the DPI preset for the display is 300 and the DPI of the mobile phone itself is 480, then the preset scaling ratio can be: 300 / 480 = 0.625. It should be understood that for the same model of display, the DPI preset for the display can be the same. If the model of the display remains unchanged and the model of the mobile phone changes, then the corresponding preset scaling ratio may also change.

[0084] Method 2: The preset scaling ratio can be the ratio between the DPI of the mobile phone (i.e., the first DPI) and the factory preset DPI of the display, i.e., scaling ratio k = mobile phone DPI / factory preset DPI of the display. For example, if the mobile phone DPI = 480 and the factory preset DPI of the display = 320, then the scaling ratio can be: 320 / 480 = 0.667.

[0085] For method 2, in some embodiments of the present application, a preset zoom ratio can be pre-stored in the mobile phone. Specifically, the mobile phone can pre-store window zoom ratios for different electronic devices. When the mobile phone creates the first window, it can find the window zoom ratio corresponding to the display connected to the mobile phone in the pre-stored window zoom ratios for different electronic devices. Among them, the pre-stored window zoom ratios for different electronic devices may include the window zoom ratios of the same mobile phone projected to different devices and the window zoom ratios of different mobile phones projected to the same device. For example, the window zoom ratios of different electronic devices pre-stored on the mobile phone can be found in Table 1 below.

[0086] Table 1

[0087]

[0088] In other embodiments, the mobile phone stores the DPI of different electronic devices in advance, and then the mobile phone can calculate the scaling ratio according to its own DPI and the DPI of other electronic devices, and store the scaling ratio calculated for different electronic devices. For example, see Table 2 below.

[0089] Table 2

[0090]

[0091] It should be understood that the source device in Table 1 and Table 2 may be a mobile phone, etc., and the target device may be a large-screen device such as a display. Table 1 and Table 2 are only schematic illustrations, and this application does not make specific limitations on this.

[0092] Furthermore, since the preset scaling ratio is the ratio between the DPI of the mobile phone and the DPI of the display, the mobile phone can obtain its own DPI, and the DPI of the display can be obtained in the following ways:

[0093] Method 1: When the first device and the second device are establishing a screen projection relationship, the DPI can be displayed on the display, and the DPI can be the DPI recommended to the user. Then, the display can send the DPI recommended to the user to the mobile phone.

[0094] For method 1, the scaling ratio can be calculated by the ratio between the DPI recommended to the user and the DPI of the mobile phone. For example, if the DPI displayed on the monitor is 320 and the DPI of the mobile phone is 480, the scaling ratio can be: 320 / 480=0.6.

[0095] Method 2: You can find the resolution and size of the display, then use the resolution and size of the display to calculate the DPI of the display, and finally send the calculated DPI of the display to the mobile phone. Optionally, the resolution of the display can be calculated as 1920*1080, and the size of the display can be calculated as 23 inches.

[0096] Method 3: The display can send its own resolution information and size information to the mobile phone. After the mobile phone receives the resolution and size information of the display, it can calculate the DPI of the display according to the resolution and size of the display.

[0097] Optionally, the resolution of the display in the embodiment of the present application refers to the system display resolution, that is, the resolution adopted by the actual display interface of the electronic device. The system display resolution can be the system display resolution that the electronic device adapts by default according to the size of the detected display, or it can be the system display resolution that the user customizes. Normally, the user can select different system display resolutions in the system setting options. In general, the system display resolution of the electronic device is equal to or less than the screen resolution of the display screen. The screen resolution describes the number of pixels of the display screen itself, which is inherent to the display and cannot be changed. It should be understood that since the screen size, resolution, etc. of the electronic device may be different, the scaling ratio may be different when the device is different. Of course, for the same electronic device, the scaling ratio can be fixed.

[0098] S303: The mobile phone draws and renders the content of the first window to obtain an image of the first window.

[0099] In some embodiments, after obtaining the width and height of the first window, the mobile phone may create the first window, and then the mobile phone may draw and render the content of the first window to obtain an interface corresponding to the first operation, that is, obtain an image of the first window.

[0100] S304: The mobile phone scales the image in the first window according to a preset scaling ratio to obtain a first image.

[0101] For the convenience of description, in the embodiment of the present application, the image after the image of the first window is scaled may be referred to as a “first image”.

[0102] There may be two situations based on the preset scaling ratio in S303. Therefore, scaling the image of the first window in this step may also include two situations:

[0103] Case 1: The image of the first window is scaled according to the ratio of the DPI of the mobile phone to the preset DPI of the display to obtain the image of the second window.

[0104] Case 2: The image of the first window is scaled according to the ratio of the DPI of the mobile phone to the DPI preset by the display at the factory to obtain the image of the second window.

[0105] S305: The mobile phone sends the second image to the display for display.

[0106] In some embodiments, after scaling the image in the first window, the mobile phone can obtain a second image, and then multiple layers on the display, such as the layer where the scaled image is located and the layer where the background is located, can be synthesized to obtain the second image. The second image can be a frame image, or multiple frames of images obtained after performing the above operations. Then, the mobile phone can encode the second image into a video stream and send it to the display. Correspondingly, after receiving the video stream, the display can decode the video stream to obtain the data displayed on the second image, and finally render the data and display it on the display screen of the display.

[0107] The above process is introduced below with reference to the user interface diagram.

[0108] In some embodiments, that is, the content displayed on the display is the content displayed on the virtual display, then before the mobile phone scales the first window, the size of the application window and the elements in the window displayed on the virtual display are relatively large. Figure 5 As shown in FIG. 1 , a user interface diagram provided by an embodiment of the present application is shown. Assuming that the first operation of the user in S302 is to open the memo application, the first window is the memo application window, and the following may be displayed on the display before zooming: Figure 5 The interface shown in (a) in FIG. Among them, the size of the interface elements displayed on the memo application window is relatively large, such as Figure 5 The font size of the characters shown in (a) is relatively large.

[0109] because Figure 5 The interface elements on the interface shown in (a) are relatively large and do not meet the UX design specifications. In the embodiment of the present application, the application window can be scaled so that the scaled interface display can meet the UX design specifications. Figure 5The application window of the memo shown in (a) is scaled to obtain a scaled application window. Then, the SurfaceFlinger service in the mobile phone can synthesize multiple layers on the display, such as the layer where the background on the display is located and the layer where the application window is located, and then output the synthesized 2D graphics. Finally, the output 2D image is sent to the display for display. For example, the interface displayed on the display after the scaling window can be referred to Figure 5 As shown in (b) in the figure. Figure 5 It can be clearly seen from (a) and (b) that: Figure 5 The font size of the memo application window shown in (b) is Figure 5 The font size on the memo application window shown in (a) is small.

[0110] Furthermore, since the title bar on the window belongs to the application process, it may not meet the UX design specification after scaling. Therefore, in the embodiment of the present application, the title bar may not be scaled, that is, the size of the title bar continues to be displayed according to the size on the first window. In other words, the scaling ratio of the title bar on the first window and the second window is 1.

[0111] It should be noted that the window scaling method in the embodiment of the present application can be applied to windows of different window types, such as the scaling of floating windows, the scaling of windows under parallel horizon types, and the scaling of full-screen display windows under immersive scenes. That is, regardless of the type of window, the window can be scaled as a whole. Among them, parallel horizons refer to the dual-screen display of application content on the screen, showing the home page and content page of the application at the same time. Immersive scenes refer to the full-screen display of application content.

[0112] Exemplarily, it is assumed that the first window is a window with parallel horizons, that is, the first window includes two sub-windows, and the two sub-windows are windows corresponding to different interfaces of the same application. Figure 6 As shown, for example, the first window includes sub-window 1 and sub-window 2. Among them, sub-window 1 is the window where the main interface of the memo is located, and sub-window 2 is the window where the interface of the memo content 1 is located. For windows with parallel horizons, sub-window 1 and sub-window 2 can be scaled at the same time. For example, the size of the first window is 1080dp*2340dp, for example Figure 6 As shown in (a) in Figure 1. Assuming the scaling ratio is 0.7, the size of the second window is 756dp*1638dp, and the scaled second window can be Figure 6 As shown in (b) in .

[0113] Through the solution of the embodiment of the present application, the content in the window displayed on the projection device in the projection scenario can comply with the UX design specifications, and different types of windows can be scaled to solve the window compatibility problem under different window types.

[0114] The above embodiment is introduced by taking the projection of the mobile phone screen to the display as an example. In the embodiment of the present application, if the application interface on the mobile phone is switched to the display for display, the window size of the application can also be scaled, and the DPI of the content displayed in the window of the application can be adjusted. Or when the application interface displayed on the display is switched to the mobile phone for display, the window size of the application can also be scaled, and the DPI of the content displayed in the window of the application can be adjusted. Exemplarily, for example, the application interface of the Huawei video application is displayed in full screen on the mobile phone. When the application interface of the Huawei video application is switched to a large-screen device, such as a smart screen for display, the application interface of the Huawei video application can be displayed on the smart screen in the form of a floating window, and the window where the application interface of the Huawei video application is located can be scaled, and the DPI of the application interface of the Huawei video application can be adjusted at the same time.

[0115] Taking the first electronic device and the second electronic device as examples, the method of the embodiment of the present application is introduced. Based on the above embodiment, the present application also provides a display method, such as Figure 7 As shown, the method may include the following steps:

[0116] Before the following steps are performed, a connection may be established between the first electronic device and the second electronic device.

[0117] S701: The first electronic device obtains the display pixel density DPI of the second electronic device, and sets the DPI of the first electronic device and the DPI of the second electronic device to be the same DPI.

[0118] S702: The first electronic device receives a first trigger event.

[0119] The first trigger event is a trigger operation of the user on the first application icon, for example, it may be a click operation of the user on the application icon.

[0120] S703: The first electronic device creates a first window in response to the first triggering event.

[0121] The first window here refers to an application window corresponding to the first application.

[0122] S704: The first electronic device obtains an image of the first window based on the first window.

[0123] S705: The first electronic device scales the image of the first window to obtain a first image.

[0124] S706: The first electronic device obtains a second image based on the first image, and sends the second image to a second electronic device for display.

[0125] It should be noted that Figure 7 S701 in the illustrated embodiment can be referred to Figure 3 In the embodiment shown, in S301, the DPI of the mobile phone and the display are set to the same DPI. For S702 and S703, see Figure 3 For a detailed description of S302 in the embodiment shown, please refer to S704. Figure 3 For a detailed description of S303 in the embodiment shown, please refer to S705. Figure 3 For a detailed description of S304 in the embodiment shown, please refer to S706. Figure 3 The detailed description of S305 in the embodiment shown. And, Figure 7 The user interface of the illustrated embodiment can be found in Figure 4 , Figure 5 The description in the illustrated embodiment will not be repeated here.

[0126] In the embodiments provided by the present application, the method provided by the embodiments of the present application is introduced from the perspective of the electronic device as the execution subject. In order to implement the functions in the methods provided by the embodiments of the present application, the electronic device may include a hardware structure and / or a software module, and implement the above functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether a function of the above functions is executed in the form of a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.

[0127] like Figure 8 As shown, some other embodiments of the present application disclose an electronic device, which may be an electronic device with an audio function. Figure 8 As shown, the electronic device 800 includes: a display screen 801; one or more processors 802; one or more memories 803; one or more sensors 804 (not shown in the figure), multiple applications 805 (not shown in the figure); and one or more computer programs 806 (not shown in the figure), and the above-mentioned devices can be connected via one or more communication buses 807.

[0128] It should be noted that Figure 8 The electronic device shown can be applicable to the first device in the aforementioned embodiment, and can also be applicable to the second device in the aforementioned embodiment.

[0129] The display screen 801 is used to display the display interface of the application in the electronic device, or to display prompt information. The memory 803 stores one or more computer programs, and the one or more computer programs include instructions; the processor 802 calls the instructions stored in the memory 803, so that the electronic device 800 can use the audio playback method of the above embodiment.

[0130] In the embodiment of the present application, the processor 802 can be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the methods, steps and logic block diagrams disclosed in the embodiment of the present application. The general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware processor to be executed, or the hardware and software modules in the processor can be combined and executed. The software module can be located in the memory 803, and the processor 802 reads the program instructions in the memory 803, and completes the steps of the above method in combination with its hardware.

[0131] In the embodiment of the present application, the memory 803 may be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), etc., or a volatile memory (volatile memory), such as RAM. The memory may also be any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory in the embodiment of the present application may also be a circuit or any other device that can implement a storage function, for storing instructions and / or data.

[0132] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0133] Based on the above embodiments, the present application further provides a computer storage medium, in which a computer program is stored. When the computer program is executed by a computer, the computer executes the method provided in the above embodiments.

[0134] A computer program product is also provided in an embodiment of the present application, including instructions, which, when executed on a computer, enable the computer to execute the method provided in the above embodiment.

[0135] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by instructions. These instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0136] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0137] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

Claims

1. A display method, characterized in that: A first electronic device is connected to a second electronic device, and the method includes: The first electronic device obtains a display pixel density DPI of the second electronic device, and sets the DPI of the first electronic device and the DPI of the second electronic device to be the same DPI; The first electronic device receives a first trigger event, where the first trigger event is a trigger operation of a first application icon by a user; The first electronic device creates a first window in response to the first trigger event, where the first window is an application window corresponding to the first application; The first electronic device acquires an image of the first window based on the first window; The DPI of the first electronic device includes a DPI preset by the first electronic device at the factory, and the image of the first window is displayed on the display of the first electronic device; or, the DPI of the first electronic device includes a DPI of a virtual display created by the first electronic device, and the image of the first window is displayed on the virtual display created by the first electronic device; The first electronic device scales the image of the first window to obtain a first image; The first electronic device obtains a second image based on the first image, and sends the second image to the second electronic device for display.

2. The method according to claim 1, characterized in that The first electronic device sets the DPI of the first electronic device and the DPI of the second electronic device to be the same DPI, including: The first electronic device sets its own factory preset DPI to the same DPI as the DPI of the second electronic device, or the first electronic device sets the DPI of the second electronic device to the same DPI as the first electronic device's factory preset DPI.

3. The method according to claim 1, characterized in that The first electronic device sets the DPI of the first electronic device and the DPI of the second electronic device to be the same DPI, including: The first electronic device sets its factory-preset DPI to be the same as the DPI of the second electronic device; or The first electronic device sets the DPI of the second electronic device to be the same as the DPI preset at the factory of the first electronic device; or The first electronic device sets the DPI of the created virtual display to be the same as the DPI of the second electronic device; or The first electronic device sets the DPI of the second electronic device to be the same as the DPI of the created virtual display.

4. The method according to any one of claims 1 to 3, characterized in that: The first electronic device creates a first window, including: The first electronic device obtains a size and a preset zoom ratio of a preset window, and creates a first window according to the size and the preset zoom ratio of the preset window.

5. The method according to claim 4, characterized in that The first electronic device processes the image of the first window to obtain a first image, including: The first electronic device scales the image of the first window according to the preset scaling ratio to obtain a first image.

6. The method according to claim 4 or 5, characterized in that The preset zoom ratio is the ratio between the DPI preset at the factory of the first electronic device and the DPI preset at the factory of the second electronic device, or the preset zoom ratio is the ratio between the DPI preset at the factory of the first electronic device and the DPI preset at the factory of the second electronic device.

7. The method according to any one of claims 1 to 6, characterized in that: The first electronic device receives a first trigger event, including: The first electronic device receives a first trigger event triggered by a user on the first electronic device; or the first electronic device receives a first trigger event sent by the second electronic device, and the first trigger event is triggered by a user on the second electronic device.

8. The method according to any one of claims 1 to 7, characterized in that: The first electronic device obtains a second image based on the first image, including: The first electronic device synthesizes the layer where the first image is located and the layer where the background is located to obtain a second image.

9. The method according to any one of claims 1 to 8, characterized in that The first electronic device is connected to the second electronic device, including: The first electronic device and the second electronic device are connected via Wi-Fi, Bluetooth, or wired connection.

10. The method according to any one of claims 1 to 9, characterized in that: The window type of the first window is a floating window, a full-screen window, or a parallel view.

11. An electronic device, characterized in that: The electronic device includes a display screen; one or more processors; one or more memories; one or more sensors; multiple applications; and one or more computer programs; The one or more computer programs are stored in the one or more memories, and the one or more computer programs include instructions, which, when called and executed by the one or more processors, enable the electronic device to execute the method as claimed in any one of claims 1 to 10.

12. A computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, characterized in that: When the instructions are executed on an electronic device, the electronic device is caused to execute the method according to any one of claims 1 to 10.

13. A computer program product, characterized in that When the computer program product is executed on an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Display method and electronic device

    CN106055327A

  • Page display method and apparatus

    CN108733336A

  • Application picture display method and device, terminal, screen projection system and medium

    CN112905289A

  • Controlling display setting according to external device connected to user equipment

    US20120274656A1