Screen capture method and related equipment
By generating virtual sliding events with different touch point coordinates in the terminal device and updating virtual sliding events, the problem of failed scrolling screenshots is solved, and the success rate and user experience of scrolling screenshots are improved.
Patent Information
- Application Number
- CN202411291945.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2044-09-13
AI Technical Summary
When existing terminal devices perform scrolling screenshots, screenshot failures are more likely to occur, which affects the user's experience.
By generating virtual sliding events with different touch point coordinates, simulate touch sliding in the scrollable area in the application interface, update the virtual sliding events to try scrolling content, and find or call the preset scrolling algorithm in case of failure, reduce the touch area to improve the success rate of scrolling screenshots.
It improves the success rate of terminal devices when scrolling screenshots, avoids device downtime, and improves user experience.
Smart Images

Figure CN120469619A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a screenshot method and related equipment. Background Art
[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 generally support a screenshot function, so that users can use the screenshot function to capture the content displayed on the terminal device at any time while using the terminal device.
[0003] In related technologies, to facilitate users in capturing long images, terminal devices generally support a scrolling screenshot function. For scrollable interface elements, screenshots can be captured using a screenshot application installed on the terminal device. Screenshot applications generally achieve scrolling of interface elements by simulating interface sliding events. This method is prone to the problem of interface elements not being able to automatically scroll, resulting in scrolling screenshot failures and affecting the user experience. Summary of the Invention
[0004] In view of the above, it is necessary to provide a screenshot method and related equipment, which can solve the problem that the existing terminal equipment is more likely to fail in screenshot when performing scrolling screenshot.
[0005] In a first aspect, the present application provides a screenshot method, which is applied to a terminal device. The screenshot method may include: in response to a first operation of a user, displaying an application interface of a first application, the application interface including one or more scrollable areas; in response to a second operation of the user, generating a first virtual sliding event, the first virtual sliding event being used to trigger the first application to scroll and display the content of the first scrollable area in the application interface; when the first virtual sliding event does not trigger the scrolling display of the content of the first scrollable area, generating a second virtual sliding event for triggering the first application to scroll and display the content of the first scrollable area, the touch point coordinates included in the second virtual sliding event are different from the touch point coordinates included in the first virtual sliding event; in the process of scrolling the content of the first scrollable area, capturing the content displayed on the application interface at multiple time points to obtain multiple screenshots; and splicing the multiple screenshots into a long screenshot.
[0006] By adopting the above technical solution, by injecting virtual sliding events with different touch point coordinates into the screenshot application (first application), touch sliding at different positions of the first scrollable area in the application interface can be simulated, which can increase the possibility of the screenshot application successfully scrolling to display the content of the first scrollable area in the application interface, and thus increase the possibility of the terminal device successfully performing a scrolling screenshot.
[0007] In a possible implementation, generating a second virtual sliding event for triggering the first application to scroll and display content in the first scrollable area includes: updating the first virtual sliding event to obtain the second virtual sliding event.
[0008] By adopting the above technical solution, by updating the virtual sliding event, another virtual sliding 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 a possible implementation, updating the first virtual sliding event includes: updating the touch point coordinates corresponding to each touch event in the first virtual sliding event.
[0010] By adopting the above technical solution, by updating the touch point coordinates corresponding to each touch event in the virtual sliding event, another virtual sliding event can be obtained to simulate touch sliding at different positions of the first scrollable area in the application interface, so as to try to scroll the content of the first scrollable area in the application interface again.
[0011] In one possible implementation, updating the touch point coordinates corresponding to each touch event in the first virtual sliding event includes: determining the Y coordinate in the touch point coordinates based on a preset coordinate system, where the Y axis in the preset coordinate system is determined according to the vertical direction of the display screen of the terminal device; updating the Y coordinate corresponding to each touch event in the first virtual sliding event.
[0012] By adopting the above technical solution, by updating the Y coordinate corresponding to each touch event in the virtual sliding event, another virtual sliding event can be obtained to simulate sliding up or down at different positions of the first scrollable area in the application interface, so as to try to scroll the content of the first scrollable area in the application interface again.
[0013] In one possible implementation, the first virtual sliding event is updated to obtain the second virtual sliding event, including: updating the distance between the press (DOWN) event in the first virtual sliding event and the center point of the first scrollable area to obtain the second virtual sliding event, wherein the first distance between the DOWN event in the first virtual sliding event and the center point of the first scrollable area is greater than the second distance between the DOWN event in the second virtual sliding event and the center point.
[0014] By adopting the above technical solution, by updating the distance between the DOWN event in the first virtual sliding event and the center point of the first scrollable area, a touch sliding is simulated at a position closer to the center point of the first scrollable area in the application interface. For the first scrollable area, the possibility of other non-scrollable content / intersection with the non-scrollable area at a position closer to the center point is relatively lower, thereby increasing the possibility of the screenshot application successfully scrolling to display 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 sliding event include a first Y coordinate, the touch point coordinates corresponding to the DOWN event in the second virtual sliding 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, the first Y coordinate to the third Y coordinate are all Y coordinates in a preset coordinate system, and the Y axis in the preset coordinate system is determined based on the vertical direction of the display screen of the terminal device.
[0016] By adopting the above technical solution, by updating the distance in the Y-axis direction between the DOWN event in the first virtual sliding event and the center point of the first scrollable area, a touch sliding is simulated at a position closer to the middle area of the first scrollable area in the application interface. For the first scrollable area, the possibility of other non-scrollable content / intersection with the non-scrollable area at a position closer to the middle area is relatively lower, thereby increasing the possibility of the screenshot application successfully scrolling to display the content of the first scrollable area in the application interface.
[0017] In a possible implementation, updating the first virtual sliding event includes: updating the first virtual sliding event when the number of updates of the first virtual sliding event is less than or equal to a first preset value.
[0018] By adopting the above technical solution, it is possible to implement scrolling attempts within a preset number of times on the scrollable area of the application interface, thereby avoiding device downtime due to failure in scrolling screenshots.
[0019] In one possible implementation, the screenshot method also includes: when the number of updates of the first virtual sliding event is greater than a first preset value, searching for a second scrollable area in the application interface; and generating a third virtual sliding event for triggering the first application to scroll and display the content of the second scrollable area.
[0020] By adopting the above technical solution, when a scrollable area in the application interface fails to scroll after a preset number of attempts, an attempt is made to find other scrollable areas of the application interface to perform a scrolling screenshot, thereby increasing the possibility of the terminal device successfully performing a scrolling screenshot.
[0021] In one possible implementation, the screenshot method also includes: when the third virtual sliding event does not trigger the scrolling display of the content of the second scrollable area, generating a fourth virtual sliding event for triggering the first application to scroll the display of the content of the second scrollable area, wherein the touch point coordinates included in the fourth virtual sliding event are different from the touch point coordinates included in the third virtual sliding event.
[0022] By adopting the above technical solution, by injecting virtual sliding events with different touch point coordinates into the screenshot application, touch sliding at different positions of the second scrollable area in the application interface can be simulated, which can increase the possibility of the screenshot application successfully scrolling to display the content of the second scrollable area in the application interface, and thus increase the possibility of the terminal device successfully performing a scrolling screenshot.
[0023] In a possible implementation, the screenshot method further includes: when the update count of the first virtual sliding event is greater than a first preset value and the second scrollable area is not found, calling a preset scrolling algorithm to scroll the content of the first scrollable area.
[0024] By using the above technical solution, if scrolling of a scrollable area in an application interface fails after a preset number of attempts and no other scrollable areas exist, the preset scrolling algorithm is invoked to scroll the contents of the first scrollable area. This can increase the likelihood that the captured application will successfully scroll and display the contents of the first scrollable area in the application interface, thereby increasing the likelihood that the terminal device will successfully perform 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, when the number of updates of the first virtual sliding event is greater than a first preset value and the number of searches for the scrollable area in the application interface is less than or equal to a second preset value, the second scrollable area in the application interface is searched.
[0026] By adopting the above technical solution, it is possible to search the scrollable area of the application interface within a preset number of times, thereby avoiding the device from crashing due to failure in scrolling screenshots.
[0027] In one possible implementation, the screenshot method also includes: when the number of updates of the first virtual sliding 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] Using the above technical solution, if each scrollable area in the application interface fails to scroll after a preset number of attempts, the preset scrolling algorithm is invoked to scroll the content of the first scrollable area. This can increase the likelihood that the captured application will successfully scroll and display the content of the first scrollable area in the application interface, thereby increasing the likelihood that the terminal device can successfully perform 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, when the first virtual sliding event does not trigger the scrolling display of the content of the first scrollable area, a second virtual sliding event is generated to trigger the first application to scroll the display of the content of the first scrollable area, including: when the first virtual sliding event does not trigger the scrolling display of the content of the first scrollable area, reducing the touch area of the first scrollable area; and generating the second virtual sliding event based on the reduced touch area of the first scrollable area.
[0030] By adopting the above technical solution, when the first scrollable area in the application interface fails to scroll after a preset number of attempts, by reducing the touch area of the first scrollable area and updating the virtual sliding event based on the touch area of the reduced first scrollable area, it is also possible to simulate touch sliding at different positions of the first scrollable area in the application interface, thereby increasing the possibility of the screenshot application successfully scrolling to display the content of the first scrollable area in the application interface, and increasing the possibility of the terminal device successfully performing a scrolling screenshot.
[0031] In a 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 proportion along the Y-axis, where the Y-axis is determined according to the vertical direction of the display screen of the terminal device.
[0032] By adopting the above technical solution, by reducing the touch area of the first scrollable area along the Y-axis direction, a touch sliding is simulated at a position closer to the middle area of the first scrollable area in the application interface. The possibility of non-scrollable content existing at a position closer to the middle area / intersecting with the non-scrollable area is lower, which can increase the possibility of the screenshot application successfully scrolling to display the content of the first scrollable area in the application interface.
[0033] In the second aspect, the present application provides a terminal device, which includes a display screen, a memory and a processor; the display screen and the memory are 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 above-mentioned first aspect and its possible implementation methods.
[0034] In a third aspect, the present application provides a computer-readable storage medium storing computer-readable instructions, which, when executed by a processor, implement the screenshot method of the first aspect and its possible implementation methods.
[0035] In a fourth aspect, the present application provides a computer program product, which includes computer-readable instructions. When the computer-readable instructions are executed by a processor, the screenshot method of the above-mentioned first aspect and its possible implementation methods is implemented.
[0036] In addition, the technical effects brought about by the second to fourth aspects can be found in the descriptions of the methods of each design in the above method section, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic diagram of a possible screenshot scenario provided in an embodiment of the present application;
[0038] Figure 2 is a schematic diagram of another possible screenshot scenario provided by an embodiment of the present application;
[0039] Figure 3 This is a diagram of the software and hardware architecture of a terminal device provided in one embodiment of the present application;
[0040] Figure 4 A schematic diagram of the interaction process between the screenshot application and the screenshot application provided in an embodiment of the present application;
[0041] Figure 5 This is a schematic diagram of a screenshot process of a terminal device performing a scrolling screenshot according to an embodiment of the present application;
[0042] Figure 6 This is a schematic diagram of a process of stitching screenshots obtained by a terminal device according to an embodiment of the present application;
[0043] Figure 7 This is a flowchart of the steps of the screenshot method provided in one embodiment of the present application;
[0044] Figure 8 This is a hardware architecture diagram of a terminal device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0045] The following will describe the technical solutions in the embodiments of this application in conjunction with the drawings in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0046] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of the present 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 the present application should not be interpreted as being more preferred or more advantageous than other embodiments or design schemes. Specifically, the use of words such as "exemplary", "or", and "for example" is intended to present related concepts in a concrete way.
[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of this application are for the purpose of describing specific embodiments only and are not intended to limit this application. It should be understood that, unless otherwise specified in this application, " / " means or. For example, A / B can mean A or B. "And / or" in this application is merely a way to describe the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. "At least one" means one or more. "Multiple" means two or more than two. For example, at least one of a, b or c can mean: a, b, c, a and b, a and c, b and c, a, b and c. It should be understood that the order of the steps shown in the flowcharts herein can be changed, and some can be omitted.
[0048] To facilitate understanding of the various embodiments of this application, first, the technical terms involved in this application are introduced:
[0049] Scrolling screenshot: Also known as multi-page screenshot, it refers to the process of the terminal device capturing the content displayed on the screen multiple times while scrolling the page content displayed on the screen, and stitching the multiple screenshots captured multiple times into a long screenshot.
[0050] User interface (UI): It is the media interface for interaction and information exchange between applications or operating systems and users. It converts information between its internal form and a user-friendly form. A user interface is source code written in a specific computer language, such as Java or Extensible Markup Language (XML). This source code is parsed and rendered on the terminal device, ultimately presenting it as user-readable content. A common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operations displayed graphically. It can be visual interface elements such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, and so on, displayed on the terminal device's display.
[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, and cloud desktop applications.
[0052] To facilitate users in capturing long screenshots, terminal devices typically support scrolling screenshots. For scrollable interface elements, screenshot applications installed on the terminal device can be used to capture these scrollable elements and create a long image. Screenshot applications typically simulate scrolling events to achieve scrolling of interface elements. This approach can result in the interface elements not automatically scrolling, causing scrolling screenshots to fail and impacting the user experience.
[0053] In view of this, an embodiment of the present application provides a screenshot method to solve the problem that scrollable interface elements cannot automatically scroll in a scrolling screenshot scenario, thereby effectively improving the success rate of scrolling screenshots.
[0054] like Figure 1 As shown, a screenshot scenario provided in an embodiment of the present application includes a terminal device 100. The terminal device can be a device with a display function, and the present embodiment does not limit the device type of the terminal device 100. For example, the terminal device 100 can be a mobile phone, a tablet computer, a personal computer, a smart wearable device, etc.
[0055] Figure 1 Taking the terminal device 100 as 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 for implementing a screenshot function. The embodiment of the present application 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 interface currently displayed on the display screen of the terminal device 100 is the first interface 21 of the instant messaging application.
[0057] The user can double-click with the knuckles, or press the power button and the volume down button at the same time to trigger the screenshot of the first interface 21. Figure 1 As shown, when the user double-clicks the display screen with a knuckle, or the user presses the power button and the volume down button at the same time, the display screen may display the second interface 22, which partially overlaps 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 captured page through a preset application. The second control 223 may be a "scrolling screenshot" control, which is used to perform a scrolling screenshot.
[0058] Taking the second control 223 as a "scrolling screenshot" control as an example, if the user clicks on the second control 223, a scrolling screenshot of the first interface 21 can be triggered. The screenshot application can respond to the click operation on the second control 223 by inputting a virtual sliding event to the instant messaging application to simulate the user sliding on the first interface, causing the first interface to scroll. The screenshot application obtains multiple screenshots by taking a screenshot of the scrolling first interface, and then synthesizes the multiple screenshots in the order of screenshots to obtain a long screenshot. The embodiment of the present application does not limit the timing of synthesizing the screenshot images obtained by screenshots. It can be after a new screenshot image is obtained by screenshot, that is, it is synthesized with the screenshot image obtained by the previous screenshot or synthesized with the result of the previous image synthesis, or it can be after all screenshot images are captured, and then all screenshot images are synthesized in the order of screenshots.
[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, the user can also trigger a screenshot of the first interface 21 by clicking the screenshot icon in the control center.
[0061] Taking the first interface 21 of an instant messaging application as an example, the terminal device 100 may, in response to a user swiping down from the top of the display, open the control center 23. The control center 23 displays a "Screenshot" icon and a "Screenshot" button. The "Screenshot" icon is used to take a single-page screenshot. In response to a click on the "Screenshot" button, the terminal device 100 may 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 may be a "Screenshot" control, which is used to take a single-page screenshot, such as a single-page screenshot of the first interface 21. The fourth control 242 may be a "Partial Screenshot" control, which is used to take a screenshot of any closed shape, such as a screenshot of any closed shape (drawn by the user) of the first interface 21. The fifth control 243 may be a "Scrolling Screenshot" control, which is used to take a scrolling screenshot, such as a scrolling screenshot of the first interface 21.
[0062] For example, if the fifth control 243 is a "scrolling screenshot" control, a user clicking the fifth control 243 can trigger a scrolling screenshot of the first interface 21. In response to the click operation on the fifth control 243, the screenshot application can input a virtual sliding event to the instant messaging application to simulate the user sliding on the first interface, causing the first interface 21 to scroll. For example, the screenshot application can capture the scrolling first interface to obtain multiple screenshots, and then combine the multiple screenshots in the order of the screenshots to form a long screenshot.
[0063] In order to more clearly understand the implementation details of the above screenshot method on the terminal device, Figure 3 and Figure 4 Let's introduce the process of the various software and hardware components in the terminal device cooperating to implement the above screenshot method. The details are as follows:
[0064] The operating system of the terminal device can adopt a layered architecture, event-driven architecture, micro-kernel architecture, micro-service architecture, or cloud architecture. The embodiment of this application takes the Android system with a layered architecture 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 distinct roles and divisions of labor. Layers communicate with each other through software interfaces. Taking the Android system as an example, in some embodiments, the Android system is divided into four layers: the application layer (APK), the application framework layer (Framework), the hardware abstraction layer (HAL), and the kernel layer (Kernel).
[0065] The kernel layer may include drivers associated with the hardware in the hardware layer. The kernel layer may also include programs closely related to the hardware, such as interrupt handlers. The kernel layer may also include basic, common, and high-frequency modules, such as clock management modules and process scheduling modules.
[0066] For example, the hardware layer includes a display screen. The kernel layer may include 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 the user's touch operation on the display screen from the touch layer in the display screen.
[0067] The hardware abstraction layer (HAL) abstracts the hardware. For example, it includes a display module and a touch module. The display module abstracts the display panel hardware within the display screen, providing the abstracted display panel for use by the display algorithms in the algorithm library. The touch module abstracts the touch layer within the display screen, providing the abstracted touch layer for use by the touch algorithms in the algorithm library. The HAL may also include a hardware compositing renderer (HWComposer, HWC) for compositing screen display content.
[0068] The application framework layer is used to implement basic algorithms based on the functions of the hardware abstraction layer for the application layer to call. For example, the screenshot algorithm provided in the embodiment of the present application is used to execute the screenshot method provided in the embodiment of the present application, and the touch algorithm is used to generate a screenshot instruction to trigger the screenshot operation of the screenshot application. The screenshot instruction may include a single-page screenshot instruction and a scrolling screenshot instruction. The single-page screenshot instruction is used to trigger the screenshot application to perform a single-page screenshot operation, and the scrolling screenshot instruction is used to trigger the screenshot application to perform a scrolling screenshot operation. The application framework layer may also include a synthesis service (SurfaceFlinger), and SurfaceFlinger can call HWC to synthesize the screen display content.
[0069] In some embodiments, the screenshot algorithm may include an accessibility service, an image comparison service, a sliding event injection service, and the like. The accessibility service may be used to identify the scrollable area in the application interface currently displayed by the screenshot application. The image comparison service may be used to compare the screenshot images to determine the repeated areas. The sliding event injection service may be used to generate and send virtual sliding events to the screenshot application. The touch algorithm may include a screen interaction service, an image processing service, an image storage service, and the like. The screen interaction service may generate a screenshot instruction (a single-page screenshot instruction or a scrolling screenshot instruction) in response to the user's screen touch operation. The image processing service may be used to implement functions such as cropping, adding mosaics, and graffiti to the screenshot image. The image storage service may be used to implement saving the screenshot image to a terminal device.
[0070] The application layer can include a series of application packages. For example, an application package may include instant messaging applications, video applications, screenshot applications, and other applications. Instant messaging applications can be applications that support instant messaging and / or instant calling, and video applications can be applications that support video playback. Screenshot applications can be applications that have screenshot functionality, particularly scrolling screenshot functionality. In response to a screenshot instruction, the screenshot application can invoke a screenshot algorithm to perform the screenshot operation and generate an image.
[0071] Please also see Figure 4 , is a schematic diagram of the interaction process between the screenshot application and the screenshot application. The screenshot application can be a video application, instant messaging application, reading application, call application, etc. The embodiment of the present application does not limit the type of the screenshot application.
[0072] 400: The screenshot application displays the first application interface.
[0073] In some embodiments, the display area included in the first application interface can be divided into two parts: a scrollable area and a non-scrollable area. The scrollable area may refer to an area in which the content can change its display position following user operations (e.g., a swipe up or down gesture), while the non-scrollable area may refer to an area in which the content does not change its display position following user operations (e.g., a swipe up or down gesture).
[0074] In some embodiments, based on information about UI elements in the first application interface, it is possible to determine which UI elements in the first application interface are scrollable UI elements, and then determine a scrollable area in the first application interface based on the scrollable UI elements. UI elements may refer to visual elements on the first application interface, such as icons, text, videos, controls, images, etc.
[0075] For example, the scrollable UI elements can be determined by any one of the following two methods: Method 1, the information of the scrollable UI elements contains specific fields, such as "webview", "scrollview", "listview", "recycleview", "contentview" and other fields; Method 2, pre-establish and update the scrollable UI element list corresponding to different application interfaces, which records the scrollable UI elements in the application interface, and then compares the information of the UI elements in the first application interface with the UI element list.
[0076] 401: The screenshot application responds to the scrolling screenshot instruction, searches for a first scrollable area in the first application interface, and uses the first scrollable area as a target scrolling area.
[0077] In some embodiments, the scrolling screenshot instruction can be generated by the terminal device in response to a user operation. For example, the user operation includes an operation for triggering the terminal device to display a "scrolling screenshot" control and an operation for clicking the "scrolling screenshot" control. The operation for triggering the terminal device to display the "scrolling screenshot" control includes but is not limited to double-clicking a finger joint, or pressing the power button and the volume down button at the same time, or clicking the "screenshot" button in the control center, or interacting with a voice assistant, etc.
[0078] In some embodiments, if the first application interface includes a scrollable area, the first scrollable area is the 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 up and down 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 the present application are not limited to this. For example, the screenshot application randomly selects a scrollable area from multiple scrollable areas as the first scrollable area. For 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 may refer to the area where the screenshot application takes a scrolling screenshot of the first application interface this time, and the remaining non-target scrolling areas are equivalent to non-scrolling areas during the process of taking a scrolling screenshot of the first application interface this time.
[0080] 402: The screenshot application generates a virtual sliding event corresponding to the target scrolling area.
[0081] In some embodiments, the virtual sliding event corresponding to the target scrolling area may refer to a virtual sliding event for scrolling the content of the target scrolling area.
[0082] In some embodiments, a virtual sliding event may refer to a sliding event generated by simulating a user sliding operation on a display screen. The content contained in the virtual sliding event is the same as the content contained in the sliding event generated based on the user sliding operation on the display screen, except that the virtual sliding event is not a sliding event generated based on the real sliding operation detected by the display screen. That is, the virtual sliding event, like the real sliding event, can also include a touch event and the touch point coordinates corresponding to the touch event. For example, the virtual sliding event may include a press event (also called a DOWN event), several move events (also called MOVE events), and a release event (also called an UP event).
[0083] The virtual sliding event may also include the touch point coordinates corresponding to each event, for example, the touch point coordinates corresponding to the DOWN event, the touch point coordinates corresponding to each MOVE event, and the touch point coordinates corresponding to the UP event. The number of MOVE events can be set based on the sliding duration of the simulated sliding operation, which is not limited in the embodiments of the present application. A DOWN event may refer to a press event generated when the user's finger begins to touch the display screen, which is usually used to start a new operation or gesture. A MOVE event may refer to a move event generated when the user's finger moves on the display screen, which can be used to track the movement trajectory of the finger and implement functions such as dragging and sliding. An UP event may refer to a release event generated when the user lifts his finger, which is usually used to complete an operation or gesture.
[0084] The embodiments of the present application do not limit the number of virtual sliding events. For example, if one virtual sliding event is used to trigger the scrollable area in the screenshot application to scroll and display one page of screenshot content, the number of virtual sliding events can be multiple, and multiple virtual sliding 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 to the multiple screenshot images.
[0085] 403: The screenshot application sends a virtual slide event to the screenshot application.
[0086] In some embodiments, the screenshot application may be an application that provides a screenshot interface, and the screenshot application provides the screenshot interface so that a screenshot image can be obtained by taking a screenshot through the screenshot application.
[0087] In some embodiments, after generating a virtual sliding event, the screenshot application may send the virtual sliding event to the screenshot application. The screenshot application may respond to the virtual sliding event by refreshing the application interface to achieve a scrolling display effect of the content in the target scrolling area.
[0088] For example, after receiving a virtual sliding event, the screenshot application (the thread of the screenshot application) can draw and render image frames based on the touch point coordinates and touch events in the virtual sliding event. The screenshot application can also send the rendered image frames to SurfaceFlinger, which can call HWC to synthesize the image frames to obtain the application interface to be displayed. The HWC can transmit the application interface to be displayed to the display driver, which can drive the display panel to display the application interface, thereby refreshing the application interface of the screenshot application, so that the human eye can perceive that the content of the target scrolling area of the screenshot application is scrolling.
[0089] 404: The captured application scrolls the content of the target scrolling area in response to the virtual sliding event.
[0090] In some embodiments, the content of the scroll target scroll area can be scrolled upward or downward. Scrolling upward can refer to moving from the bottom of the screen to the top, and scrolling downward can refer to moving from the top of the screen to the bottom. The following description uses the example of scrolling downward in the scroll target scroll area.
[0091] 405: The screenshot application blocks the dynamic content in the first application interface and determines whether the target scrolling area is scrolled successfully.
[0092] In some embodiments, dynamic content may 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. Dynamic content can change in various ways, including, for example, changes in video imagery, image content, color, size, angle, or position.
[0093] Since dynamic content changes over time, it may affect the determination of whether the target scrolling area has been successfully scrolled. By shielding the dynamic content in the first application interface, the accuracy of determining whether the target scrolling area has been successfully scrolled can be improved.
[0094] Dynamic content can also affect the stitching of screenshots. By blocking dynamic content in the first app interface, anomalies can be avoided when stitching screenshots captured from the first app interface. For example, changes in dynamic content may lead to the incorrect judgment that there is no overlap between the first and second screenshots captured at adjacent time points.
[0095] Dynamic content may also affect the identification of scrollable areas. By shielding the dynamic content in the first application interface, it is easier to accurately find other scrollable areas and avoid misidentification of scrollable areas.
[0096] In some embodiments, during the process of scrolling the contents of the target scrolling area, the screenshot application can determine whether the target scrolling area has been successfully scrolled by determining whether the target scrolling area contains new content. For example, the dynamic content in the first application interface is blocked, and when the contents of the target scrolling area begin to scroll, the screenshot application first captures the content displayed in the first application interface to obtain a corresponding first screenshot. The first screenshot is then compared with a second screenshot captured at the next adjacent time point to determine whether the second screenshot contains new content, thereby determining whether the target scrolling area has been successfully scrolled. The new content may refer to content that does not appear in the first screenshot.
[0097] In some embodiments, the screenshot application may also block the dynamic content in the first application interface after determining that the target scrolling area has not been successfully scrolled.
[0098] 406: If the target scrolling area is not scrolled successfully, the screenshot application determines whether the update count of the virtual sliding event is greater than a preset value.
[0099] The embodiments of the present application do 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 has an abnormal operation, or the screenshot application has an abnormal operation, or the touch point coordinates corresponding to the DOWN event in the virtual sliding event do not fall within the target scrolling area.
[0100] For each scrollable area in the first application interface, the screenshot application is set to try a maximum of (preset value + 1) times to input a virtual sliding event to the captured application to try to scroll the content of the scrollable area. The preset value can be set according to actual needs and is not limited in the embodiments of the present application. For example, the preset value is 3, that is, for each scrollable area in the first application interface, the screenshot application tries a maximum of four times to input a virtual sliding event to the captured application to try to scroll the content of the scrollable area.
[0101] In some embodiments, for each scrollable area in the first application interface, the update count may be increased by one each time a virtual sliding event is updated, and the update counts may be accumulated for different scrollable areas respectively.
[0102] In some embodiments, each virtual sliding event input may include the same touch event, and the touch point coordinates included in each virtual sliding event input are different.
[0103] 407: If the update count is less than or equal to the preset value, the screenshot application updates the virtual sliding event.
[0104] It will be appreciated that the touch point coordinates included in the updated virtual slide event are different from the touch point coordinates included in the virtual slide event before the update. After the screenshot application updates the virtual slide event, the screenshot application can send the updated virtual slide event to the captured application, allowing the captured application to once again respond to the received virtual slide event and scroll the content of the target scrolling area. In other words, after executing interaction process 407, the process can jump to interaction process 403.
[0105] Assume that an XY coordinate system is constructed using the display screen of a terminal device. The coordinate system has the lower left corner vertex of the display screen as the origin, the direction of the X axis can refer to the width direction of the display screen, and the direction of the Y axis can refer to the length direction (also called the height direction) of the display screen. Taking the virtual sliding event of a downward sliding event as an example, the virtual sliding event can include a DOWN event, n MOVE events, and an UP event, where n is a positive integer. The value of n can be set according to actual needs and is not limited in this embodiment of the present application. For example, the value of n is 3.
[0106] The screenshot application can update the virtual slide event by changing the Y coordinate of the DOWN event in the virtual slide event to obtain an updated virtual slide event. It can be understood that for the virtual slide event before the update, when the Y coordinate of the DOWN event changes, the Y coordinates of each MOVE event and the UP event will also change accordingly. That is, for the virtual slide event before the update and the virtual slide event after the update, the Y coordinates of the DOWN event are different, the Y coordinates of each MOVE event are different, and the Y coordinates of the UP event are also different.
[0107] In some embodiments, changing the Y coordinate of the DOWN event in the virtual sliding event may refer to modifying the Y coordinate of the DOWN event in the virtual sliding event to be closer to the middle area of the first scrollable area. For example, the updated virtual sliding event can be obtained by updating the distance between the DOWN event in the virtual sliding event and the center point of the first scrollable area. The first distance between the DOWN event in the virtual sliding event before the update and the center point of the first scrollable area is greater than the second distance between the DOWN event in the virtual sliding event after the update and the center point, so that the updated DOWN event is closer to the middle area of the first scrollable area. For example, the touch point coordinates corresponding to the DOWN event in the virtual sliding event before the update include the first Y coordinate, the touch point coordinates corresponding to the DOWN event in the updated virtual sliding event include the second Y coordinate, the center point of the first scrollable area corresponds to the 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 coordinates of each touch event in the virtual sliding event can be changed by adjusting the touch area range of the first scrollable area in the Y-axis direction, thereby updating the virtual sliding event. For example, for the first scrollable area, before the touch area adjustment is performed, 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 inwardly along the Y-axis by a preset ratio, and then generating a virtual sliding event based on the reduced touch area of the first scrollable area, the Y coordinate of the DOWN event of the newly generated virtual sliding event can be made 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 the embodiment of the present application is not limited to this. For example, the preset ratio is one-quarter.
[0109] 408: If the update count is greater than a preset value, the screenshot application searches 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 is greater than a preset value, it indicates that after attempting (preset value + 1) times to input a virtual sliding event to the captured application, no scrolling of the target scrolling area has been achieved. In this case, the capturing application may attempt to find another scrollable area in the first application interface that is different from the first scrollable area, and attempt to take a scrolling screenshot of the other scrollable area.
[0111] In some embodiments, the screenshot application may search for other scrollable areas based on the information of the UI element in the first application interface.
[0112] 409: If another scrollable area is found, the screenshot application uses the other scrollable area as the target scrolling area.
[0113] In some embodiments, if another scrollable area is found, the screenshot application may use the other scrollable area as the target scrolling area to attempt to perform a scrolling screenshot of the other scrollable area.
[0114] 410: If another scrollable area is not found, the screenshot application calls a preset scrolling algorithm to scroll the content of the target scrolling area.
[0115] In some embodiments, the preset scrolling algorithm may be The company is The system develops a native scrolling algorithm to scroll the content of the target scrolling area.
[0116] In some embodiments, if another scrollable area is not found, the screenshot application may also exit the scrolling screenshot of the first application interface and may output a preset prompt message, for example, the preset prompt message is a prompt message indicating that the scrolling screenshot failed.
[0117] In some embodiments, the screenshot application may also configure the number of searches for the scrollable area. For example, for each application interface, the screenshot application searches for the scrollable area a maximum of m times. m is a positive integer, and the value of m can be set according to actual needs. The embodiment of the present application does not limit this. For example, m=3. Each time a scrollable area is searched, the number of searches may be increased by one. Before trying to find another scrollable area, it may be determined whether the number of searches is greater than the value of m. If the number of searches is greater than the value of m, the search for the scrollable area is not performed, and the screenshot application may directly call the preset scrolling algorithm to scroll the content of the target scrolling area. If the number of searches is less than or equal to the value of m, the screenshot application searches for another scrollable area, and uses the other scrollable area found as the target scrolling area to attempt to take a scrolling screenshot of the other scrollable area.
[0118] 411: If the target scrolling area is successfully scrolled, the screenshot application captures the content displayed on the first user interface at multiple time points to obtain multiple screenshots.
[0119] In some embodiments, the 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 the height of the target scrolling area. The preset scrolling distance is used to characterize the distance that the content of the target scrolling area scrolls in the scrolling direction from the time the screenshot application takes another screenshot to the time it takes the previous 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 scrolls and displays the content of the target scrolling area in response to a virtual sliding event. When the scrolling distance of the content of 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, one-half, etc. 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 and captures the first application interface I1. Assume that the height of the scrollable area 101 is H1 and the preset scrolling distance is 3 / 4*H1. Figure 5 As shown in (a) of FIG, the screenshot application captures the content displayed on the first user interface at the first time point to obtain the first screenshot image I11. Figure 5 As shown in (b), at a second time point after the first time point, the scrolling distance of the content in the target scrolling area reaches a preset scrolling distance, and the screenshot application captures the content displayed on the first user interface to obtain a second screenshot image I12. Similarly, at the i-th time point after the i-1th time point, the scrolling distance of the content in the target scrolling area reaches a 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 for the screenshot application to capture the last screenshot image may be triggered by the user's operation of ending scrolling screenshots, or it may be triggered by the situation that the content of the target scrolling area has scrolled to the bottom. That is, the timing for capturing the last screenshot image is not determined by detecting whether the scrolling distance of the content of the target scrolling area has reached the preset scrolling distance, but is captured when the user's operation of ending scrolling screenshots is received, or when it is detected that the content of the target scrolling area has scrolled to the bottom. Figure 5As shown in (c), the screenshot application captures the content displayed on the first user interface, and obtains the third screenshot image I13. The third screenshot image I13 is captured 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 the target scrolling area has been scrolled to the bottom based on the UI elements in the content displayed in the target scrolling area. For example, when the screenshot application recognizes that there are no other UI elements below the bottom UI element in the content currently displayed in the target scrolling area, the screenshot application can determine that the target scrolling area has been 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 to have scrolled to the bottom, the screenshot application can capture the content displayed by the first user interface to obtain a screenshot. If the scrolling distance does not reach the preset scrolling distance, the content displayed by the current target scrolling area can be called valid page content. The target scrolling area continues to scroll the valid page content upward, and the bottom of the valid page content is filled with blank page content. After the scrolling distance reaches the preset scrolling distance, the screenshot application can capture the content displayed by the first user interface again to obtain another screenshot. The screenshot application can perform a similarity comparison of the valid page content in the two screenshots. When 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 shield the dynamic content in the first application interface after determining that the target scrolling area has been successfully scrolled, so as to avoid different dynamic contents in multiple screenshots.
[0125] 412: The screenshot application stitches together the multiple screenshots to obtain a long screenshot.
[0126] In some embodiments, during the process of stitching screenshots, the screenshot application may crop part of the content in the screenshot, and then stitch the cropped screenshots together using a head-to-tail stitching method to obtain a long screenshot.
[0127] For example, for two screenshots captured by a screenshot application at adjacent time points, the screenshot application needs to crop the content containing repeated areas to avoid the appearance of repeated content areas in the long screenshot obtained by splicing, that is, the repeated areas of the two adjacent screenshots overlapping. For a first screenshot and a second screenshot captured at adjacent time points, the screenshot application can crop the second screenshot, and the content cropped from the second screenshot is the content containing the repeated area with the first screenshot. The first screenshot and the cropped second screenshot are then spliced end to end.
[0128] In some embodiments, the screenshot application can compare pixels between two screenshots taken at adjacent time points and determine the overlapped and non-overlapped regions based on the comparison results. The screenshot application can also determine the overlapped and non-overlapped regions based on the scrolling distance of the content in the target scrolling region between the two screenshots taken at adjacent time points.
[0129] In some embodiments, the overlapping area may refer to an overlapping area within the target scrolling area.
[0130] like Figure 6 As shown, it illustrates a schematic diagram of the stitching process of the screenshot application stitching a long screenshot image based on the repeated areas of adjacent screenshot images. Figure 6 The screenshot shown in (c) is a screenshot captured in response to the user's operation of ending scrolling screenshots. Figure 6 (a) Figure 6 The overlapping area of the two screenshots shown in (b) is area 601, and 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 to achieve the splicing of the two screenshots. Figure 6 Middle (b), Figure 6 The overlapping area of the two screenshots shown in (c) is area 602, and the terminal device can Figure 6 The screenshot shown in (b) is the same as Figure 6 The screenshot areas 602 shown in (c) overlap to achieve the splicing of the two screenshots. Figure 6 Medium (a) to Figure 6 The screenshots shown in (c) are stitched together to form Figure 6 The long screenshot shown in (d).
[0131] In some embodiments, each virtual slide event can be used to control the scrolling of the content in the target scrolling area by a preset scrolling distance. After completing a screenshot operation, the screenshot application can send the next virtual slide event to the captured application. If the screenshot application uses a capture-while-splitting mode, if the splicing fails, the screenshot application can stop sending virtual slide events to the captured application. The screenshot application then exits the scrolling screenshot of the first application interface and may output a prompt indicating that the scrolling screenshot failed.
[0132] like Figure 7As shown, the screenshot method provided by the embodiment of the present application can be applied to a terminal device, and the terminal device can be installed with a screenshot application and a screenshot application. The screenshot application can be an application that provides a screenshot interface, and the screenshot application provides a screenshot interface so that a screenshot image can be obtained by taking a screenshot through the screenshot application. The screenshot method may include the following steps:
[0133] S71: In response to a first operation of the user, displaying an application interface of the screenshot application, where the application interface includes one or more scrollable areas.
[0134] In some embodiments, if the terminal device has not opened the captured application, the first operation may be an operation to open the captured application and display the application interface of the captured application (for example, a click operation). If the terminal device has opened the captured application, the first operation may be an operation to display a specified application interface of the captured application.
[0135] S72: In response to a second operation of the user, a first virtual sliding event is generated, where the first virtual sliding event 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 an operation that triggers the terminal device to generate a scrolling screenshot instruction. For example, the second operation may include an operation for triggering the terminal device to display a "scrolling screenshot" control and an operation for clicking the "scrolling screenshot" control. The operation for triggering the terminal device to display the "scrolling screenshot" control includes but is not limited to double-clicking a finger joint, or pressing the power button and the volume down button at the same time, or clicking the "screenshot" button in the control center, or interacting with a voice assistant.
[0137] S73: When the first virtual sliding event does not trigger the scrolling display of the content of the first scrollable area, a second virtual sliding event is generated to trigger the first application to scroll the content of the first scrollable area, and the touch point coordinates included in the second virtual sliding event are different from the touch point coordinates included in the first virtual sliding event.
[0138] In some embodiments, generating the second virtual sliding event for triggering the first application to scroll and display the content of the first scrollable area may include: updating the first virtual sliding event to obtain the second virtual sliding event.
[0139] For example, the second virtual sliding event is obtained by updating the touch point coordinates corresponding to each touch event in the first virtual sliding event. Specifically, the Y coordinate of 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 sliding event is updated. The Y axis in the preset coordinate system is determined based on the vertical direction of the terminal device's display screen. For example, the preset coordinate system can be the aforementioned XY coordinate system constructed based on the terminal device's display screen.
[0140] In some embodiments, the second virtual sliding event can be obtained by updating the distance between the DOWN event in the first virtual sliding event and the center point of the first scrollable area, where the first distance between the DOWN event in the first virtual sliding event and the center point of the first scrollable area is greater than the second distance between the DOWN event in the second virtual sliding event and the center point. For example, the touch point coordinates corresponding to the DOWN event in the first virtual sliding event include a first Y coordinate, the touch point coordinates corresponding to the DOWN event in the second virtual sliding 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 to third Y coordinates are all Y coordinates in a preset coordinate system.
[0141] In some embodiments, if the first virtual slide event does not trigger scrolling of the content in the first scrollable area, a second virtual slide event may be generated based on the reduced touch area of the first scrollable area by reducing the touch area of the first scrollable area. For example, the touch area of the first scrollable area may be reduced inward by a predetermined ratio along the Y-axis.
[0142] In some embodiments, updating the first virtual sliding event may include: updating the first virtual sliding event when the number of updates of the first virtual sliding event is less than or equal to a first preset value.
[0143] In some embodiments, if the number of updates of the first virtual sliding event exceeds a first preset value, the search may continue for a second scrollable area in the application interface, and a third virtual sliding event may be generated to trigger the first application to scroll the content of the second scrollable area. The second scrollable area may be another scrollable area in the application interface of the captured application.
[0144] For the second scrollable area, scrolling may also be attempted up to a preset number of times. Specifically, if the third virtual slide event does not trigger scrolling of the content of the second scrollable area, a fourth virtual slide event is generated to trigger the first application to scroll the content of the second scrollable area, wherein the touch point coordinates included in the fourth virtual slide event are different from the touch point coordinates included in the third virtual slide event.
[0145] In some embodiments, when the number of updates of the first virtual sliding event is greater than a first preset value and the second scrollable area is not found, a preset scrolling algorithm can be directly invoked to scroll the contents 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 can scroll the contents of the scrollable area without injecting virtual sliding events, that is, it can use a different method from the embodiments of the present application to attempt to scroll the contents of the scrollable area.
[0146] In some embodiments, if the number of updates to the first virtual sliding event is greater than a first preset value and the number of searches for the scrollable area in the application interface is less than or equal to a second preset value, a second scrollable area in the application interface is searched. If the number of updates to the first virtual sliding 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 may 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, the content displayed on the application interface at different time points is captured to obtain a plurality of screenshots.
[0148] Taking the scrolling display of a first scrollable area as an example, at a first time point, a screenshot application captures the content displayed on the user interface to obtain a first screenshot image. The first time point may be the time point when the scrolling screenshot begins. After the first time point, the screenshot application scrolls the content of the first scrollable area in response to a virtual slide event. When the scrolling distance of the content of the first scrollable area reaches a preset scrolling distance, the screenshot application again captures the content displayed on the user interface to obtain a 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: Combine multiple screenshots into a long screenshot.
[0150] After capturing multiple screenshots, you can crop part of the screenshots and then stitch the cropped screenshots together to get a long screenshot.
[0151] See Figure 8As shown, the terminal device 100 involved in the embodiment of the present application is introduced below. The terminal device 100 in the embodiment of the present 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) device and other devices including a display screen. The embodiment of the present application does not impose any special restrictions on the specific form of the terminal device. Please refer to Figure 8 , Figure 8 It is a structural diagram of the terminal device 100 provided in an embodiment of the present application.
[0152] The 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, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0153] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0154] In addition, operating systems run on the above components, such as the iOS operating system developed by Apple, the Android open source operating system developed by Google, and the Windows operating system developed by Microsoft.
[0155] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0156] For example, the processor 110 may be configured to execute the aforementioned screenshot method to implement scrolling screenshots in response to user operations.
[0157] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use these instructions or data again, it can directly access them from the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0158] In some embodiments, the processor 110 may include one or more interfaces. The 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.
[0159] The wireless communication function of the terminal device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0160] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0161] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the terminal device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0162] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the terminal device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0163] In some embodiments, the antenna 1 of the terminal device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the terminal device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0164] The terminal device 100 implements display functions through a GPU, display screen 194, and an application processor. The GPU is a microprocessor for image processing that connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that 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 or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, 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. Among them, the display screen 194 in the embodiment of the present application can be a touch screen. That is, the touch sensor 180K is integrated into the display screen 194.
[0166] The internal memory 121 may include one or more random access memories (RAMs) and one or more non-volatile memories (NVMs). RAMs may include static random access memories (SRAMs), dynamic random access memories (DRAMs), synchronous dynamic random access memories (SDRAMs), and double data rate synchronous dynamic random access memories (DDR SDRAMs, such as the fifth generation DDR SDRAM, generally referred to as DDR5 SDRAMs). NVMs may include disk storage devices and flash memories.
[0167] Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH according to the operating principle, single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC) according to the potential level of the storage cell, and universal flash storage (UFS) and embedded multi-media card (eMMC) according to the storage specification.
[0168] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data.
[0169] The non-volatile memory may also store executable programs and user and application data, etc., and may be loaded into the random access memory in advance for direct reading and writing by the processor 110 .
[0170] The external memory interface 120 can be used to connect to an 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 implement a data storage function.
[0171] The screenshot methods in the above embodiments can all be implemented in the terminal device 100 having the above hardware structure.
[0172] This embodiment also provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on the terminal device 100, the terminal device 100 executes the above-mentioned related method steps to implement the screenshot method in the above-mentioned embodiment.
[0173] This embodiment further provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the screenshot method in the above-mentioned embodiment.
[0174] This embodiment also provides a chip system, which is coupled to a memory. The chip system is used to read and execute a computer program stored in the memory to implement the screenshot method in the above embodiment.
[0175] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned 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 devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0177] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0178] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0179] If the integrated unit is implemented in the form of 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 solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0180] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A screenshot method, applied to a terminal device, characterized in that: The method comprises: In response to a first operation by a user, displaying an application interface of a first application, wherein the application interface includes one or more scrollable areas; In response to a second operation of the user, generating a first virtual sliding event, where the first virtual sliding event is used to trigger the first application to scroll and display content of a first scrollable area in the application interface; If the first virtual sliding event does not trigger scrolling display of the content of the first scrollable area, generating a second virtual sliding event for triggering the first application to scroll display the content of the first scrollable area, wherein the touch point coordinates included in the second virtual sliding event are different from the touch point coordinates included in the first virtual sliding event; During the process of scrolling the content of the first scrollable area, capturing the content displayed on the application interface at multiple time points to obtain multiple screenshots; The multiple screenshots are stitched together into a long screenshot.
2. The screenshot method according to claim 1, wherein: The generating of the second virtual sliding event for triggering the first application to scroll and display the content of the first scrollable area includes: The first virtual sliding event is updated to obtain the second virtual sliding event.
3. The screenshot method according to claim 2, wherein: The updating of the first virtual sliding event includes: Update the touch point coordinates corresponding to each touch event in the first virtual sliding event.
4. The screenshot method according to claim 3, wherein: The updating of the touch point coordinates corresponding to each touch event in the first virtual sliding event includes: Determine the Y coordinate of the touch point coordinates based on a preset coordinate system, where 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 sliding event.
5. The screenshot method according to claim 2, wherein: The updating of the first virtual sliding event to obtain the second virtual sliding event includes: Update the distance between the DOWN event in the first virtual sliding event and the center point of the first scrollable area to obtain the second virtual sliding event, wherein the first distance between the DOWN event in the first virtual sliding event and the center point of the first scrollable area is greater than the second distance between the DOWN event in the second virtual sliding event and the center point.
6. The screenshot method according to claim 5, wherein: The touch point coordinates corresponding to the DOWN event in the first virtual sliding event include a first Y coordinate, the touch point coordinates corresponding to the DOWN event in the second virtual sliding 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, the first Y coordinate to the third Y coordinate are all Y coordinates in a preset coordinate system, and 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 according to claim 2, wherein: The updating of the first virtual sliding event includes: When the update number of the first virtual sliding event is less than or equal to a first preset value, the first virtual sliding event is updated.
8. The screenshot method according to claim 2, wherein: The method further comprises: When the update count of the first virtual sliding event is greater than a first preset value, searching for a second scrollable area in the application interface; A third virtual sliding event is generated for triggering the first application to scroll and display the content of the second scrollable area.
9. The screenshot method according to claim 8, wherein: The method further comprises: In the case that the third virtual sliding event does not trigger the scrolling display of the content of the second scrollable area, a fourth virtual sliding event is generated to trigger the first application to scroll the content of the second scrollable area, wherein the touch point coordinates included in the fourth virtual sliding event are different from the touch point coordinates included in the third virtual sliding event.
10. The screenshot method according to claim 8, wherein: The method further comprises: When the update number of the first virtual sliding event is greater than the first preset value and the second scrollable area is not found, a preset scrolling algorithm is called to scroll the content of the first scrollable area.
11. The screenshot method according to claim 8, wherein: The searching for a second scrollable area in the application interface when the update count of the first virtual sliding event is greater than a first preset value includes: When the number of updates of the first virtual sliding 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 a second preset value, search for a second scrollable area in the application interface.
12. The screenshot method according to claim 11, wherein: The method further comprises: When the number of updates of the first virtual sliding 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 called to scroll the content of the first scrollable area.
13. The screenshot method according to claim 1, wherein: The generating, when the first virtual sliding event does not trigger scrolling display of the content of the first scrollable area, a second virtual sliding event for triggering the first application to scroll and display the content of the first scrollable area includes: In a case where the first virtual sliding event does not trigger scrolling display of the content of the first scrollable area, reducing the touch area of the first scrollable area; The second virtual sliding event is generated based on the reduced touch area of the first scrollable area.
14. The screenshot method according to claim 13, wherein: The reducing the touch area of the first scrollable area includes: The touch area of the first scrollable area is reduced inwardly by a preset ratio along the Y-axis direction, where 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 according to 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, and when the computer-readable instructions are executed by a processor, the screenshot method according to any one of claims 1 to 14 is implemented.
17. A computer program product comprising computer-readable instructions, characterized in that: When the computer-readable instructions are executed by a processor, the screenshot method according to any one of claims 1 to 14 is implemented.
Citation Information
Patent Citations
Screen capturing method and device
CN106325745A
Screen capture method and device, electronic equipment and computer readable medium
CN110597439A
Scroll screen capture method and electronic equipment
CN110764673A
Operation monitoring method, program updating method, terminal, server and electronic equipment
CN117909197A
Long screen capture implementation method and system based on Android operating system, and storage medium
CN118092753A