Display method and electronic equipment

By setting the DPI of electronic devices to be consistent and scaling the window image, the compatibility issue of excessively large fonts and images during screen projection was resolved, thus improving the user experience.

CN120892001APending Publication Date: 2025-11-04HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510764815.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2021-07-31
Publication Date
2025-11-04

AI Technical Summary

Technical Problem

Due to the different pixel densities of mobile phones and monitors, compatibility issues such as application interface refresh or restart may occur during screen mirroring. In addition, the fonts and images are too large when displayed on a large screen, resulting in a 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 that of the second electronic device, window image scaling is performed to ensure that the fonts and images displayed on the second electronic device are of appropriate size.

Benefits of technology

It solves the problem of excessively large fonts and images on screen mirroring devices, thus improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120892001A_ABST
    Figure CN120892001A_ABST
Patent Text Reader

Abstract

The invention provides a display method and electronic equipment. In the method, a first electronic device is connected with a second electronic device, the first electronic device obtains the display pixel density DPI of the second electronic device, and the DPI of the first electronic device and the DPI of the second electronic device are set to be the same DPI; the first electronic equipment receives a first trigger event, wherein the first trigger event is a trigger operation of a user on the first application icon; the first electronic equipment responds to the trigger event and creates a first window; the first electronic equipment acquires an image of the first window based on the first window; the first electronic equipment scales the image of the first window to obtain a first image; and the first electronic equipment obtains a second image based on the first image, and sends the second image to the second electronic equipment for display. By means of the method, the problem that display of window pictures, fonts and the like on the screen projection equipment is large can be solved, and the user experience can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application. The original application has the application number 202110877514 and the original application date is July 31, 2021. The entire contents of the original application are incorporated herein by reference. Technical Field

[0002] This application relates to the field of terminal technology, and in particular to a display method and electronic device. Background Technology

[0003] Currently, to meet users' needs in different scenarios, screen mirroring technology has been increasingly widely used, such as mirroring a mobile phone screen to a monitor and then displaying the mobile phone interface on the monitor. However, because mobile phones and monitors have different pixel densities (dots per inch, DPI), and mobile phones generally have a higher DPI than monitors, compatibility issues such as application interface refresh or application restarts may occur after mirroring the mobile phone screen to a monitor.

[0004] To avoid the above situation, it is necessary to ensure that the DPI of the mobile phone and the DPI of the display on the monitor are consistent. However, since the screen resolutions of mobile phones and monitors are different, when the screen resolution of the mobile phone is relatively large, if the mobile phone screen is projected onto the monitor, the resources on the mobile phone window displayed on the monitor, such as fonts and images, will be larger, resulting in a poor user experience. Summary of the Invention

[0005] This application provides a display method and electronic device to solve the problem of large fonts and images being displayed on the window of a screen projection device, thereby improving the user experience.

[0006] In a first aspect, this application provides a display method, comprising: firstly, connecting a first electronic device to a second electronic device; then, the first electronic device acquiring the DPI of the second electronic device and setting its own DPI to be the same 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; next, the first electronic device acquires 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.

[0007] In the above technical solution, the first electronic device obtains the DPI of the second electronic device and sets its own DPI to the same as that of the second electronic device. Then, it scales the image of the first window to reduce the size of the window image. This solves the problem of large fonts and images displayed on the second electronic device and improves the user experience.

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

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

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

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

[0012] In one possible design, the first electronic device creates a first window by: the first electronic device acquiring a preset window size and a preset scaling ratio, and creating the first window according to the preset window size and the preset scaling ratio.

[0013] In one possible design, the first electronic device scales 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.

[0014] In one possible design, the preset scaling ratio is the ratio between the factory-preset DPI of the first electronic device and the factory-preset DPI of the second electronic device, or the preset scaling ratio is the ratio between the factory-preset DPI of the first electronic device and the factory-preset DPI of the second electronic device.

[0015] In one possible design, the first electronic device receiving a first trigger event includes: the first electronic device receiving a first trigger event triggered by a user on the first electronic device; or the first electronic device receiving a first trigger event sent by a second electronic device, wherein the first trigger event is triggered by a user on the second electronic device.

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

[0017] In one possible design, the first electronic device obtains a second image based on the first image, including: the first electronic device composites the layer containing the first image and the layer containing the background to obtain the second image.

[0018] In one possible design, 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 a wired connection.

[0019] In one possible design, the first window can be a floating window, a full-screen window, or a parallel view.

[0020] In a second aspect, this application provides an electronic device, the electronic device including 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, the one or more computer programs including instructions that, when invoked and executed by the one or more processors, cause the electronic device to perform the methods described in the first aspect and any possible design of the first aspect.

[0021] Thirdly, this application also provides an electronic device comprising modules / units for performing the first aspect or any possible design method of the first aspect; these modules / units may be implemented in hardware or by executing corresponding software in hardware.

[0022] Fourthly, this application also provides a computer-readable storage medium storing instructions that, when executed on an electronic device, cause the electronic device to perform the first aspect and any possible design of the first aspect.

[0023] Fifthly, an embodiment of this application provides a computer program product that, when run on an electronic device, causes the electronic device to execute the method of the first aspect of this application and any possible design of the first aspect.

[0024] For the various aspects of the second to fifth aspects mentioned above, and the technical effects that each aspect may achieve, please refer to the above description of the technical effects that the various possible solutions for the first aspect may achieve, which will not be repeated here. Attached Figure Description

[0025] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of this application;

[0026] Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0027] Figure 3 A flowchart of a display method provided in an embodiment of this application;

[0028] Figure 4 A user interface diagram provided for an embodiment of this application;

[0029] Figure 5 A user interface diagram provided for an embodiment of this application;

[0030] Figure 6 Another user interface diagram provided for embodiments of this application;

[0031] Figure 7 A flowchart of a display method provided in an embodiment of this application;

[0032] Figure 8 This is a schematic diagram of the structure of another electronic device provided in an embodiment of this application. Detailed Implementation

[0033] The technical solutions in the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0034] First, the concepts related to the embodiments of this application will be explained.

[0035] 1) Screen resolution: This refers to the number of pixels in the horizontal and vertical directions, measured in pixels (px). For screens of the same size, a lower screen resolution (e.g., 640*480) means fewer pixels are displayed on the screen, and each pixel is relatively large. A higher screen resolution (e.g., 1600*1200) means more pixels are displayed on the screen, and each pixel is relatively small. Display resolution is simply the number of pixels displayed on the screen. A resolution of 160*128 means there are 160 pixels horizontally and 128 pixels vertically. With the same screen size, a higher resolution results in a more refined and detailed display.

[0036] 2) Display pixel density (dots per inch, DPI): This refers to the number of pixels that can be sampled, displayed, and output per inch. It describes the pixel density during software display and is a software attribute that can be configured. DPI is related to image size and image resolution. With the same image size, a higher image resolution results in a higher DPI; conversely, with the same image resolution, a smaller image size results in a higher DPI. A higher DPI value results in a clearer image. In this application, DPI can be calculated using screen size and screen resolution.

[0037] 3) Screen pixel density (pixels per inch, PPI): This can be used to represent the number of physical pixels per inch of a screen. Screen resolution describes the number of pixels on the display itself, which is an inherent hardware physical characteristic of the monitor and cannot be changed. One method for calculating PPI is: Height and width represent 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 calculation method involves using the Pythagorean theorem to calculate the number of pixels along the diagonal based on the pixel count of the display screen's height and width, then dividing by the diagonal size of the display screen to obtain the PPI (pixels per inch). A higher PPI value indicates that the display screen can display images at a higher density, resulting in higher fidelity and a more realistic image.

[0038] 4) Application (APP): A software program that performs one or more specific functions. Typically, multiple applications can be installed on an electronic device. Examples include camera apps, SMS apps, email apps, video apps, music apps, and WeLink. The applications mentioned below can be those pre-installed on the electronic device or those downloaded by the user from the internet or other electronic devices during use.

[0039] like Figure 1 The diagram shown is an application scenario illustration provided by an embodiment of this application. (See attached image.) Figure 1As shown, this application scenario may include a mobile phone 10 and a display 20. The mobile phone 10 is a mobile phone that supports screen mirroring, and the interface of the mobile phone 10 can be mirrored to the display 20 for display.

[0040] In some embodiments, the mobile phone 10 and the display 20 can be interconnected via a communication network. For example, this communication network can be a local area network (LAN), such as a Wi-Fi hotspot network, a Wi-Fi P2P network, a Bluetooth network, a Zigbee network, or a near-field communication (NFC) network. As another possible implementation, the multiple electronic devices can also establish a wireless connection based on a mobile network, such as mobile networks based on 2G, 3G, 4G, 5G, and subsequent standard protocols. As yet another possible implementation, the multiple electronic devices can also establish a connection with at least one server via the mobile network, and the devices can transmit data, and / or messages, and / or information, and / or signaling, and / or instructions through the server.

[0041] In other embodiments, the mobile phone 10 and the display 20 can also be connected via a wired connection, such as a data cable; this application does not specifically limit this connection. Based on the above two communication methods, the mobile phone 10 can project its interface onto the display 20 via wireless or wired screen mirroring.

[0042] It should be noted that, Figure 1 This is merely an illustrative example; the phone 10 can also be projected onto other large-screen devices, such as smart screens, and this application does not limit this.

[0043] It should be noted that the window scaling method provided in this application embodiment can be applied to any electronic device with a display screen, such as mobile phones, tablets, wearable devices (e.g., watches, bracelets, smart helmets, smart glasses, etc.), in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), etc., and this application embodiment is not limited to these. Furthermore, exemplary embodiments of the electronic device include, but are not limited to, devices equipped with... HarmonyOS Or electronic devices with other operating systems.

[0044] The following is based on Figure 1 Using a mobile phone as an example in the scenario shown, we will introduce the structure of electronic devices.

[0045] like Figure 2 As 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, a headphone jack 170D, a sensor module 180, buttons 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, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity 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.

[0046] Processor 110 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors. The controller may serve as the central nervous system and command center of the mobile phone 100. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution. Processor 110 may also include memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has recently used or is reusing. If the processor 110 needs to reuse the instruction or data, it can directly retrieve it from the memory. This avoids repeated access, reduces the processor 110's waiting time, and thus improves system efficiency.

[0047] USB interface 130 is a USB standard compliant interface, specifically a Mini USB interface, Micro USB interface, USB Type-C interface, etc. USB interface 130 can be used to connect a charger to charge mobile phone 100, and can also be used for data transfer between mobile phone 100 and peripheral devices. Charging management module 140 receives charging input from the charger. Power management module 141 connects to battery 142, charging management module 140, and processor 110. Power management module 141 receives input from battery 142 and / or charging management module 140, providing power to processor 110, internal memory 121, external memory, display 194, camera 193, and wireless communication module 160, etc.

[0048] The wireless communication function of mobile phone 100 can be implemented through 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 mobile phone 100 can be used to cover one or more communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.

[0049] The mobile communication module 150 can provide solutions for wireless communication applications including 2G / 3G / 4G / 5G on the mobile phone 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low-noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.

[0050] The wireless communication module 160 can provide solutions for wireless communication applications on the mobile phone 100, 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), and infrared (IR) technologies. 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 antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2. Exemplarily, in this embodiment, different electronic devices can establish communication connections via BT or WLAN.

[0051] In some embodiments, antenna 1 of mobile phone 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling mobile phone 100 to communicate with networks and other devices via 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 technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).

[0052] The display screen 194 is used to display the application's interface, 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 (AMOLED), a flexible light-emitting diode (FLED), a Miniled LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the mobile phone 100 may include one or N display screens 194, where N is a positive integer greater than 1. In this embodiment, the display screen 194 can be used to display the application interface.

[0053] Camera 193 is used to capture still images or videos. Camera 193 may include a front-facing camera and a rear-facing camera.

[0054] The internal memory 121 can be used to store computer executable program code, which includes 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. The program storage area may store the operating system and software code for at least one application (e.g., iQiyi application, WeChat application, etc.). The data storage area may store data generated during the use of the mobile phone 100 (e.g., images, videos, etc.). Furthermore, the internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0055] The external storage interface 120 can be used to connect an external storage card, such as a Micro SD card, to expand the storage capacity of the mobile phone 100. The external storage card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, images, videos, and other files can be saved on the external storage card.

[0056] The mobile phone 100 can achieve audio functions such as music playback and recording through the audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.

[0057] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch buttons. The mobile phone 100 can receive button input and generate key signal inputs related to user settings and function control. Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. For example, different vibration feedback effects can correspond to touch operations applied to different applications (such as taking photos, playing audio, etc.). Indicator 192 can be an indicator light, used to indicate charging status, battery level changes, messages, missed calls, notifications, etc. SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact and separation with the mobile phone 100.

[0058] Understandable Figure 2 The components shown do not constitute a specific limitation on the mobile phone. A mobile phone may include more or fewer components than shown, or combine some components, or separate some components, or have different component arrangements. In the following embodiments, [the following text is incomplete and likely refers to a different embodiment]. Figure 2 The following is an introduction using the mobile phone 100 shown as an example.

[0059] The following examples are applied to Figure 2 The architecture shown in the mobile phone 100 will be used as an example for description.

[0060] Furthermore, the at least one mentioned in the following embodiments includes one or more; wherein, "more" means two or more. Additionally, it should be understood that in the description of this application, terms such as "first" and "second" are used only for descriptive purposes.

[0061] The following is based on Figure 1 Using a mobile phone and a display in the illustrated scenario as an example, the method of this application embodiment will be described. Figure 3 The diagram shown is a flowchart of a display method provided in an embodiment of this application. (See attached diagram.) Figure 3 As shown, the method may include the following steps:

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

[0063] The mobile phone and the monitor can establish a connection via Bluetooth, Wi-Fi, or wired connection to achieve screen mirroring. Screen mirroring refers to mirroring the content displayed on a first device onto a second device, ensuring that the content displayed on the first and second devices is identical. For example, mirroring the content displayed on a mobile phone onto a monitor results in the same interface displayed on both devices. Furthermore, in this embodiment, the screen mirroring between the mobile phone and the monitor can be either a heterogeneous or homogeneous source scenario; this application does not limit the scope. It is understood that the monitor referred to in this application can be a display screen (such as a computer monitor, large screen, projection screen, etc.) or an electronic device with display capabilities, such as a mobile phone, laptop, or AR / VR device.

[0064] It should be understood that in a same-source projection scenario, the content displayed on the phone's display can be projected onto the monitor. In a different-source projection scenario, a virtual display can be created on the phone. When an application's interface is opened, the application's interface window is displayed on this virtual display. Finally, the application's graphic data is drawn, rendered, and composited, and then mixed and output in sequence to obtain 2D graphics. The corresponding video stream of the 2D graphics is then transmitted to the monitor for display.

[0065] In some embodiments, wireless screen mirroring is possible between the mobile phone and the display. The mobile phone can respond to user input and establish a connection with the display. For example, a user can swipe down from the top of the mobile phone's screen to open the status bar, such as... Figure 4 As shown in (a) above. Then the user can... Figure 4 Clicking the "Wireless Projection" icon in the status bar shown in (a) will cause the phone to respond to the user's click and display a list of available projection devices, such as... Figure 4 As shown in (b) above. Users can... Figure 4 In the list of screen-casting devices shown in (b), select a screen-casting device, such as a HUASHAN monitor, and then the mobile phone can establish a connection with the HUASHAN monitor. It should be noted that the mobile phone and the monitor can be on the same local area network or not when establishing a connection; this application does not limit this.

[0066] In other embodiments, screen mirroring between the mobile phone and the display can be achieved via a wired connection. For example, screen mirroring can be performed between the mobile phone and the display using a Type-C adapter cable. One end of the Type-C adapter cable is Type-C, and the other end is HDMI, DP, or MiniDP. For instance, when mirroring the mobile phone to the display, the mobile phone is connected to the Type-C port, and the display is connected to the HDMI port. Then, the input signal source on the display is switched to the HDMI input corresponding to the adapter cable, thereby projecting the content displayed on the mobile phone onto the display. It should be noted that different devices may have different port types; in this embodiment, the adapter cable can be selected according to the device's port type.

[0067] For ease of description, the DPI of the phone itself will be referred to as "first DPI", the DPI of the created virtual display as "second DPI", and the DPI of the monitor as "third DPI". The DPI of the phone itself can be understood as the factory-set DPI or a pre-configured DPI.

[0068] To avoid compatibility issues such as application interface refreshes caused by differences in DPI between the first and second devices, in some embodiments, when the phone and display are projected from the same source, the phone can set its own DPI and the display's DPI to be the same. That is, the phone can set the first DPI and the third DPI to be the same. Specifically, the phone can change the third DPI based on the first DPI (i.e., change the third DPI to the first DPI), or it can change the first DPI based on the third DPI (i.e., change the first DPI to the third DPI).

[0069] In other embodiments, when the mobile phone and the display are projected from different sources, the mobile phone can set its own DPI and the display's DPI to be the same, or obtain the display's DPI and set the virtual display's DPI to the display's DPI when creating the virtual display. That is, the mobile phone can set the first DPI and the third DPI to be the same, or the mobile phone can set the second DPI and the third DPI to be the same. Specifically, the mobile phone can change the third DPI based on the first DPI, or it can change the first DPI based on the third DPI, or the mobile phone can change the third DPI based on the second DPI, or it can change the second DPI based on the third DPI.

[0070] In some embodiments, the DPI of the mobile phone and the display can be set to be the same during the connection establishment process between the mobile phone and the display, or before the screen mirroring relationship is established between the mobile phone and the display, or the DPI of the virtual display can be set to the DPI of the display.

[0071] It's worth noting that when a mobile phone connects to a monitor, taking a different source projection scenario as an example, a virtual display can be created on the mobile phone, and then the content displayed on the virtual display can be projected onto the monitor. The virtual display can have the same size (or aspect ratio) as the monitor's display to ensure the integrity of the content displayed on the monitor.

[0072] S302: Respond to the user's first action and create the first window.

[0073] The first window is the window containing the application interface corresponding to the first operation.

[0074] In some embodiments, after the mobile phone and the display are connected, the user can perform a first operation on the display. This first operation can be an operation to open an application, such as clicking the application icon or double-clicking the application with a mouse. Then, the display can respond to the user's first operation by sending a first request message to the mobile phone, causing the mobile phone to create a first window based on the first request message. For example, assuming the display screen is a touch-enabled screen, the first operation could be a user clicking the Notes application icon, and then the display could send a first request message to the mobile phone to create an application window for the Notes application.

[0075] The first request message may include an application identifier for a first application. This first application can be the application corresponding to the first operation, meaning the first operation can be a user clicking the application icon of the first application. Specifically, after receiving the first request message, the mobile phone can create a window for the first application, i.e., the first window, based on the first application identifier included in the first request message.

[0076] In other embodiments, after the mobile phone establishes a connection with the display, the user can perform a first operation on the mobile phone. This first operation can be a click on an application icon (e.g., the application icon of a first application), or a voice-activated operation to open an application. The mobile phone then responds to the user's first operation by creating a first window 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. For example, the user can click on the application icon of the gallery application on the mobile phone. The mobile phone responds to the user's click on the gallery application icon by creating an application window corresponding to the gallery application and displaying the gallery application window on the display.

[0077] 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.

[0078] 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.

[0079] 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:

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

[0081] Width of the preset window = Height of the preset window * Proportional coefficient x. For example, when the proportional coefficient x is 0.48, the width of the preset window = Height * 0.48. Of course, in this application, the proportional 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.

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

[0083] 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.

[0084] Exemplarily, assume 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.

[0085] Method 2: The preset scaling ratio can be the ratio between the phone's own DPI (i.e., the first DPI) and the monitor's factory-preset DPI, that is, scaling ratio k = phone's own DPI / monitor's factory-preset DPI. For example, if the phone's own DPI = 480 and the monitor's factory-preset DPI = 320, then the scaling ratio can be: 320 / 480 = 0.667.

[0086] Regarding method 2, in some embodiments of this application, the preset scaling ratio can be pre-stored in the mobile phone. Specifically, the mobile phone can pre-store window scaling ratios for different electronic devices. When the mobile phone creates a first window, it can find the window scaling ratio corresponding to the display connected to the mobile phone in the pre-stored window scaling ratios for different electronic devices. The pre-stored window scaling ratios for different electronic devices can include window scaling ratios for the same mobile phone projected onto different devices and window scaling ratios for different mobile phones projected onto the same device. For example, the pre-stored window scaling ratios for different electronic devices on the mobile phone are shown in Table 1 below.

[0087] Table 1

[0088]

[0089] In other embodiments, the DPI of different electronic devices is pre-stored on the mobile phone. The mobile phone can then calculate a scaling ratio based on 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.

[0090] Table 2

[0091]

[0092] It should be understood that the source devices in Tables 1 and 2 can be mobile phones, etc., and the target devices can be large-screen devices such as monitors. Tables 1 and 2 are merely illustrative and this application does not impose any specific limitations on them.

[0093] Furthermore, since the preset scaling ratio is the ratio between the phone's own DPI and the display's DPI, the phone can obtain its own DPI. Therefore, the display's DPI can be obtained in the following ways:

[0094] Method 1: When the first device and the second device establish a screen mirroring relationship, the display can show the DPI, which can be the recommended DPI for the user. Then, the display can send the recommended DPI to the mobile phone.

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

[0096] Method 2: You can find the monitor's resolution and size, then calculate the monitor's DPI using these parameters, and finally send the calculated DPI to your phone. Optionally, the monitor resolution can be calculated as 1920*1080, and the monitor size as 23 inches.

[0097] Method 3: The monitor can send its resolution and size information to the mobile phone. After receiving the monitor's resolution and size information, the mobile phone can calculate the monitor's DPI based on the monitor's resolution and size.

[0098] Optionally, in this embodiment, the display resolution refers to the system display resolution, that is, the resolution used by the actual display interface of the electronic device. The system display resolution can be a default system display resolution adapted by the electronic device based on the detected display size, or it can be a user-defined system display resolution. Typically, users can select different system display resolutions in the system settings. Generally, the system display resolution of an electronic device is equal to or less than the screen resolution of the display. The screen resolution describes the number of pixels on the display itself, which is inherent to the display and cannot be changed. It should be understood that because the screen size and resolution of electronic devices may differ, the scaling ratio may differ depending on the device. Of course, for the same electronic device, the scaling ratio can be fixed.

[0099] S303: The mobile phone performs drawing and rendering operations on the content of the first window to obtain the image of the first window.

[0100] In some embodiments, after the mobile phone obtains the width and height of the first window, it can create the first window. Then, the mobile phone can perform drawing and rendering operations on the content of the first window to obtain an interface corresponding to the first operation, that is, obtain the image of the first window.

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

[0102] For ease of description, the image scaled up from the first window in this embodiment can be referred to as the "first image".

[0103] Since there are two possible scenarios based on the preset scaling ratio in S303, scaling the image in the first window in this step can also include two scenarios:

[0104] Scenario 1: The image in the first window is scaled according to the ratio of the phone's DPI to the DPI preset on the display to obtain the image in the second window.

[0105] Scenario 2: The image in the first window is scaled according to the ratio of the phone's DPI to the factory-preset DPI of the display to obtain the image in the second window.

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

[0107] In some embodiments, after scaling the image in the first window, the mobile phone can obtain a second image. Then, multiple layers on the display, such as the layer containing the scaled image and the background layer, can be composited to obtain the second image. The second image can be a single frame or multiple frames obtained by performing the above operations. Next, 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 it to obtain the data displayed in the second image, and finally render and display the data on the display screen.

[0108] The above process will be explained below with reference to the user interface diagram.

[0109] In some embodiments, where the content displayed on the monitor is the same as that displayed on the virtual display, the application window and its elements on the virtual display are relatively large before the phone scales the first window. For example, ... Figure 5 The diagram shown is a user interface illustration provided in an embodiment of this application. Assuming the user's first operation in S302 is to open the Notes application, the first window is the Notes application window. Therefore, before scaling, the display may show, as shown below. Figure 5 The interface shown in (a) is as follows. The interface elements displayed on the Memos application window are relatively large, for example... Figure 5 The font of the character shown in (a) is larger.

[0110] because Figure 5 The interface elements shown in (a) are too large, which does not conform to UX design guidelines. In this embodiment, the application window can be scaled so that the scaled interface display meets UX design guidelines. For example, the interface elements can be scaled. Figure 5The application window of the memo shown in (a) is scaled to obtain a scaled application window. Then, the SurfaceFlinger service on the phone can composite multiple layers on the display, such as the layer containing the background and the layer containing the application window, and output the composite 2D graphic. Finally, the output 2D image is sent to the display for display. For an example, the interface of the scaled window displayed on the display can be seen in [reference needed]. Figure 5 As shown in (b) in the diagram. From Figure 5 It is clear from (a) and (b) in the text that: Figure 5 The font size on the application window of the memo shown in (b) is larger than... Figure 5 The font size is small on the application window of the memo shown in (a).

[0111] Furthermore, since the title bar on the window belongs to the application process, scaling it may not meet UX design specifications. Therefore, in this embodiment, 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 bars on the first and second windows is 1.

[0112] It should be noted that the window scaling method in this application embodiment is applicable to windows of different types, such as scaling floating windows, scaling windows in parallel view scenarios, and scaling full-screen windows in immersive scenes. That is, regardless of the window type, the entire window can be scaled. Parallel view refers to the application content being displayed on two screens simultaneously, showing both the application's homepage and content pages. Immersive scene refers to the application content being displayed in full screen.

[0113] For example, suppose the first window is a window with a parallel view, meaning the first window includes two child windows, which are windows corresponding to different interfaces of the same application. Figure 6 As shown, for example, the first window includes child window 1 and child window 2. Child window 1 is the main interface of the memo, and child window 2 is the interface containing the content of memo 1. For windows with parallel viewports, child window 1 and child window 2 can be scaled simultaneously. For example, the size of the first window is 1080dp * 2340dp. Figure 6 As shown in (a) above. Assuming a scaling factor of 0.7, the size of the second window is 756dp * 1638dp. The scaled second window can be... Figure 6 As shown in (b) of the diagram.

[0114] The solution provided in this application embodiment enables the content displayed in the window on the screen projection device to conform to UX design specifications in screen projection scenarios, and allows scaling for different types of windows, thus solving the window compatibility problem of applications under different window types.

[0115] The above embodiments use screen mirroring from a mobile phone to a monitor as an example. In this embodiment, when switching the application interface from the mobile phone to the monitor, the application window size can be scaled, and the DPI of the content displayed within the application window can be adjusted. Similarly, when switching the application interface from the monitor to the mobile phone, the application window size can be scaled, and the DPI of the content displayed within the application window can be adjusted. For example, if the Huawei Video application interface is displayed full-screen on a mobile phone, when switching it to a large-screen device, such as a smart screen, the Huawei Video application interface can be displayed as a floating window on the smart screen, and the window containing the Huawei Video application interface can be scaled, while the DPI of the Huawei Video application interface can be adjusted.

[0116] Taking a first electronic device and a second electronic device as examples, the method of the embodiments of this application will be described. Based on the above embodiments, this application also provides a display method, such as... Figure 7 As shown, the method may include the following steps:

[0117] A connection can be established between the first electronic device and the second electronic device before the following steps are performed.

[0118] 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.

[0119] S702: The first electronic device receives the first trigger event.

[0120] The first triggering event is the user's action on the first application icon, such as clicking the application icon.

[0121] S703: The first electronic device responds to the first trigger event and creates the first window.

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

[0123] S704: The first electronic device acquires the image of the first window based on the first window.

[0124] S705: The first electronic device scales the image in the first window to obtain the first image.

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

[0126] It should be noted that, Figure 7 S701 in the illustrated embodiment can be referred to Figure 3 In the illustrated embodiment, the process of setting the DPI of the mobile phone and the display to the same DPI in S301 can be found in S702 and S703. Figure 3 For a detailed description of S302 in the illustrated embodiment, please refer to S704. Figure 3 For a detailed description of S303 in the illustrated embodiment, please refer to S705. Figure 3 For a detailed description of S304 in the illustrated embodiment, please refer to S706. Figure 3 A detailed description of S305 in the illustrated embodiment. Furthermore, Figure 7 The user interface of the illustrated embodiment can be found in [reference]. Figure 4 , Figure 5 The description in the illustrated embodiment is omitted here.

[0127] The methods provided in the embodiments of this application above are described from the perspective of an electronic device as the executing entity. To implement the functions of the methods provided in the embodiments of this application above, the electronic device may include hardware structures and / or software modules, implementing the above functions in the form of hardware structures, software modules, or a combination of hardware structures and software modules. Whether a particular function is executed in the form of hardware structures, software modules, or a combination of hardware structures and software modules depends on the specific application and design constraints of the technical solution.

[0128] like Figure 8 As shown, some other embodiments of this application disclose an electronic device, which may be an electronic device with audio functionality. See also... 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). The above devices can be connected via one or more communication buses 807.

[0129] It should be noted that, Figure 8 The electronic device shown can be applied to the first device in the foregoing embodiments, or it can be applied to the second device in the foregoing embodiments.

[0130] The display screen 801 is used to display the interface of the application in the electronic device or to display prompt information. The memory 803 stores one or more computer programs, each including instructions; the processor 802 invokes the instructions stored in the memory 803, enabling the electronic device 800 to perform the audio playback method described in the above embodiments.

[0131] In this embodiment, the processor 802 may be a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in this embodiment. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in this embodiment can be directly implemented by the hardware processor, or implemented by a combination of hardware and software modules within the processor. The software modules may reside in the memory 803, and the processor 802 reads the program instructions from the memory 803 and, in conjunction with its hardware, completes the steps of the aforementioned methods.

[0132] In this embodiment, the memory 803 can be non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), or it can be volatile memory, such as RAM. The memory can also be any other medium capable of carrying or storing desired program code in the form of instructions or data structures, and accessible by a computer, but is not limited thereto. The memory in this embodiment can also be a circuit or any other device capable of implementing storage functions, used to store instructions and / or data.

[0133] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described apparatus and unit can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0134] Based on the above embodiments, this application also provides a computer storage medium storing a computer program, which, when executed by a computer, causes the computer to perform the method provided in the above embodiments.

[0135] This application also provides a computer program product, including instructions that, when run on a computer, cause the computer to execute the methods provided in the above embodiments.

[0136] This application describes embodiments of methods, apparatus (systems), and computer program products according to embodiments of this application with reference to flowchart illustrations and / or block diagrams. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by instructions. These instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0137] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0138] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

Claims

1. A display method, characterized in that, The method of connecting a first electronic device to a second electronic device includes: The first electronic device acquires the display pixel density (DPI) of the second electronic device and sets the DPI of the first electronic device to be the same as that of the second electronic device; The first electronic device receives a first trigger event, which is a user's trigger operation on the first application icon; The first electronic device responds to the first triggering event and creates a first window, which is the application window corresponding to the first application. The first electronic device acquires the image of the first window based on the first window; The first electronic device scales the image in the first window to obtain the 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 as described in claim 1, characterized in that, The DPI of the first electronic device includes the factory-preset DPI of the first electronic device and the DPI of the virtual display created by the first electronic device.

3. The method as described in claim 2, characterized in that, The first electronic device sets its DPI to the same as that of the second electronic device, including: The first electronic device sets its factory-preset DPI to the same DPI as 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.

4. The method as described in claim 2, characterized in that, The first electronic device sets its DPI to the same as that of the second electronic device, including: The first electronic device sets its factory-preset DPI to the same DPI as the second electronic device; or The first electronic device sets the DPI of the second electronic device to the same DPI as its factory preset; or The first electronic device sets the DPI of the created virtual display to the same DPI as the second electronic device; or The first electronic device sets the DPI of the second electronic device to the same DPI as the created virtual display.

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

6. The method as described in claim 5, characterized in that, The first electronic device scales the image in 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 the first image.

7. The method as described in claim 5 or 6, characterized in that, The preset scaling ratio is the ratio between the factory-preset DPI of the first electronic device and the factory-preset DPI of the second electronic device, or the preset scaling ratio is the ratio between the factory-preset DPI of the first electronic device and the factory-preset DPI of the second electronic device.

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

9. The method as described in claim 2, characterized in that, The image in the first window is displayed on the display of the first electronic device or on a virtual display created by the first electronic device.

10. The method according to any one of claims 1-9, characterized in that, The first electronic device obtains a second image based on the first image, including: The first electronic device combines the layer containing the first image and the layer containing the background to obtain a second image.

11. The method according to any one of claims 1-10, 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.

12. The method according to any one of claims 1-11, characterized in that, The first window has the following window types: floating window, full-screen window, and parallel view.

13. 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 that, when invoked and executed by the one or more processors, cause the electronic device to perform the method as described in any one of claims 1 to 12.

14. A computer-readable storage medium storing instructions, characterized in that, When the instructions are executed on an electronic device, the electronic device causes the electronic device to perform the method as described in any one of claims 1 to 12.

15. A computer program product, characterized in that, When the computer program product is run on an electronic device, it causes the electronic device to perform the method as described in any one of claims 1 to 12.