Screen capture method and electronic equipment

By synthesising and excluding windows without screenshots of electronic devices, the problem of unnecessary windows when scrolling screenshots is solved, accurate screenshots of specific windows are achieved, and user experience is improved.

CN119105683APending Publication Date: 2024-12-10HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411011199.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2022-07-27
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

When electronic devices such as mobile phones perform screenshots when displaying floating windows, multiple floating windows will appear in the generated pictures, resulting in the pictures generated by the scrolling screenshot that do not match the actual displayed windows, and the user experience is poor.

Method used

By synthesising the layer where the target window is located in multiple windows, obtaining the window type or task identifier that does not take screenshots, finding the corresponding layer from the window tree, excluding windows that do not take screenshots, and achieving screenshots of specific windows. Avoid multiple screenshots of the same window when scrolling to take screenshots.

Benefits of technology

Accurate screenshots of specific windows are realized, avoiding repeated screenshots of contents of unnecessary windows when scrolling screenshots, and improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119105683A_ABST
    Figure CN119105683A_ABST
Patent Text Reader

Abstract

The invention discloses a screen capture method and electronic equipment, and relates to the field of image display, and the screen capture method comprises the following steps: displaying a plurality of windows; and in response to the screen capture command, synthesizing a layer where a target window in the plurality of windows is located to obtain a target picture.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application. The application number of the original application is 202210891491.8, and the original application date is July 27, 2022. The entire contents of the original application are incorporated into this application by reference. Technical Field

[0002] The present application relates to the field of image display, and in particular to a screenshot method and electronic device. Background Art

[0003] like Figure 1 As shown, when a mobile phone or other electronic device displays a floating window (or floating ball) F, if a scrolling screenshot is taken, multiple floating windows will appear in the picture generated by the scrolling screenshot, that is, the picture generated by the scrolling screenshot does not match the window actually displayed on the mobile phone, resulting in a poor user experience. Summary of the invention

[0004] The embodiments of the present application provide a screenshot method and an electronic device for taking a screenshot of a specific displayed window.

[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:

[0006] In a first aspect, a screenshot method is provided, comprising: displaying multiple windows; and in response to a screenshot command, synthesizing a layer where a target window in the multiple windows is located to obtain a target image.

[0007] The screenshot method provided in the embodiment of the present application synthesizes the layer where the target window is located in the multiple displayed windows to obtain a picture, thereby realizing the screenshot of the specific displayed window.

[0008] In a possible implementation, synthesizing the layers where the target windows in multiple windows are located to obtain the target image includes: obtaining the type of the window that does not take a screenshot; searching the layer where the window that does not take a screenshot is located from the window tree according to the type, each leaf node in the window tree includes the layer information where a window is located; synthesizing the layers of the multiple windows except the layer where the window that does not take a screenshot is located to obtain the target image. That is, the window that does not take a screenshot is excluded by the type of the window, and then the target image is obtained.

[0009] In a possible implementation, synthesizing the layers where the target windows in multiple windows are located to obtain the target image includes: obtaining the task identifier of the window for taking screenshots; searching the layer where the window for taking screenshots is located from the window tree according to the type, each leaf node in the window tree includes the layer information where a window is located; synthesizing the layers where the window for taking screenshots is located in multiple windows to obtain the target image. That is, the window for taking screenshots is determined by the task identifier corresponding to the window, and then the target image is obtained.

[0010] In a possible implementation, the screenshot command is a scrolling screenshot command; a target window among multiple windows is screenshoted to generate a target image, including: in response to the scrolling screenshot command, synthesizing the layers where the multiple windows are located to obtain a first image; scrolling and updating the content displayed in the target window; synthesizing the layer where the target window is located to obtain a second image; synthesizing the first image and the second image in a screenshot order to obtain the target image. Scrolling screenshots can be achieved by synthesizing multiple images, and it can be achieved that windows other than the target window are only screenshotted once, avoiding the situation where the content of the same window is screenshotted multiple times during scrolling screenshots.

[0011] In a possible implementation manner, the target window is a window other than the floating ball.

[0012] In a second aspect, an electronic device is provided, comprising a processor and a memory, wherein instructions are stored in the memory, and when the processor executes the instructions, the method described in the first aspect and any embodiment thereof is executed.

[0013] According to a third aspect, a computer-readable storage medium is provided, comprising instructions, which, when executed on an electronic device, enable the electronic device to execute the method according to the first aspect and any embodiment thereof.

[0014] In a fourth aspect, a computer program product comprising instructions is provided. When the instructions are executed on the electronic device, the electronic device executes the method as described in the first aspect and any embodiment thereof.

[0015] In a fifth aspect, a chip system is provided, the chip system including a processor for supporting an electronic device to implement the functions involved in the first aspect. In one possible design, the device also includes an interface circuit, which can be used to receive signals from other devices (such as a memory) or send signals to other devices (such as a communication interface). The chip system may include a chip and may also include other discrete devices.

[0016] The technical effects of the second to fifth aspects refer to the technical effects of the first aspect and any of its embodiments, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 A schematic diagram of generating a picture by scrolling screenshot provided in an embodiment of the present application;

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

[0019] Figure 3 A schematic diagram of the architecture of a program run by a processor provided in an embodiment of the present application;

[0020] Figure 4 A flowchart of a screenshot method provided in an embodiment of the present application;

[0021] Figure 5 A schematic diagram of a mobile phone display interface provided in an embodiment of the present application;

[0022] Figure 6 A schematic diagram of a scrolling screenshot provided in an embodiment of the present application;

[0023] Figure 7 A schematic diagram of a double-click of a knuckle provided in an embodiment of the present application;

[0024] Figure 8 A schematic diagram of a knuckle sliding gesture provided in an embodiment of the present application;

[0025] Fig. 9 A schematic diagram of a screenshot button of a drop-down menu provided in an embodiment of the present application;

[0026] Fig.10 A schematic diagram of windows arranged along the Z axis (i.e., perpendicular to the display screen) of a display screen provided in an embodiment of the present application;

[0027] Fig.11 A flowchart of another screenshot method provided in an embodiment of the present application;

[0028] Fig.12 A flowchart of another screenshot method provided in an embodiment of the present application;

[0029] Fig.13 A flowchart of another screenshot method provided in an embodiment of the present application;

[0030] Fig.14 A schematic diagram of another scrolling screenshot provided in an embodiment of the present application;

[0031] Fig.15 A schematic diagram of the structure of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] First, some concepts involved in this application are described.

[0033] The terms "first", "second", etc. involved in the embodiments of the present application are only used to distinguish features of the same type and cannot be understood as indicating relative importance, quantity, order, etc.

[0034] The terms "exemplary" or "for example" and the like in the embodiments of the present application are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the terms "exemplary" or "for example" is intended to present the related concepts in a specific way.

[0035] The terms "coupling" and "connection" involved in the embodiments of the present application should be understood in a broad sense. For example, they may refer to a direct physical connection, or an indirect connection achieved through electronic devices, such as a connection achieved through resistors, inductors, capacitors or other electronic devices.

[0036] The embodiment of the present application provides an electronic device, which can be a device with a display function, and the electronic device can be mobile or fixed. The electronic device can be deployed on land (for example, indoors or outdoors, handheld or vehicle-mounted, etc.), can be deployed on the water (for example, ships, etc.), and can also be deployed in the air (for example, airplanes, balloons, and satellites, etc.). The electronic device can be called user equipment (UE), access terminal, terminal unit, subscriber unit, terminal station, mobile station (MS), mobile station, terminal agent or terminal device, etc. For example, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a smart bracelet, a smart watch, a headset, a smart speaker, a virtual reality (VR) device, an augmented reality (AR) device, a terminal in industrial control, a terminal in self-driving, a terminal in remote medical, a terminal in smart grid, a terminal in transportation safety, a terminal in smart city, a terminal in smart home, etc. The embodiments of the present application do not limit the specific type and structure of the electronic device. A possible structure of the electronic device is described below.

[0037] Taking a mobile phone as an example, Figure 21 shows a possible structure of the electronic device 101. The electronic device 101 may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a power management module 240, a battery 241, a wireless charging coil 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, a sensor module 280, a button 290, a motor 291, an indicator 292, a camera 293, a display screen 294, and a subscriber identification module (SIM) card interface 295.

[0038] Among them, the sensor module 280 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.

[0039] It is understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 101. In other embodiments of the present application, the electronic device 101 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0040] The processor 210 may include one or more processing units, for example, the processor 210 may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processing unit (CPU), an application processor (AP), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a baseband processor, and a neural network processor (NPU). Among them, different processing units may be independent devices or integrated into one or more processors. For example, the processor 210 may be an application processor AP. Alternatively, the above-mentioned processor 210 may be integrated in a system on chip (SoC). Alternatively, the above-mentioned processor 210 may be integrated in an integrated circuit (IC) chip. The processor 210 may include an analog front end (AFE) and a micro-controller unit (MCU) in an IC chip.

[0041] The controller may be the nerve center and command center of the electronic device 101. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0042] The processor 210 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory may store instructions or data that the processor 210 has just used or cyclically used. If the processor 210 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.

[0043] In some embodiments, the processor 210 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a USB interface, etc.

[0044] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the electronic device 101. In other embodiments of the present application, the electronic device 101 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0045] The power management module 240 is used to receive charging input from a charger. The charger may be a wireless charger (such as a wireless charging base of the electronic device 101 or other device that can wirelessly charge the electronic device 101), or a wired charger. For example, the power management module 240 may receive charging input from a wired charger through the USB interface 230. The power management module 240 may receive wireless charging input through the wireless charging coil 242 of the electronic device.

[0046] The power management module 240 can charge the battery 241 and also power the electronic device. The power management module 240 receives input from the battery 241 and powers the processor 210, the internal memory 221, the external memory interface 220, the display screen 294, the camera 293, and the wireless communication module 260. The power management module 240 can also be used to monitor parameters such as the battery capacity, the number of battery cycles, and the battery health status (leakage, impedance) of the battery 241. In some other embodiments, the power management module 240 can also be set in the processor 210.

[0047] The wireless communication function of the electronic device 101 can be implemented through the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modem processor, the baseband processor, and the like.

[0048] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 101 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0049] The mobile communication module 250 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 101. The wireless communication module 260 can provide solutions for wireless communications 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 technology (NFC), infrared technology (IR), etc., applied to the electronic device 101. In some embodiments, the antenna 1 of the electronic device 101 is coupled to the mobile communication module 250, and the antenna 2 is coupled to the wireless communication module 260, so that the electronic device 101 can communicate with the network and other devices through wireless communication technology.

[0050] The electronic device 101 implements the display function through a GPU, a display screen 294, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 210 may include one or more GPUs that execute program instructions to generate or change display information.

[0051] The display screen 294 is used to display images, videos, etc. The display screen 294 includes a display panel and a touch screen. In some embodiments, the electronic device 101 may include 1 or N display screens 294, where N is a positive integer greater than 1.

[0052] The electronic device 101 can realize the shooting function through the ISP, the camera 293, the video codec, the GPU, the display screen 294, and the application processor. The ISP is used to process the data fed back by the camera 293. In some embodiments, the ISP can be set in the camera 293. The camera 293 is used to capture a static image or a video. In some embodiments, the electronic device 101 may include 1 or N cameras 293, where N is a positive integer greater than 1.

[0053] The external memory interface 220 can be used to connect an external memory card, such as a micro SanDisk (Micro SD) card, to expand the storage capacity of the electronic device 101. The external memory card communicates with the processor 210 through the external memory interface 220 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0054] The internal memory 221 may be used to store computer executable program codes, which include instructions. The processor 210 executes various functional applications and data processing of the electronic device 101 by running the instructions stored in the internal memory 221. In addition, the internal memory 221 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.

[0055] The memory involved in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0056] The electronic device 101 can implement audio functions such as music playing and recording through the audio module 270, the speaker 270A, the receiver 270B, the microphone 270C, the headphone interface 270D and the application processor.

[0057] The audio module 270 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal. In some embodiments, the audio module 270 can be arranged in the processor 210, or some functional modules of the audio module 270 can be arranged in the processor 210. The speaker 270A, also known as the "speaker", is used to convert the audio electrical signal into a sound signal. The receiver 270B, also known as the "earpiece", is used to convert the audio electrical signal into a sound signal. The microphone 270C, also known as the "microphone", is used to convert the sound signal into an electrical signal. The electronic device 101 can be provided with at least one microphone 270C. The headphone interface 270D is used to connect a wired headset. The headphone interface 270D can be a USB interface 230, or it can be a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0058] The button 290 includes a power button, a volume button, etc. The button 290 may be a mechanical button. It may also be a touch button. The electronic device 101 may receive a button input and generate a key signal input related to the user settings and function control of the electronic device 101. The motor 291 may generate a vibration prompt. The motor 291 may be used for an incoming call vibration prompt or for touch vibration feedback. The indicator 292 may be an indicator light, which may be used to indicate the charging status, power changes, messages, missed calls, notifications, etc. The SIM card interface 295 is used to connect a SIM card. The SIM card may be inserted into or removed from the SIM card interface 295 to achieve contact and separation with the electronic device 101. The electronic device 101 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 295 may support a Nano SIM card, a Micro SIM card, a SIM card, etc. In some embodiments, the electronic device 101 uses an embedded SIM (eSIM) card. The eSIM card can be embedded in the electronic device 101 and cannot be separated from the electronic device 101.

[0059] The program executed by the processor 210 may be based on an operating system, such as Android. Apple (iOS) Windows operating system, etc. Figure 3 As shown, the program running on the processor 210 is based on Android For example, the program run by the processor 210 is layered according to its function, which may include an application layer, a framework layer, a basic layer, an algorithm library hardware abstraction layer, a kernel layer, and a driver layer.

[0060] The base layer includes a hardware abstract layer (HAL) and a driver layer. The driver layer is used to drive the hardware resources of the hardware layer. The driver layer may include a GPU driver and a touch screen driver. The GPU driver is used to drive the display panel in the display screen to display content, and the touch screen driver is used to obtain the user's touch operation on the display screen from the touch screen in the display screen. The hardware abstraction layer is used to abstract the hardware, including a display module, a touch module, etc. Among them, the display module is used to abstract the display panel hardware in the display screen, and the abstracted display panel is used for the display algorithm in the algorithm library to call. The touch module is used to abstract the touch screen in the display screen, and the abstracted touch screen is used for the touch algorithm in the algorithm library to call.

[0061] The framework layer is used to implement basic algorithms based on the functions of the hardware abstraction layer for the application layer to call. For example, the screenshot algorithm provided in the embodiment of the present application is used to execute the screenshot method provided in the embodiment of the present application, and the touch algorithm is used to generate a screenshot command to trigger the screenshot operation of the screenshot application.

[0062] The application layer may include a screenshot application with a screenshot (especially a scrolling screenshot) function. When a screenshot command is detected, a screenshot algorithm is called to implement the screenshot operation and generate a picture.

[0063] As mentioned above, when a mobile phone or other electronic device displays a floating window, if a scrolling screenshot is taken, multiple floating windows will appear in the image generated by the scrolling screenshot, that is, the image generated by the scrolling screenshot does not match the window actually displayed on the mobile phone, resulting in a poor user experience. Therefore, an embodiment of the present application provides a screenshot method, which improves the user experience by taking a screenshot of a specified target window (e.g., other windows excluding the floating window) when multiple windows are displayed.

[0064] like Figure 4 As shown, the screenshot method includes:

[0065] S101. Display multiple windows.

[0066] For example, Figure 5 As shown, the mobile phone displays the "Settings" interface S and the floating window F, and the "Settings" interface S and the floating window F correspond to different windows.

[0067] S102: In response to a screenshot command, synthesize a layer where a target window is located among multiple windows to obtain a target image.

[0068] The screenshots involved in this application can refer to single-page screenshots or scrolling screenshots. Single-page screenshots refer to taking a screenshot of a page of content currently displayed on the display screen. Scrolling screenshots (also called multi-page screenshots) refer to when the display interface of an application has more than one page, the remaining content is displayed by scrolling and taking screenshots, and the complete display interface of the application is spliced. For example, Figure 6 As shown, the "Settings" interface has more than one page. By scrolling up the "Settings" interface, you can get the three display interfaces on the left. After taking screenshots and splicing them together, you can get the complete "Settings" interface on the right.

[0069] like Figure 7-Figure 9 As shown, the screenshot command may include but is not limited to double-clicking the finger joint ( Figure 7 ), knuckle sliding gestures (e.g. Figure 8 ), click the screenshot button in the drop-down menu ( Fig. 9 ) etc. Among them, a double-click of the knuckles can trigger a single-page screenshot command; a sliding gesture of the knuckles can trigger a scrolling screenshot command; a scrolling screenshot button can be displayed in the screenshot button, and clicking the button can trigger the scrolling screenshot command.

[0070] like Fig.10 As shown, on Android In the window management service (window manager service, WMS) of Android, the windows are arranged according to the Z axis of the display screen (that is, perpendicular to the display screen direction). The floating window is located above the "Settings" interface. WMS is Android System service for window management. In the Java file WindowManagerService.java of WMS, the data of multiple windows are organized and stored as multiple leaf nodes of the window tree according to the tree structure. The data of each window can be traversed through the root node of the window tree. The window data includes the type of window (such as floating window, application window), task ID (taskID), coordinates, size, scaling, corresponding surface control (SurfaceControl) object and other information. Among them, each window corresponds to a task ID, and the surface control (SurfaceControl) object corresponding to the window includes the layer where the window is located.

[0071] The present application does not limit the format of the target image, for example, it can be a bitmap, joint photographic experts group (JPEG), etc.

[0072] In the prior art, all displayed layers are synthesized to obtain a picture. The screenshot method provided in the embodiment of the present application is to synthesize the layer where the target window is located among multiple displayed windows to obtain a picture, thereby realizing screenshot of a specific displayed window.

[0073] In a possible implementation, the type of the window that is not to be screenshotted can be obtained first, for example, in this application, the type of the window that is not to be screenshotted can be a floating window. Then, according to the type of the window that is not to be screenshotted, the layer where the window that is not to be screenshotted is located is searched from the window tree, and the target window is the window other than the window that is not to be screenshotted among the displayed multiple windows. The target image can be obtained by synthesizing the layers other than the layer where the window that is not to be screenshotted is located in the multiple windows. Specifically, Fig.11 As shown, including:

[0074] S201. The screenshot application sends the type of the window that is not to be screenshotted to the screenshot interface function of the extended surface control (SurfaceControlEx) class by calling the system user interface (SystemUI) service.

[0075] The System UI service is located in the application layer and is used to provide notifications, status bar information display, screenshot services, etc. The extended surface control (SurfaceControlEx) class is located in the framework layer. Android The screenshot interface function of the native surface control (SurfaceControl) class in the framework layer is not open to the application layer, so the application layer cannot directly call the screenshot interface function of the surface control (SurfaceControl) class. Therefore, the screenshot interface function of the surface control (SurfaceControl) class is extended to obtain the screenshot interface function of the extended surface control (SurfaceControlEx) class, which can be called by applications in the application layer.

[0076] When there are multiple types of windows that are not to be screenshotted, the system user interface (SystemUI) service may send the multiple types of windows that are not to be screenshotted in the form of an array.

[0077] S202. The screenshot interface function of the extended surface control (SurfaceControlEx) class sends the type of the window that is not to be screenshotted to the screenshot interface function of the surface control (SurfaceControl) class.

[0078] S203. The screenshot interface function of the surface control (SurfaceControl) class sends the type of the window that is not to be screenshotted to the screenshot interface function of the WMS service.

[0079] S204. The screenshot interface function of the WMS service searches the window tree for a window of the same type as the window not to be screenshotted, and sends the layer where the window not to be screenshotted is located or the layer where the window to be screenshotted is located to the screenshot interface function of the surface control (SurfaceControl) class.

[0080] The screenshot interface function of the WMS service searches for the type of window stored in each leaf node in the window tree according to the type of window that does not take a screenshot. If they are the same, the surface control (SurfaceControl) object corresponding to the window (or the layer where the window is located) is added to the list array. If they are different, the next leaf node is searched until the entire window tree is traversed, and the list array is sent to the screenshot interface function of the surface control (SurfaceControl) class. At this time, the screenshot interface function of the WMS service is equivalent to sending the layer where the window that does not take a screenshot is located to the screenshot interface function of the surface control (SurfaceControl) class.

[0081] Alternatively, the screenshot interface function of the WMS service searches for the type of window stored in each leaf node in the window tree according to the type of window that is not to be screenshotted. If they are different, the surface control (SurfaceControl) object corresponding to the window (or the layer where the window is located) is added to the list array. If they are the same, the next leaf node is searched until the entire window tree is traversed, and the list array is sent to the screenshot interface function of the surface control (SurfaceControl) class. At this time, the screenshot interface function of the WMS service is equivalent to sending the layer where the window to be screenshotted is located to the screenshot interface function of the surface control (SurfaceControl) class.

[0082] S205. The screenshot interface function of the surface control (SurfaceControl) class sends the layer where the window that does not take screenshots is located or the layer where the window that takes screenshots is located to the surface synthesis (SurfaceFlinger) service.

[0083] The SurfaceFlinger service is used to composite multiple layers to obtain the target image.

[0084] S206. The screenshot interface function of the surface control (SurfaceControl) class synthesizes the layers of the windows where the screenshots are taken from multiple windows to obtain a target image.

[0085] If the layer of the window that does not take screenshots is received, the screenshot interface function of the surface control (SurfaceControl) class synthesizes the layers of multiple windows except the layer of the window that does not take screenshots to obtain the target image. If the layer of the window that takes screenshots is received, the screenshot interface function of the surface control (SurfaceControl) class directly synthesizes the layer of the window that takes screenshots to obtain the target image.

[0086] S207. The screenshot interface function of the surface control (SurfaceControl) class sends the target image to the screenshot application through the screenshot interface function of the surface control (SurfaceControl) class, the screenshot interface function of the extended surface control (SurfaceControlEx) class, and the system user interface (SystemUI) service in sequence.

[0087] In the process of transmitting the target image, since it involves inter-process communication, the target image may not be directly passed to the application layer in sequence. Instead, the target image may be serialized to the cache, and the address of the target image or the handle of the target image may be passed to the screenshot interface function of the extended surface control (SurfaceControlEx) class in sequence through the Android interface definition language (AIDL) interface. The screenshot interface function of the extended surface control (SurfaceControlEx) class then sends the target image to the application layer, thereby improving data transmission efficiency.

[0088] In another possible implementation, the task ID (taskID) of the window for taking screenshots (i.e., the target window) can be obtained first. Then, according to the type of the window for taking screenshots, the layer where the window for taking screenshots is located is searched from the window tree, and the layer where the target window is located is synthesized to obtain the target image. Specifically, Fig.12 As shown, including:

[0089] S301. The screenshot application sends a task ID (taskID) of the window for taking screenshot to the screenshot interface function of the extended surface control (SurfaceControlEx) class by calling the system user interface (SystemUI) service.

[0090] When there are multiple types of windows for taking screenshots, the system user interface (SystemUI) service may send the task IDs (taskIDs) of the multiple windows for taking screenshots in the form of an array.

[0091] S302. The screenshot interface function of the extended surface control (SurfaceControlEx) class sends the task ID (taskID) of the window for taking screenshot to the screenshot interface function of the surface control (SurfaceControl) class.

[0092] S303. The screenshot interface function of the surface control (SurfaceControl) class sends the task ID (taskID) of the window for taking screenshot to the screenshot interface function of the WMS service.

[0093] S304. The screenshot interface function of the WMS service searches the window tree for a window with the same task ID (taskID) as the window for taking screenshot, and sends the layer where the window for not taking screenshot is located or the layer where the window for taking screenshot is located to the screenshot interface function of the surface control (SurfaceControl) class.

[0094] The screenshot interface function of the WMS service searches for the task ID (taskID) of the window stored in each leaf node in the window tree according to the task ID (taskID) of the window taking the screenshot. If they are the same, the surface control (SurfaceControl) object corresponding to the window (or the layer where the window is located) is added to the list array. If they are different, the next leaf node is searched until the entire window tree is traversed, and the list array is sent to the screenshot interface function of the surface control (SurfaceControl) class. At this time, the screenshot interface function of the WMS service is equivalent to sending the layer where the window taking the screenshot is located to the screenshot interface function of the surface control (SurfaceControl) class.

[0095] Alternatively, the screenshot interface function of the WMS service searches for the task ID (taskID) of the window stored in each leaf node in the window tree according to the task ID (taskID) of the window to be screenshotted. If they are different, the surface control (SurfaceControl) object corresponding to the window (or the layer where the window is located) is added to the list array. If they are the same, the next leaf node is searched until the entire window tree is traversed, and the list array is sent to the screenshot interface function of the surface control (SurfaceControl) class. At this time, the screenshot interface function of the WMS service is equivalent to sending the layer where the window that is not to be screenshotted is located to the screenshot interface function of the surface control (SurfaceControl) class.

[0096] S305. The screenshot interface function of the surface control (SurfaceControl) class sends the layer where the window that does not take screenshots is located or the layer where the window that takes screenshots is located to the surface synthesis (SurfaceFlinger) service.

[0097] S306. The screenshot interface function of the surface control (SurfaceControl) class synthesizes the layers of the windows where the screenshots are taken from multiple windows to obtain a target image.

[0098] This step refers to step S206 and will not be described in detail here.

[0099] S307. The screenshot interface function of the surface control (SurfaceControl) class sends the target image to the screenshot application through the screenshot interface function of the surface control (SurfaceControl) class, the screenshot interface function of the extended surface control (SurfaceControlEx) class, and the system user interface (SystemUI) service in sequence.

[0100] This step refers to step S207 and will not be described in detail here.

[0101] For scrolling screenshots, Fig.13 As shown, the screenshot method provided in the embodiment of the present application may include:

[0102] S401. Display multiple windows.

[0103] For example, Fig.14 As shown, the mobile phone displays the "Settings" interface S and the floating window F, and the "Settings" interface S and the floating window F correspond to different windows.

[0104] S402: Receive a scrolling screenshot command.

[0105] For the scrolling screenshot command, please refer to the description of step S102, which will not be repeated here. If it is the first screenshot of the scrolling screenshot, then execute step S403, otherwise execute steps S404-S406.

[0106] S403: synthesize the layers where the above-mentioned multiple windows are located to obtain a first picture.

[0107] For example, Fig.14 As shown, all layers including the "settings" interface S and the floating window F are synthesized to obtain the first picture P1. At this time, the native screenshot interface function (ie, the screenshot interface function of the surface control (SurfaceControl) class) can be called to obtain the first picture.

[0108] S404: Scroll and update the content displayed in the target window among the multiple windows.

[0109] For example, Fig.14 As shown, by scrolling down the "Settings" interface S, the contents in the "Settings" interface S are displayed page by page.

[0110] S405: Synthesize the layer where the target window is located to obtain a second picture.

[0111] For example, Fig.14 As shown, the layer where the "settings" interface S is located is synthesized to obtain the second picture (P2 and P3). It should be noted that when the content of the target window is large, there can be multiple second pictures.

[0112] The rest of the step may refer to steps S102, S201-S207, and S301-S307, which will not be described in detail here.

[0113] S406: Synthesize the first picture and the second picture according to the screenshot sequence to obtain a target picture.

[0114] For example, Fig.14 As shown, the pictures P1-P3 are synthesized in the order of screenshots to obtain the target picture T.

[0115] This implementation achieves a scrolling screenshot that ultimately only includes one floating window, thereby improving user experience.

[0116] like Fig.15 As shown, the embodiment of the present application also provides a chip system. The chip system 60 includes at least one processor 601 and at least one interface circuit 602. The at least one processor 601 and the at least one interface circuit 602 can be interconnected through a line. The processor 601 is used to support the electronic device to implement each step in the above method embodiment, such as Figure 4 , Fig.11 , Fig.12 , Fig.13 In the method shown, at least one interface circuit 602 may be used to receive signals from other devices (eg, memory) or to send signals to other devices (eg, communication interface). The chip system may include a chip and may also include other discrete devices.

[0117] The present application also provides a computer-readable storage medium, which includes instructions. When the instructions are executed on the electronic device, the electronic device executes each step in the method embodiment, such as executing Figure 4 , Fig.11 , Fig.12 , Fig.13 The method shown.

[0118] The present application also provides a computer program product including instructions. When the instructions are executed on the electronic device, the electronic device executes each step in the method embodiment, such as executing Figure 4 , Fig.11 , Fig.12 , Fig.13 The method shown.

[0119] Regarding the technical effects of the chip system, computer-readable storage medium, and computer program product, refer to the technical effects of the previous method embodiments.

[0120] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0121] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

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

[0123] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0124] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one device or distributed on multiple devices. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.

[0125] In addition, each functional module in each embodiment of the present application may be integrated into one device, or each module may exist physically separately, or two or more modules may be integrated into one device.

[0126] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing a computer program instruction on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or may contain one or more servers, data centers and other data storage devices that can be integrated with a medium. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).

[0127] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A screenshot method, characterized in that: include: Display a first interface, wherein the first interface includes a plurality of windows, and the plurality of windows includes a floating ball; In response to the scrolling screenshot command, taking screenshots of multiple windows in the first interface to generate a first picture, and scrollingly updating the content displayed in the target window; After the content displayed in the target window is scrolled and updated, the layer where the target window is located is synthesized to obtain a second picture, wherein the target window is other windows among the multiple windows except the floating ball; The first picture and the second picture are synthesized in a screenshot order to obtain a target picture.

2. The method according to claim 1, characterized in that The synthesizing the layer where the target window is located to obtain a second picture includes: Get the type of window that does not take screenshots; Searching the layer where the window not to be screenshotted is located from the window tree according to the type, wherein each leaf node in the window tree includes information about the layer where a window is located; The layers of the multiple windows except the layer where the window not to be screenshotted is located are synthesized to obtain the target image.

3. The method according to claim 1, characterized in that: The synthesizing the layer where the target window is located to obtain a second picture includes: Get the task ID of the window for taking screenshots; Searching the layer where the window for taking screenshot is located from the window tree according to the task identifier, wherein each leaf node in the window tree includes information about the layer where a window is located; The layer of the window for taking screenshot among the multiple windows is synthesized to obtain the target image.

4. The method according to any one of claims 1 to 3, characterized in that: The target image includes the floating ball.

5. The method according to any one of claims 1 to 3, characterized in that: Before taking screenshots of the plurality of windows in the first interface to generate a first picture and scrolling and updating the content displayed in the target window, the method further includes: It is determined that the first interface is the first screenshot of the scrolling screenshot.

6. The method according to any one of claims 1 to 3, characterized in that: After scrolling and updating the content displayed in the target window, synthesizing the layer where the target window is located to obtain a second picture, and the target window is another window among the multiple windows except the floating ball, the method further includes: Determine whether the scrolling is finished; If the scrolling is not finished, continue to scroll and update the content displayed in the target window, and after scrolling and updating the content displayed in the target window, synthesize the layer where the target window is located to obtain a second picture; If the scrolling is completed, the step of synthesizing the first picture and the second picture in the screenshot sequence to obtain a target picture is performed.

7. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores instructions, and when the processor executes the instructions, the method according to any one of claims 1 to 6 is executed.

8. A computer-readable storage medium, characterized in that: The method comprises instructions, which, when executed on an electronic device, cause the electronic device to execute the method according to any one of claims 1 to 6.