Screen capture method and related device
By generating virtual swipe events with different touch point coordinates in the terminal device and updating the touch point coordinates, the problem of scrolling screenshot failure was solved, a more efficient scrolling screenshot effect was achieved, and the user experience was improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2024-09-13
- Publication Date
- 2026-06-23
AI Technical Summary
Existing terminal devices are prone to screenshot failures when taking scrolling screenshots, which affects the user experience.
By generating virtual swipe events with different touch point coordinates, the system simulates touch swiping in a scrollable area of the application interface. Combining a preset coordinate system with updated touch point coordinates of the virtual swipe events, the system attempts to scroll the content multiple times. If the scrolling fails, the system calls a preset scrolling algorithm or reduces the touch area, thereby improving the success rate of scrolling screenshots.
It improves the success rate of scrolling screenshots on terminal devices, avoids device crashes, and enhances user experience.
Smart Images

Figure CN120469619B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a screenshot method and related equipment. Background Technology
[0002] With the continuous development of terminal device technology, the functions supported by terminal devices are becoming more and more abundant. For example, existing terminal devices usually support the screenshot function, which allows users to capture the content displayed on the terminal device at any time during the use of the terminal device.
[0003] In related technologies, to facilitate users in capturing long screenshots, terminal devices generally also support scrolling screenshot functionality. For scrollable interface elements, screenshot applications installed on the terminal device can be used to capture these elements. Screenshot applications typically achieve scrolling of interface elements by simulating interface swipe events. This method is prone to issues where interface elements fail to scroll automatically, leading to scrolling screenshot failures and impacting the user experience. Summary of the Invention
[0004] In view of the above, it is necessary to provide a screenshot method and related equipment to solve the problem that existing terminal devices are prone to screenshot failure when performing scrolling screenshots.
[0005] In a first aspect, this application provides a screenshot method applied to a terminal device. The screenshot method may include: responding to a first user operation by displaying the application interface of a first application, the application interface including one or more scrollable areas; responding to a second user operation by generating a first virtual swipe event, the first virtual swipe event being used to trigger the first application to scroll and display the content of the first scrollable area in the application interface; if the first virtual swipe event does not trigger the scrolling and display of the content of the first scrollable area, generating a second virtual swipe event to trigger the first application to scroll and display the content of the first scrollable area, the touch point coordinates included in the second virtual swipe event being different from the touch point coordinates included in the first virtual swipe event; during the scrolling and displaying of the content of the first scrollable area, capturing the content displayed on the application interface at multiple points in time to obtain multiple screenshot images; and stitching the multiple screenshot images into a long screenshot image.
[0006] By employing the above technical solution, by injecting virtual swipe events with different touch point coordinates into the application being screenshotted (the first application), the touch swipe can be simulated at different positions in the first scrollable area of the application interface. This can increase the likelihood that the application being screenshotted can successfully scroll and display the content of the first scrollable area of the application interface, thereby increasing the likelihood that the terminal device can successfully perform a scrolling screenshot.
[0007] In one possible implementation, generating a second virtual swipe event to trigger the first application to scroll and display the content of the first scrollable area includes updating the first virtual swipe event to obtain the second virtual swipe event.
[0008] By adopting the above technical solution, by updating the virtual swipe event, another virtual swipe event with different touch point coordinates and corresponding to the first scrollable area can be quickly obtained, so as to accurately try to scroll the content of the first scrollable area in the application interface again.
[0009] In one possible implementation, updating the first virtual swipe event includes updating the touch point coordinates corresponding to each touch event in the first virtual swipe event.
[0010] By adopting the above technical solution, by updating the touch point coordinates corresponding to each touch event in the virtual swipe event, another virtual swipe event can be obtained to simulate touch swipe at different positions in the first scrollable area of the application interface, so as to try to scroll the content of the first scrollable area of the application interface again.
[0011] In one possible implementation, updating the touch point coordinates corresponding to each touch event in the first virtual swipe event includes: determining the Y coordinate in the touch point coordinates based on a preset coordinate system, wherein the Y axis in the preset coordinate system is determined according to the vertical direction of the terminal device's display screen; and updating the Y coordinates corresponding to each touch event in the first virtual swipe event.
[0012] By adopting the above technical solution, by updating the Y coordinate corresponding to each touch event in the virtual swipe event, another virtual swipe event can be obtained to simulate swiping up or down at different positions in the first scrollable area of the application interface, so as to try to scroll the content of the first scrollable area of the application interface again.
[0013] In one possible implementation, updating the first virtual swipe event to obtain the second virtual swipe event includes: updating the distance between the down event in the first virtual swipe event and the center point of the first scrollable area to obtain the second virtual swipe event, wherein the first distance between the down event in the first virtual swipe event and the center point of the first scrollable area is greater than the second distance between the down event in the second virtual swipe event and the center point.
[0014] By adopting the above technical solution, by updating the distance between the DOWN event in the first virtual swipe event and the center point of the first scrollable area, a position closer to the center point of the first scrollable area in the application interface is obtained for touch swiping. For the first scrollable area, the possibility of other non-scrollable content or intersection with non-scrollable areas at the position closer to the center point is relatively lower, thereby increasing the possibility of the screenshot application successfully scrolling and displaying the content of the first scrollable area in the application interface.
[0015] In one possible implementation, the touch point coordinates corresponding to the DOWN event in the first virtual swipe event include a first Y coordinate, the touch point coordinates corresponding to the DOWN event in the second virtual swipe event include a second Y coordinate, the center point of the first scrollable area corresponds to a third Y coordinate, the absolute value of the difference between the first Y coordinate and the third Y coordinate is greater than the absolute value of the difference between the second Y coordinate and the third Y coordinate, and the first Y coordinate to the third Y coordinate are all Y coordinates in a preset coordinate system, in which the Y axis is determined according to the vertical direction of the terminal device's display screen.
[0016] By adopting the above technical solution, by updating the distance of the DOWN event in the first virtual swipe event from the center point of the first scrollable area in the Y-axis direction, a position closer to the center of the first scrollable area in the application interface is obtained for touch swiping. For the first scrollable area, the possibility of other non-scrollable content or intersection with the non-scrollable area in the position closer to the center is relatively lower, thereby increasing the possibility of the screenshot application successfully scrolling and displaying the content of the first scrollable area in the application interface.
[0017] In one possible implementation, updating the first virtual swipe event includes updating the first virtual swipe event when the number of updates to the first virtual swipe event is less than or equal to a first preset value.
[0018] By adopting the above technical solution, the scrollable area of the application interface can be scrolled within a preset number of times, avoiding device crashes due to failed scrolling screenshots.
[0019] In one possible implementation, the screenshot method further includes: if the number of updates of the first virtual swipe event is greater than a first preset value, finding a second scrollable area in the application interface; and generating a third virtual swipe event to trigger the first application to scroll and display the content of the second scrollable area.
[0020] By adopting the above technical solution, if a preset number of scrolling attempts fail in a certain scrollable area of the application interface, the system will attempt to find other scrollable areas of the application interface to perform a scrolling screenshot, thereby increasing the likelihood of the terminal device successfully performing a scrolling screenshot.
[0021] In one possible implementation, the screenshot method further includes: generating a fourth virtual swipe event to trigger the first application to scroll and display the content of the second scrollable area when the third virtual swipe event does not trigger the scrolling display of the content of the second scrollable area, wherein the touch point coordinates contained in the fourth virtual swipe event are different from the touch point coordinates contained in the third virtual swipe event.
[0022] By employing the above technical solution, virtual swipe events with different touch point coordinates are injected into the application being screenshotted, simulating touch swipes at different positions in the second scrollable area of the application interface. This increases the likelihood that the application being screenshotted can successfully scroll and display the content of the second scrollable area of the application interface, thereby increasing the likelihood that the terminal device can successfully perform a scrolling screenshot.
[0023] In one possible implementation, the screenshot method further includes: if the number of updates of the first virtual swipe event is greater than a first preset value and no second scrollable area is found, calling a preset scrolling algorithm to scroll the content of the first scrollable area.
[0024] By employing the above technical solution, when scrolling attempts in the scrollable area of the application interface fail after a preset number of attempts, and no other scrollable areas exist, calling a preset scrolling algorithm to scroll the content of the first scrollable area can increase the likelihood of the captured application successfully displaying the content of the first scrollable area of the application interface, thereby increasing the probability of the terminal device successfully taking a scrolling screenshot. For example, the preset scrolling algorithm can be a native scrolling algorithm built into the terminal device's operating system.
[0025] In one possible implementation, if the number of updates to the first virtual swipe event is greater than a first preset value, and the number of searches for scrollable areas in the application interface is less than or equal to a second preset value, then the second scrollable area in the application interface is searched.
[0026] By adopting the above technical solution, the scrollable area of the application interface can be searched within a preset number of times, avoiding device crashes due to failed scrolling screenshots.
[0027] In one possible implementation, the screenshot method further includes: when the number of updates of the first virtual swipe event is greater than a first preset value and the number of searches for the scrollable area in the application interface is greater than a second preset value, calling a preset scrolling algorithm to scroll the content of the first scrollable area.
[0028] By employing the above technical solution, when scrolling fails a preset number of times in each scrollable area of the application interface, calling a preset scrolling algorithm to scroll the content of the first scrollable area can increase the likelihood of the captured application successfully scrolling and displaying the content of the first scrollable area of the application interface, thereby increasing the probability of the terminal device successfully taking a scrolling screenshot. For example, the preset scrolling algorithm can be a native scrolling algorithm built into the terminal device's operating system.
[0029] In one possible implementation, if the first virtual swipe event does not trigger the scrolling display of the content of the first scrollable area, generating a second virtual swipe event to trigger the first application to scroll the content of the first scrollable area includes: reducing the touch area of the first scrollable area if the first virtual swipe event does not trigger the scrolling display of the content of the first scrollable area; and generating the second virtual swipe event based on the reduced touch area of the first scrollable area.
[0030] By adopting the above technical solution, when scrolling fails a preset number of times in the first scrollable area of the application interface, the touch area of the first scrollable area can be reduced, and the virtual sliding event can be updated based on the reduced touch area of the first scrollable area. This can also simulate touch sliding at different positions in the first scrollable area of the application interface, which can increase the probability that the screenshot application can successfully scroll and display the content of the first scrollable area of the application interface, and increase the probability that the terminal device can successfully perform scrolling screenshot.
[0031] In one possible implementation, reducing the touch area of the first scrollable area includes: reducing the touch area of the first scrollable area inward by a preset ratio along the Y-axis direction, wherein the Y-axis is determined according to the vertical direction of the terminal device's display screen.
[0032] By adopting the above technical solution, by reducing the touch area of the first scrollable area along the Y-axis, a position closer to the center of the first scrollable area in the application interface is obtained for touch swiping. The position closer to the center is less likely to contain unscrollable content or intersect with the unscrollable area, which can increase the probability that the screenshot application can successfully scroll and display the content of the first scrollable area in the application interface.
[0033] Secondly, this application provides a terminal device, which includes a display screen, a memory, and a processor; the display screen and the memory are both coupled to the processor; the memory is used to store program instructions; the processor is used to read the program instructions stored in the memory to implement the screenshot method of the first aspect and its possible implementations described above.
[0034] Thirdly, this application provides a computer-readable storage medium storing computer-readable instructions, which, when executed by a processor, implement the screenshot method described in the first aspect and its possible implementations.
[0035] Fourthly, this application provides a computer program product containing computer-readable instructions that, when executed by a processor, implement the screenshot method described in the first aspect and its possible implementations.
[0036] Furthermore, the technical effects brought about by the second to fourth aspects can be found in the descriptions of the methods in the above-mentioned method section, and will not be repeated here. Attached Figure Description
[0037] Figure 1 A schematic diagram illustrating a possible screenshot scenario provided in an embodiment of this application;
[0038] Figure 2 This is a schematic diagram of another possible screenshot scenario provided by an embodiment of this application;
[0039] Figure 3 This is a hardware and software architecture diagram of a terminal device provided in one embodiment of this application;
[0040] Figure 4 A schematic diagram illustrating the interaction process between the screenshot application and the screenshotted application provided in an embodiment of this application;
[0041] Figure 5 This is a schematic diagram of the screenshot process of a terminal device performing a scrolling screenshot according to an embodiment of this application;
[0042] Figure 6 This is a schematic diagram illustrating the process of stitching together screenshots obtained by a terminal device according to an embodiment of this application;
[0043] Figure 7 This is a flowchart of the steps of a screenshot method provided in an embodiment of this application;
[0044] Figure 8 This is a hardware architecture diagram of a terminal device provided in one embodiment of this application. Detailed Implementation
[0045] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0046] In the following description, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the embodiments of this application, words such as "exemplary," "or," and "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of words such as "exemplary," "or," and "for example" is intended to present the relevant concepts in a concrete manner.
[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terminology used in this application's specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. It should be understood that, unless otherwise stated, " / " in this application means "or". For example, A / B can mean A or B. "And / or" in this application is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. "At least one" means one or more. "More than one" means two or more. For example, at least one of a, b, or c can represent: a, b, c, a and b, a and c, b and c, and a, b, and c. It should be understood that the order of steps shown in the flowcharts herein can be changed, and some can be omitted.
[0048] To facilitate understanding of the embodiments of this application, the technical terms involved in this application will first be introduced:
[0049] Scrolling screenshot: also known as multi-page screenshot, refers to capturing the content displayed on the screen multiple times while the terminal device is scrolling through the page content, and then stitching the multiple screenshots into a single long screenshot image.
[0050] User interface (UI): This is the medium through which an application or operating system interacts and exchanges information with the user. It converts the internal form of information into a form that the user can understand. The user interface is written in specific computer languages such as Java or Extensible Markup Language (XML). This source code is parsed and rendered on the terminal device, ultimately presenting content that the user can recognize. A common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operation displayed graphically. It can be visible interface elements displayed on the terminal device's screen, such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets.
[0051] Application (APP): A software program that can perform one or more specific functions. Examples include calling applications, instant messaging applications, video applications, audio applications, image capture applications, cloud desktop applications, etc.
[0052] To facilitate users in capturing long screenshots, mobile devices typically support scrolling screenshot functionality. For scrollable interface elements, a screenshot application installed on the device can be used to capture the scrollable elements and obtain a long screenshot. Screenshot applications generally implement the scrolling of interface elements by simulating interface swipe events. This method may encounter issues where interface elements fail to scroll automatically, causing scrolling screenshots to fail and affecting the user experience.
[0053] In view of this, this application provides a screenshot method to solve the problem that scrollable interface elements cannot scroll automatically in scrolling screenshot scenarios, effectively improving the success rate of scrolling screenshots.
[0054] like Figure 1 The image shows a screenshot scenario provided in an embodiment of this application, which includes a terminal device 100. The terminal device can be a device with display functionality, and this embodiment does not limit the type of terminal device 100. For example, the terminal device 100 can be a mobile phone, tablet computer, personal computer, smart wearable device, etc.
[0055] Figure 1 Taking a mobile phone as an example, the terminal device 100 has a first application and a second application installed. The first application can be a video application, an instant messaging application, a reading application, etc., and the second application can be a screenshot application used to implement the screenshot function. This application embodiment does not limit the type of the first application.
[0056] Figure 1 Taking the first application as an instant messaging application as an example, the screen of the terminal device 100 is currently displaying the first interface 21 of the instant messaging application.
[0057] Users can trigger a screenshot of the first screen 21 by double-tapping with their knuckles, or by simultaneously pressing the power button and volume down button. For example... Figure 1 As shown, when a user double-tap the screen with their knuckle, or when the user simultaneously presses the power button and volume down button, the screen displays a second interface 22, which partially overlaps with the first interface 21. The second interface 22 may include a thumbnail 221 of the first interface 21, a first control 222, and a second control 223. For example, the first control 222 may be a "share" control, which can be used to share the screenshot through a preset application. The second control 223 may be a "scrolling screenshot" control, used for taking scrolling screenshots.
[0058] Taking the second control 223 as a "scrolling screenshot" control as an example, if the user clicks the second control 223, it can trigger a scrolling screenshot of the first interface 21. The screenshot application can respond to the click operation on the second control 223 by inputting a virtual swipe event to the instant messaging application to simulate the user swiping on the first interface, causing the first interface to scroll. The screenshot application captures multiple screenshot images by taking screenshots of the scrolling first interface, and then combines these multiple screenshot images in the order they were captured to obtain a long screenshot image. This embodiment of the application does not limit the timing of combining the screenshot images obtained from the screenshot. It can be done after a new screenshot image is captured, i.e., by combining it with the screenshot image obtained from the previous screenshot, or by combining it with the result of combining the previous image. Alternatively, it can be done after all screenshot images have been captured, and then combining all the screenshot images in the order they were captured.
[0059] In some embodiments, during the process of taking a scrolling screenshot of the first interface 21, the screenshot application may stop controlling the scrolling of the first interface in response to a click operation on the first interface.
[0060] like Figure 2 As shown, users can also take a screenshot of the first interface 21 by clicking the screenshot icon in the control center.
[0061] Taking the current interface displayed on the screen of terminal device 100 as the first interface 21 of an instant messaging application as an example, terminal device 100 can respond to the user's swipe-down operation from the top of the screen to open control center 23. Control center 23 displays a "screenshot" icon and a "screenshot" button. The "screenshot" icon is used to take a single-page screenshot. Terminal device 100 can respond to the click operation of the "screenshot" button to display a third interface 24. The third interface 24 may include a third control 241, a fourth control 242, and a fifth control 243. For example, the third control 241 can be a "screenshot" control, which is used to take a single-page screenshot, such as taking a single-page screenshot of the first interface 21. The fourth control 242 can be a "partial screenshot" control, which is used to take a screenshot of any closed shape, such as taking a screenshot of the first interface 21 of any closed shape (the closed shape is drawn by the user). The fifth control 243 can be a "scrolling screenshot" control, used to take a scrolling screenshot, such as taking a scrolling screenshot of the first interface 21.
[0062] Taking the fifth control 243 as a "scrolling screenshot" control as an example, if the user clicks the fifth control 243, it can trigger a scrolling screenshot of the first interface 21. The screenshot application can respond to the click operation on the fifth control 243 by inputting a virtual swipe event to the instant messaging application to simulate the user swiping on the first interface, causing the first interface 21 to scroll. For example, the screenshot application can capture multiple screenshots of the scrolling first interface, and then combine the multiple screenshots in the order they were captured to obtain a long screenshot image.
[0063] To better understand the implementation details of the above screenshot method on terminal devices, the following will combine... Figure 3 and Figure 4 This section describes the process by which various software and hardware components in a terminal device work together to achieve the above screenshot method. Details are as follows:
[0064] The operating system of a terminal device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application uses the layered architecture Android system as an example to illustrate the software structure of the terminal device. Figure 3 As shown, a layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. Taking the Android system as an example, in some implementations, the Android system is divided into four layers, from top to bottom: the application layer (Apk), the application framework layer (Framework), the hardware abstraction layer (HAL), and the kernel layer (Kernel).
[0065] The kernel layer may contain hardware-associated drivers that are linked to the hardware layer. It may also include hardware-intensive programs, such as interrupt handlers, and basic, common, frequently used modules, such as clock management modules and process scheduling modules.
[0066] For example, the hardware layer includes the display screen. The kernel layer may contain a display driver and a touch driver. The display driver is used to drive the display panel in the display screen to display content, and the touch driver is used to obtain user touch operations on the display screen from the touch layer in the display screen.
[0067] The Hardware Abstraction Layer (HAL) is used to abstract hardware, including, for example, a display module and a touch module. The display module abstracts the display panel hardware within the screen, making the abstracted display panel available for use by display algorithms in the algorithm library. The touch module abstracts the touch layer within the screen, making the abstracted touch layer available for use by touch algorithms in the algorithm library. The HAL may also include a hardware hybrid renderer (HWComposer, HWC) for compositing screen display content.
[0068] The application framework layer is used to implement basic algorithms based on the hardware abstraction layer (HWC), which are then called by the application layer. For example, the screenshot algorithm provided in this embodiment is used to execute the screenshot method provided in this embodiment, and the touch algorithm is used to generate screenshot instructions to trigger the screenshot operation of the screenshot application. Screenshot instructions may include single-page screenshot instructions and scrolling screenshot instructions. Single-page screenshot instructions are used to trigger the screenshot application to perform a single-page screenshot operation, and scrolling screenshot instructions are used to trigger the screenshot application to perform a scrolling screenshot operation. The application framework layer may also include a compositing service (SurfaceFlinger), which can call HWC to compose the screen display content.
[0069] In some embodiments, the screenshot algorithm may include accessibility services, image comparison services, and swipe event injection services. Accessibility services can be used to identify scrollable areas in the currently displayed application interface of the app being screenshotted. Image comparison services can be used to compare screenshot images to determine duplicate areas. Swipe event injection services can be used to generate and send virtual swipe events to the app being screenshotted. Touch algorithms may include screen interaction services, image processing services, and image storage services. Screen interaction services can generate screenshot commands (single-page screenshot commands or scrolling screenshot commands) in response to user screen touch operations. Image processing services can be used to implement functions such as cropping, adding mosaics, and drawing on screenshot images. Image storage services can be used to save screenshot images to the terminal device.
[0070] The application layer can include a series of application packages. For example, an application package can include instant messaging applications, video applications, screenshot applications, etc. An instant messaging application can be one that supports instant chat and / or instant calling, and a video application can be one that supports video playback. A screenshot application can be one that has screenshot functionality, especially scrolling screenshot functionality. A screenshot application can respond to a screenshot command, call a screenshot algorithm to perform the screenshot operation, and generate an image.
[0071] Please also refer to Figure 4 This diagram illustrates the interaction flow between the app taking the screenshot and the app being screenshotted. The app being screenshotted can be a video app, instant messaging app, reading app, calling app, etc. This application does not limit the type of app being screenshotted.
[0072] 400: The screenshotted application displays the first application interface.
[0073] In some embodiments, the display area of the first application interface can be divided into two parts: a scrollable area and a non-scrollable area. The scrollable area can refer to the area where the content can change its display position in response to the user's operation (e.g., a swipe up or down gesture), while the non-scrollable area can refer to the area where the content does not change its display position in response to the user's operation (e.g., a swipe up or down gesture).
[0074] In some embodiments, the scrollable UI elements in the first application interface can be determined based on information about the UI elements in the first application interface, and then the scrollable area in the first application interface can be determined based on the scrollable UI elements. UI elements can refer to visual elements on the first application interface, such as icons, text, videos, controls, images, etc.
[0075] For example, scrollable UI elements can be determined using either of the following two methods: Method 1: The information of scrollable UI elements includes specific fields, such as "webview", "scrollview", "listview", "recycleview", "contentview", etc. Method 2: A list of scrollable UI elements corresponding to different application interfaces is pre-built and updated. This list records the scrollable UI elements in the application interface, and then the information of the UI elements in the first application interface is compared with the list of UI elements.
[0076] 401: The screenshot application responds to the scroll screenshot command by finding a first scrollable area in the first application interface and using the first scrollable area as the target scrollable area.
[0077] In some embodiments, the scrolling screenshot command can be generated by the terminal device in response to a user action. For example, user actions include actions to trigger the terminal device to display the "scrolling screenshot" control and actions to click the "scrolling screenshot" control. Actions to trigger the terminal device to display the "scrolling screenshot" control include, but are not limited to, double-tapping with a knuckle, pressing the power button and volume down button simultaneously, clicking the "screenshot" button in the control center, or interacting with a voice assistant.
[0078] In some embodiments, if the first application interface includes a scrollable area, the first scrollable area is that scrollable area in the first application interface. If the first application interface includes multiple scrollable areas, it is assumed that the multiple scrollable areas are arranged vertically in the application interface. The first scrollable area can be a scrollable area determined according to preset rules. The preset rules can be set according to actual needs, and the embodiments of this application do not limit this. For example, the screenshot application randomly selects one scrollable area from multiple scrollable areas as the first scrollable area. As another example, the screenshot application selects the scrollable area with the largest area from multiple scrollable areas as the first scrollable area.
[0079] The target scrolling area refers to the area of the first application interface that the screenshotting application is scrolling to capture. Other non-target scrolling areas are equivalent to non-scrolling areas during the scrolling process of the first application interface.
[0080] 402: The screenshot application generates a virtual swipe event corresponding to the target scrolling area.
[0081] In some embodiments, the virtual swipe event corresponding to the target scrolling area may refer to a virtual swipe event used to scroll the content of the target scrolling area.
[0082] In some embodiments, a virtual swipe event can refer to a swipe event generated by simulating a user's swipe operation on the display screen. The content of a virtual swipe event is the same as that of a swipe event generated based on a user's swipe operation on the display screen; the difference is that a virtual swipe event is not generated based on a real swipe operation detected by the display screen. That is, like a real swipe event, a virtual swipe event can also include touch events and the coordinates of the touch point corresponding to the touch event. For example, a virtual swipe event can include a press event (also called a DOWN event), several movement events (also called MOVE events), and a release event (also called an UP event).
[0083] Virtual swipe events may also include touch point coordinates corresponding to each event, such as touch point coordinates corresponding to the DOWN event, touch point coordinates corresponding to each MOVE event, and touch point coordinates corresponding to the UP event. The number of MOVE events can be set based on the swipe duration of the simulated swipe operation; this embodiment does not limit this. A DOWN event can refer to a press event generated when a user's finger begins to touch the display screen, typically used to start a new operation or gesture. A MOVE event can refer to a movement event generated when a user's finger moves on the display screen, which can be used to track the finger's movement trajectory and realize functions such as dragging and swiping. An UP event can refer to a release event generated when a user lifts their finger, typically used to complete an operation or gesture.
[0084] The embodiments of this application do not limit the number of virtual swipe events. For example, if a virtual swipe event is used to trigger the scrollable area in the screenshot application to scroll and display a page of screenshot content, the number of virtual swipe events can be multiple. Multiple virtual swipe events are used to trigger the scrollable area to scroll and display multiple pages of screenshot content, and the multiple pages of screenshot content correspond one-to-one with multiple screenshot images.
[0085] 403: The app that took the screenshot sent a virtual swipe event to the app that took the screenshot.
[0086] In some embodiments, the application being screenshotted can be an application that provides the screenshot interface, and the screenshot image can be obtained by taking a screenshot through the screenshot application.
[0087] In some embodiments, after generating a virtual swipe event, the screenshotting application can send the virtual swipe event to the screenshotted application. The screenshotted application can respond to the virtual swipe event and refresh the application interface to achieve the scrolling display effect of the content in the target scrolling area.
[0088] For example, after receiving a virtual swipe event, the app being screenshotted (its thread) can draw and render an image frame based on the touch point coordinates and the touch event in the virtual swipe event. The app being screenshotted can also send the rendered image frame to SurfaceFlinger, which can then call HWC to composite the image frames, resulting in the application interface to be displayed. HWC can then transmit the application interface to the display driver, which can drive the display panel to display the application interface, thus refreshing the application interface of the screenshotted app and making the content of the target scrolling area of the screenshotted app perceptible to the human eye.
[0089] 404: The screenshotted application responded to a virtual swipe event and scrolled the content of the target scrolling area.
[0090] In some embodiments, the content of the target scrolling area can scroll upwards or downwards. Scrolling upwards can refer to moving from the bottom of the screen to the top, and scrolling downwards can refer to moving from the top of the screen to the bottom. The following explanation uses the example of the target scrolling area scrolling downwards.
[0091] 405: The screenshot application blocks dynamic content in the first application interface and determines whether the target scrolling area scrolls successfully.
[0092] In some embodiments, dynamic content can refer to content that can be displayed dynamically. Dynamic content may include, but is not limited to, one or more of the following: dynamically changing videos, images, icons, controls, text, or tables. The forms of change for dynamic content can be varied, such as changes in video frame, image content, color, size, angle, position, etc.
[0093] Because dynamic content changes over time, it may affect the determination of whether the target scrolling area has scrolled successfully. By disabling dynamic content in the first application interface, the accuracy of determining whether the target scrolling area has scrolled successfully can be improved.
[0094] Dynamic content can also affect the stitching of screenshots. By blocking dynamic content in the first application interface, anomalies can be avoided when stitching screenshots taken from the first application interface later. For example, changes in dynamic content may lead to a misjudgment that the first screenshot taken at adjacent times does not have overlapping areas with the second screenshot.
[0095] Dynamic content may also affect the identification of scrollable areas. By blocking dynamic content in the first application interface, it is easier to accurately find other scrollable areas later and avoid misidentification of scrollable areas.
[0096] In some embodiments, during the scrolling of the target scrolling area, the screenshot application can determine whether the target scrolling area has scrolled successfully by judging whether the target scrolling area contains new content. For example, by blocking dynamic content in the first application interface, when the scrolling of the target scrolling area begins, the screenshot application captures the content displayed on the first application interface for the first time, obtaining a corresponding first screenshot image. By comparing the first screenshot image with a second screenshot image captured at the next adjacent time point, it determines whether the second screenshot image contains new content, thereby determining whether the target scrolling area has scrolled successfully. The new content can refer to content that does not appear in the first screenshot image.
[0097] In some embodiments, the screenshot application may also block dynamic content in the first application interface after determining that the target scrolling area has not scrolled successfully.
[0098] 406: If the target scrolling area fails to scroll successfully, the screenshot application determines whether the number of times the virtual swipe event is updated is greater than a preset value.
[0099] This application does not limit the reasons why the target scrolling area fails to scroll successfully. For example, it may be that the operating system of the terminal device is malfunctioning, or the application being screenshotted is malfunctioning, or the touch point coordinates corresponding to the DOWN event in the virtual swipe event do not fall into the target scrolling area.
[0100] For each scrollable area in the first application interface, the screenshotting application is set to attempt to scroll the content of that scrollable area a maximum of (preset value + 1) times by inputting a virtual swipe event to the screenshotted application. The preset value can be set according to actual needs, and this application embodiment does not limit it. For example, the preset value is 3, that is, for each scrollable area in the first application interface, the screenshotting application will attempt to input a virtual swipe event to the screenshotted application a maximum of four times by inputting a virtual swipe event to the screenshotted application to attempt to scroll the content of that scrollable area.
[0101] In some embodiments, for each scrollable area in the first application interface, the update count can be incremented by one each time a virtual swipe event is updated, and the update counts can be accumulated for different scrollable areas respectively.
[0102] In some embodiments, each input virtual swipe event may contain the same touch event, but the touch point coordinates contained in each input virtual swipe event are different.
[0103] 407: If the number of updates is less than or equal to the preset value, the screenshot application updates the virtual swipe event.
[0104] It's understandable that the touch point coordinates in the updated virtual swipe event are different from those in the previous virtual swipe event. After the screenshot application updates the virtual swipe event, it can send the updated virtual swipe event to the screenshotted application, allowing the screenshotted application to respond to the received virtual swipe event again and scroll the content of the target scroll area. That is, after executing interaction flow 407, it can jump to executing interaction flow 403.
[0105] Assuming an XY coordinate system is constructed using the display screen of the terminal device, with the origin at the bottom left corner of the screen, the X-axis pointing in the width direction of the screen, and the Y-axis pointing in the length direction (also known as the height direction) of the screen. Taking a virtual swipe event as an example of a downward swipe event, the virtual swipe event can include one DOWN event, n MOVE events, and one UP event, where n is a positive integer. The value of n can be set according to actual needs, and this embodiment does not limit this; for example, the value of n is 3.
[0106] Screenshot applications can update virtual swipe events by changing the Y-coordinate of the DOWN event, resulting in an updated virtual swipe event. It can be understood that for the virtual swipe event before the update, when the Y-coordinate of the DOWN event changes, the Y-coordinates of each MOVE and UP event will also change accordingly. That is, for the virtual swipe event before and after the update, the Y-coordinates of the DOWN event, each MOVE event, and the UP event are different.
[0107] In some embodiments, changing the Y-coordinate of the DOWN event in a virtual swipe event can mean modifying the Y-coordinate of the DOWN event in the virtual swipe event to be closer to the center of the first scrollable area. For example, the updated virtual swipe event can be obtained by updating the distance between the DOWN event in the virtual swipe event and the center point of the first scrollable area. Specifically, the first distance between the DOWN event in the original virtual swipe event and the center point of the first scrollable area is greater than the second distance between the DOWN event in the updated virtual swipe event and the center point, so that the updated DOWN event is closer to the center of the first scrollable area. For example, the touch point coordinates corresponding to the press DOWN event in the original virtual swipe event include a first Y-coordinate, the touch point coordinates corresponding to the DOWN event in the updated virtual swipe event include a second Y-coordinate, the center point of the first scrollable area corresponds to a third Y-coordinate, and the absolute value of the difference between the first Y-coordinate and the third Y-coordinate is greater than the absolute value of the difference between the second Y-coordinate and the third Y-coordinate.
[0108] In some embodiments, the Y-coordinate of each touch event in the virtual swipe event can be changed by adjusting the touch area range of the first scrollable area in the Y-axis direction, thereby updating the virtual swipe event. For example, before the touch area adjustment, the touch area of the first scrollable area is the entire area of the first scrollable area. By reducing the touch area of the first scrollable area inward along the Y-axis direction by a preset ratio, and then generating virtual swipe events based on the reduced touch area of the first scrollable area, the Y-coordinate of the DOWN event of the newly generated virtual swipe event can be closer to the middle area of the first scrollable area, thereby improving the success rate of scrolling the content of the first scrollable area. The preset ratio can be set according to actual needs, and this application embodiment does not limit it. For example, the preset ratio is one-quarter.
[0109] 408: If the number of updates exceeds the preset value, the screenshot application will search for another scrollable area in the first application interface that is different from the first scrollable area.
[0110] In some embodiments, if the number of updates exceeds a preset value, it indicates that (preset value + 1) attempts to input virtual swipe events to the app being screenshotted have all failed to scroll the content of the target scrolling area. In this case, the app being screenshotted may try to find another scrollable area in the first application interface that is different from the first scrollable area, and attempt to scroll and screenshot that other scrollable area.
[0111] In some embodiments, the screenshot application can look for the existence of other scrollable areas based on information from UI elements in the first application interface.
[0112] 409: If another scrollable area is found, the screenshot application will use that other scrollable area as the target scrollable area.
[0113] In some embodiments, if another scrollable area is found, the screenshot application can use that other scrollable area as the target scrollable area to attempt to take a screenshot of that other scrollable area. That is, after executing interaction flow 409, it can jump to execute interaction flow 402.
[0114] 410: If no other scrollable area is found, the screenshot application calls the preset scrolling algorithm to scroll the content of the target scrollable area.
[0115] In some embodiments, the preset scrolling algorithm may be The company is The system's native scrolling algorithm is used to scroll the content of the target scrolling area.
[0116] In some embodiments, if no other scrollable area is found, the screenshot application may also exit the scrolling screenshot of the first application interface and output a preset prompt message, such as a prompt message indicating that the scrolling screenshot failed.
[0117] In some embodiments, the screenshot application can also configure the number of times the scrollable area is searched. For example, for each application interface, the screenshot application may perform a maximum of m searches for the scrollable area. m is a positive integer, and the value of m can be set according to actual needs. This application embodiment does not limit this, for example, m = 3. The search count can be incremented by one each time a scrollable area is searched. Before attempting to search for another scrollable area, it can be determined whether the search count is greater than the value of m. If the search count is greater than the value of m, the scrollable area search is not performed, and the screenshot application can directly call a preset scrolling algorithm to scroll the content of the target scrollable area. If the search count is less than or equal to the value of m, the screenshot application searches for another scrollable area and uses the found other scrollable area as the target scrollable area to attempt to scroll and capture the other scrollable area.
[0118] 411: If the target scrolling area scrolls successfully, the screenshot application captures the content displayed by the first user interface at multiple points in time, resulting in multiple screenshot images.
[0119] In some embodiments, multiple screenshots may include a first screenshot and a second screenshot captured at adjacent time points. The screenshot application may obtain the height of the target scrolling area and determine a preset scrolling distance based on that height. The preset scrolling distance characterizes the distance the content of the target scrolling area scrolls in the scrolling direction from the previous screenshot when the screenshot application takes another screenshot. For example, the screenshot application captures the content displayed on the first user interface at a first time point to obtain a first screenshot. After the first time point, the screenshot application responds to a virtual swipe event and scrolls the content of the target scrolling area. When the scrolling distance of the content in the target scrolling area reaches the preset scrolling distance, the screenshot application captures the content displayed on the first user interface again to obtain a second screenshot. The preset scrolling distance can be determined based on the height of the target scrolling area, and the preset scrolling distance is less than the height of the target scrolling area; for example, the preset scrolling distance is three-quarters or one-half of the height of the target scrolling area.
[0120] like Figure 5 As shown, the first application interface I1 displayed by the screenshot application includes a scrollable area 101, which is the area where the screenshot application scrolls to capture the first application interface I1. Assume the height of the scrollable area 101 is H1, and the preset scrolling distance is 3 / 4 * H1. Figure 5 As shown in (a), the screenshot application captures the content displayed on the first user interface at the first point in time, obtaining the first screenshot image I11. Figure 5 As shown in (b), at the second time point after the first time point, the scrolling distance of the content in the target scrolling area reaches the preset scrolling distance, and the screenshot application captures the content displayed on the first user interface to obtain the second screenshot image I12. Similarly, at the i-th time point after the (i-1)-th time point, the scrolling distance of the content in the target scrolling area reaches the preset scrolling distance, and the screenshot application captures the content displayed on the first user interface to obtain the i-th screenshot image.
[0121] In some embodiments, the timing of the screenshot application capturing the last screenshot may be triggered by the user ending the scrolling screenshot operation, or it may be due to the content of the target scrolling area having scrolled to the bottom. That is, the timing of capturing the last screenshot is not determined by detecting whether the scrolling distance of the target scrolling area has reached a preset scrolling distance, but rather by receiving the user's action to end the scrolling screenshot, or by detecting that the content of the target scrolling area has scrolled to the bottom. Figure 5As shown in (c), the third screenshot image I13 is obtained by the screenshot application capturing the content displayed in the first user interface. The third screenshot image I13 is obtained by the screenshot application when it detects that the content of the target scrolling area has scrolled to the bottom.
[0122] In some embodiments, the screenshot application can determine whether it has scrolled to the bottom based on the UI elements displayed in the target scrolling area. For example, if the screenshot application detects that there are no other UI elements below the bottom UI element in the currently displayed content of the target scrolling area, the screenshot application can determine that the target scrolling area has scrolled to the bottom.
[0123] In some embodiments, the screenshot application can also determine whether the target scrolling area has scrolled to the bottom based on the similarity of the image content. For example, when the target scrolling area is suspected of having scrolled to the bottom, the screenshot application can capture the content displayed on the first user interface to obtain a screenshot. If the scrolling distance has not reached a preset scrolling distance, the content currently displayed in the target scrolling area can be considered valid page content. The target scrolling area continues to scroll upwards with the valid page content, and the area below this valid page content is filled with blank page content. Until the scrolling distance reaches the preset scrolling distance, the screenshot application can capture the content displayed on the first user interface again to obtain another screenshot. The screenshot application can compare the similarity of the valid page content in the two screenshots. If the similarity reaches a certain threshold, the screenshot application can determine that the target scrolling area has scrolled to the bottom.
[0124] In some embodiments, the screenshot application may also block dynamic content in the first application interface after determining that the target scrolling area has been successfully scrolled, so as to avoid the dynamic content in multiple screenshots being different.
[0125] 412: Screenshot applications stitch together multiple screenshots to create a longer screenshot.
[0126] In some embodiments, during the process of stitching screenshots together, the screenshot application can crop out part of the screenshot and then stitch the cropped screenshot together using the first and last stitching method to obtain a long screenshot.
[0127] For example, when taking two screenshots at adjacent time points, the screenshot app needs to crop out content containing overlapping areas to avoid duplicate content in the resulting long screenshot, where overlapping areas of the two adjacent screenshots overlap. For the first and second screenshots taken at adjacent time points, the screenshot app can crop the second screenshot, removing content that overlaps with the first screenshot, and then stitch the first screenshot and the cropped second screenshot together.
[0128] In some embodiments, the screenshot application can determine the overlapping and non-overlapping areas by comparing the pixels of two screenshots taken at adjacent time points. Alternatively, the screenshot application can determine the overlapping and non-overlapping areas based on the scrolling distance of the content in the target scrolling area between two screenshots taken at adjacent time points.
[0129] In some embodiments, the repeating region may refer to the overlapping region located within the target scrolling region.
[0130] like Figure 6 The diagram illustrates the process of a screenshot application stitching together a long screenshot image based on the overlapping areas of adjacent screenshot images. Figure 6 The screenshot shown in (c) is a screenshot taken in response to the user's action of ending the scrolling screenshot. Figure 6 (a) Figure 6 The overlapping area of the two screenshots shown in (b) is region 601. The screenshot application can... Figure 6 The screenshot shown in (a) is the same as Figure 6 The areas 601 of the screenshots shown in (b) overlap, thus stitching the two screenshots together. Similarly, it can be obtained that... Figure 6 (b) Figure 6 The overlapping area of the two screenshots shown in (c) is region 602. The terminal device can... Figure 6 The screenshot shown in (b) is the same as Figure 6 The areas 602 of the screenshots shown in (c) overlap, thus stitching the two screenshots together. In this way, the screenshot application can ultimately determine the correct format based on the image. Figure 6 Middle (a) to Figure 6 The screenshot shown in (c) is stitched together Figure 6 The long screenshot shown in (d) is shown in the middle.
[0131] In some embodiments, each virtual swipe event can be used to control the scrolling of content in the target scrolling area by a preset scrolling distance. The screenshot application can send the next virtual swipe event to the screenshotted application after completing one screenshot operation. If the screenshot application adopts a simultaneous screenshot and stitching working mode, it can stop sending virtual swipe events to the screenshotted application if stitching fails. The screenshot application exits the scrolling screenshot of the first application interface and can output a prompt message indicating that the scrolling screenshot failed.
[0132] like Figure 7The image shown illustrates a screenshot method provided in this application. This method can be applied to a terminal device, which may have a screenshot application and a screenshot-targeted application installed. The screenshot-targeted application can be an application that provides the screenshot interface, allowing the screenshot image to be obtained through the screenshot application. The screenshot method may include the following steps:
[0133] S71: In response to the user's first action, display the application interface of the screenshotted application, which includes one or more scrollable areas.
[0134] In some embodiments, if the terminal device does not have the screenshot application open, the first operation may be to open the screenshot application and display its application interface (e.g., by clicking). If the terminal device has the screenshot application open, the first operation may be to display a specific application interface of the screenshot application.
[0135] S72: In response to the user's second operation, a first virtual swipe event is generated, which is used to trigger the first application to scroll and display the content of the first scrollable area in the application interface.
[0136] In some embodiments, the second operation may refer to the operation that triggers the terminal device to generate a scrolling screenshot command. For example, the second operation may include the operation of triggering the terminal device to display a "scrolling screenshot" control and the operation of clicking the "scrolling screenshot" control. The operation of triggering the terminal device to display the "scrolling screenshot" control includes, but is not limited to, double-tapping with a knuckle, or pressing the power button and volume down button simultaneously, or clicking the "screenshot" button in the control center, or interacting with a voice assistant.
[0137] S73: If the first virtual swipe event does not trigger the scrolling display of the content of the first scrollable area, a second virtual swipe event is generated to trigger the first application to scroll and display the content of the first scrollable area. The touch point coordinates contained in the second virtual swipe event are different from the touch point coordinates contained in the first virtual swipe event.
[0138] In some embodiments, generating a second virtual swipe event to trigger a first application to scroll and display the content of a first scrollable area may include updating a first virtual swipe event to obtain a second virtual swipe event.
[0139] For example, the second virtual swipe event is obtained by updating the touch point coordinates corresponding to each touch event in the first virtual swipe event. Specifically, the Y-coordinate in the touch point coordinates can be determined based on a preset coordinate system, and then the Y-coordinate corresponding to each touch event in the first virtual swipe event can be updated. The Y-axis in the preset coordinate system is determined according to the vertical direction of the terminal device's display screen. For example, the preset coordinate system can be the XY coordinate system constructed based on the terminal device's display screen as described above.
[0140] In some embodiments, a second virtual swipe event can be obtained by updating the distance between the DOWN event in the first virtual swipe event and the center point of the first scrollable area. The first distance between the DOWN event in the first virtual swipe event and the center point of the first scrollable area is greater than the second distance between the DOWN event in the second virtual swipe event and the center point. For example, the touch point coordinates corresponding to the DOWN event in the first virtual swipe event include a first Y-coordinate, the touch point coordinates corresponding to the DOWN event in the second virtual swipe event include a second Y-coordinate, the center point of the first scrollable area corresponds to a third Y-coordinate, the absolute value of the difference between the first Y-coordinate and the third Y-coordinate is greater than the absolute value of the difference between the second Y-coordinate and the third Y-coordinate, and all three Y-coordinates are Y-coordinates in a preset coordinate system.
[0141] In some embodiments, if the first virtual swipe event does not trigger the scrolling display of the content in the first scrollable area, the touch area of the first scrollable area can be reduced; a second virtual swipe event can be generated based on the reduced touch area of the first scrollable area. For example, the touch area of the first scrollable area can be reduced inward along the Y-axis direction by a preset ratio.
[0142] In some embodiments, updating the first virtual swipe event may include updating the first virtual swipe event when the number of updates to the first virtual swipe event is less than or equal to a first preset value.
[0143] In some embodiments, if the number of updates to the first virtual swipe event exceeds a first preset value, a second scrollable area in the application interface can be searched further; a third virtual swipe event is generated to trigger the first application to scroll and display the content of the second scrollable area. The second scrollable area may refer to another scrollable area in the application interface of the screenshotted application.
[0144] For the second scrollable area, scrolling can also be attempted up to a preset number of times. Specifically, if the third virtual swipe event does not trigger the scrolling display of the content in the second scrollable area, a fourth virtual swipe event is generated to trigger the first application to scroll and display the content in the second scrollable area. The touch point coordinates contained in the fourth virtual swipe event are different from those contained in the third virtual swipe event.
[0145] In some embodiments, if the number of updates to the first virtual swipe event is greater than a first preset value and no second scrollable area is found, a preset scrolling algorithm can be directly invoked to scroll the content of the first scrollable area. For example, the preset scrolling algorithm can be a native scrolling algorithm built into the operating system of the terminal device. This native scrolling algorithm may not use the method of injecting virtual swipe events to scroll and display the content of the scrollable area, that is, it uses a method different from that in the embodiments of this application to attempt to scroll and display the content of the scrollable area.
[0146] In some embodiments, if the number of updates to the first virtual swipe event is greater than a first preset value, and the number of searches for scrollable areas in the application interface is less than or equal to a second preset value, then a second scrollable area in the application interface is searched. If the number of updates to the first virtual swipe event is greater than the first preset value, and the number of searches for scrollable areas in the application interface is greater than the second preset value, then a preset scrolling algorithm can be directly invoked to scroll the content of the first scrollable area.
[0147] S74: During the process of scrolling the content of the first scrollable area, capture the content displayed on the application interface at different points in time to obtain multiple screenshot images.
[0148] Taking the scrollable first area as an example, at a first point in time, the screenshot application captures the content displayed on the user interface, obtaining the first screenshot image. This first point in time can be the start time of the scrolling screenshot. After the first point in time, the screenshot application responds to a virtual swipe event, scrolling the content of the first scrollable area. When the scrolling distance of the content in the first scrollable area reaches a preset scrolling distance, the screenshot application captures the content displayed on the user interface again, obtaining the second screenshot image. The preset scrolling distance can be determined based on the height of the first scrollable area, and the preset scrolling distance is less than the height of the first scrollable area.
[0149] S75: Combines multiple screenshots into a single long screenshot.
[0150] After capturing multiple screenshots, you can crop out parts of the screenshots and then stitch them together using the first and last stitching method to obtain a longer screenshot.
[0151] See Figure 8As shown, the terminal device 100 involved in the embodiments of this application will be described below. The terminal device 100 in the embodiments of this application can be a mobile phone, tablet computer, desktop computer, laptop computer, handheld computer, notebook computer, ultra-mobile personal computer (UMPC), large screen, smart TV, netbook, as well as cellular phone, personal digital assistant (PDA), augmented reality (AR) / virtual reality (VR) devices, etc., including a display screen. The embodiments of this application do not impose special limitations on the specific form of the terminal device. Please refer to... Figure 8 , Figure 8 This is a schematic diagram of the structure of the terminal device 100 provided in the embodiments of this application.
[0152] Terminal device 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.
[0153] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the terminal device 100. In other embodiments of this application, the terminal device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0154] In addition, an operating system runs on top of the aforementioned components. Examples include Apple's iOS operating system, Google's Android open-source operating system, and Microsoft's Windows operating system.
[0155] Processor 110 may include one or more processing units, such as application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU). These different processing units may be independent devices or integrated into one or more processors.
[0156] For example, processor 110 can be used to execute the above-described screenshot method to perform a scrolling screenshot in response to user operation.
[0157] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can store instructions or data that the processor 110 has just used or that are being used repeatedly. If the processor 110 needs to use the instructions or data again, it can retrieve them directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves system efficiency.
[0158] In some embodiments, the processor 110 may include one or more interfaces. Interfaces 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 universal serial bus (USB) interface, etc.
[0159] The wireless communication function of the terminal device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[0160] Antennas 1 and 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed 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.
[0161] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the terminal device 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.
[0162] The wireless communication module 160 can provide solutions for wireless communication applications on the terminal device 100, including wireless local area networks (WLANs) (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.
[0163] In some embodiments, antenna 1 of terminal device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling terminal device 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), 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).
[0164] Terminal device 100 implements display functions through a GPU, display screen 194, and application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0165] The display screen 194 is used to display images, videos, etc. The display screen 194 can also be used to display screenshots, long screenshots, 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 minimized display, a microLED, a micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the terminal device 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 a touch screen, that is, the display screen 194 integrates a touch sensor 180K.
[0166] Internal memory 121 may include one or more random access memory (RAM) and one or more non-volatile memory (NVM). The RAM may include static random-access memory (SRAM), dynamic random-access memory (DRAM), synchronous dynamic random-access memory (SDRAM), double data rate synchronous dynamic random-access memory (DDR SDRAM, such as fifth-generation DDR SDRAM, generally referred to as DDR5 SDRAM), etc.; the NVM may include disk storage devices and flash memory.
[0167] Flash memory can be classified according to its operating principle, including NOR FLASH, NAND FLASH, 3D NAND FLASH, etc.; according to the level of the storage cell, including single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc.; and according to the storage specification, including universal flash storage (UFS) and embedded multimedia card (eMMC), etc.
[0168] The random access memory can be directly read and written by the processor 110. It can be used to store executable programs (such as machine instructions) of the operating system or other running programs, as well as user and application data.
[0169] Non-volatile memory can also store executable programs and user and application data, and can be pre-loaded into random access memory for direct reading and writing by the processor 110.
[0170] The external memory interface 120 can be used to connect to external non-volatile memory to expand the storage capacity of the terminal device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to realize data storage function.
[0171] The screenshot methods described in the above embodiments can all be implemented in the terminal device 100 with the above hardware structure.
[0172] This embodiment also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed on the terminal device 100, the terminal device 100 performs the aforementioned related method steps to implement the screenshot method in the above embodiment.
[0173] This embodiment also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to implement the screenshot method described in the above embodiment.
[0174] This embodiment also provides a chip system coupled to a memory. The chip system is used to read and execute computer programs stored in the memory to implement the screenshot method in the above embodiment.
[0175] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0176] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0177] The unit described as a separate component may or may not be physically separate. The component shown as a unit can be one physical unit or multiple physical units, that is, it can be located in one place or distributed in multiple different places. Some or all of the units can be selected to achieve the purpose of the solution in this embodiment according to actual needs.
[0178] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0179] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0180] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A screenshot method, applied to a terminal device, characterized in that, The method includes: In response to the user's first action, the application interface of the first application is displayed, the application interface including one or more scrollable areas; In response to a second user action, a first virtual swipe event is generated, which triggers the first application to scroll and display the content of a first scrollable area in the application interface. If the first virtual swipe event does not trigger the scrolling display of the content of the first scrollable area, a second virtual swipe event is generated to trigger the first application to scroll the content of the first scrollable area. The touch point coordinates included in the second virtual swipe event are different from the touch point coordinates included in the first virtual swipe event. The touch point coordinates include the touch point coordinates corresponding to the DOWN press event. During the scrolling display of the content of the first scrollable area, the content displayed on the application interface at multiple points in time is captured to obtain multiple screenshot images; The multiple screenshots are stitched together to form a long screenshot.
2. The screenshot method as described in claim 1, characterized in that, The generation of a second virtual swipe event for triggering the first application to scroll and display the content of the first scrollable area includes: The first virtual swipe event is updated to obtain the second virtual swipe event.
3. The screenshot method as described in claim 2, characterized in that, The update of the first virtual swipe event includes: Update the touch point coordinates corresponding to each touch event in the first virtual swipe event.
4. The screenshot method as described in claim 3, characterized in that, Updating the touch point coordinates corresponding to each touch event in the first virtual swipe event includes: The Y-coordinate of the touch point is determined based on a preset coordinate system, wherein the Y-axis of the preset coordinate system is determined according to the vertical direction of the display screen of the terminal device. Update the Y coordinate corresponding to each touch event in the first virtual swipe event.
5. The screenshot method as described in claim 2, characterized in that, The step of updating the first virtual swipe event to obtain the second virtual swipe event includes: Update the distance between the DOWN event in the first virtual slide event and the center point of the first scrollable area to obtain the second virtual slide event. The first distance between the DOWN event in the first virtual slide event and the center point of the first scrollable area is greater than the second distance between the DOWN event in the second virtual slide event and the center point.
6. The screenshot method as described in claim 5, characterized in that, The touch point coordinates corresponding to the DOWN event in the first virtual swipe event include a first Y coordinate, the touch point coordinates corresponding to the DOWN event in the second virtual swipe event include a second Y coordinate, the center point of the first scrollable area corresponds to a third Y coordinate, the absolute value of the difference between the first Y coordinate and the third Y coordinate is greater than the absolute value of the difference between the second Y coordinate and the third Y coordinate, and the first Y coordinate to the third Y coordinate are all Y coordinates under a preset coordinate system, the Y axis in the preset coordinate system is determined according to the vertical direction of the display screen of the terminal device.
7. The screenshot method as described in claim 2, characterized in that, The update of the first virtual swipe event includes: If the number of updates to the first virtual swipe event is less than or equal to a first preset value, the first virtual swipe event is updated.
8. The screenshot method as described in claim 2, characterized in that, The method further includes: If the number of updates of the first virtual swipe event is greater than the first preset value, then find the second scrollable area in the application interface; A third virtual swipe event is generated to trigger the first application to scroll and display the content of the second scrollable area.
9. The screenshot method as described in claim 8, characterized in that, The method further includes: If the third virtual swipe event does not trigger the scrolling display of the content in the second scrollable area, a fourth virtual swipe event is generated to trigger the first application to scroll and display the content in the second scrollable area. The touch point coordinates included in the fourth virtual swipe event are different from those included in the third virtual swipe event.
10. The screenshot method as described in claim 8, characterized in that, The method further includes: If the number of updates of the first virtual swipe event is greater than the first preset value, and the second scrollable area is not found, the preset scrolling algorithm is invoked to scroll the content of the first scrollable area.
11. The screenshot method as described in claim 8, characterized in that, The step of finding the second scrollable area in the application interface when the number of updates of the first virtual swipe event is greater than a first preset value includes: If the number of updates to the first virtual swipe event is greater than the first preset value, and the number of searches for the scrollable area in the application interface is less than or equal to the second preset value, then search for the second scrollable area in the application interface.
12. The screenshot method as described in claim 11, characterized in that, The method further includes: If the number of updates to the first virtual swipe event is greater than the first preset value, and the number of searches for the scrollable area in the application interface is greater than the second preset value, a preset scrolling algorithm is invoked to scroll the content of the first scrollable area.
13. The screenshot method as described in claim 1, characterized in that, In the case where the first virtual swipe event does not trigger the scrolling display of the content in the first scrollable area, generating a second virtual swipe event to trigger the first application to scroll and display the content in the first scrollable area includes: If the first virtual swipe event does not trigger the scrolling display of the content in the first scrollable area, the touch area of the first scrollable area is reduced. The second virtual swipe event is generated based on the touch area of the reduced first scrollable area.
14. The screenshot method as described in claim 13, characterized in that, The reduction of the touch area of the first scrollable area includes: The touch area of the first scrollable area is reduced inward by a preset ratio along the Y-axis direction, wherein the Y-axis is determined according to the vertical direction of the display screen of the terminal device.
15. A terminal device, characterized in that, The terminal device includes a display screen, a memory, and a processor; The display screen and the memory are both coupled to the processor; The memory is used to store program instructions; The processor is configured to read the program instructions stored in the memory to implement the screenshot method as described in any one of claims 1 to 14.
16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the screenshot method as described in any one of claims 1 to 14.
17. A computer program product, the computer program product comprising computer-readable instructions, characterized in that, When the computer-readable instruction is executed by the processor, it implements the screenshot method as described in any one of claims 1 to 14.