Scrolling screenshot capturing method, electronic device and computer-readable storage medium

By identifying the cumulative scrolling distance and height of the scrolling view control, the problem of long scrolling screenshot time and low accuracy in the existing technology is solved, and the effect of accurately stitching long screenshots is achieved in the presence of dynamic elements.

WO2025261291A1PCT designated stage Publication Date: 2025-12-26HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/101137
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-06-20
Filing Date
2025-06-16
Publication Date
2025-12-26

AI Technical Summary

Technical Problem

In existing technologies, when electronic devices take scrolling screenshots, the image recognition algorithm takes a long time to identify repeated areas and is not very accurate, especially when there are dynamic elements, it is difficult to accurately stitch together long screenshots.

Method used

By identifying the cumulative scroll distance and height of the scroll view control, the overlapping area between two screenshots is determined. The cumulative scroll distance and height of the scroll view control are used to accurately identify the overlapping area and then crop and stitch it together.

Benefits of technology

It improves the success rate of scrolling screenshots, enhances the user experience, and ensures accurate stitching of long screenshots even when dynamic elements are present.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025101137_26122025_PF_FP_ABST
    Figure CN2025101137_26122025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are a scrolling screenshot capturing method, an electronic device and a computer-readable storage medium. On the basis of the difference between cumulative scrolling distances of a scroll view control in two consecutive screenshot captures and the height of the scroll view control, an electronic device can determine the height of an overlapping area in a page scrolling region of a long page between the two adjacent screenshot captures. Furthermore, on the basis of the height of the overlapping area, the electronic device can remove, by means of cropping, the overlapping area on one of images obtained from the two adjacent screenshot captures. Then, the electronic device can stitch the images, from which the overlapping area has been removed by means of cropping, so as to obtain a long screenshot. It can be seen that cumulative scrolling distances of the scroll view control and the height of the scroll view control can be unambiguously determined. Therefore, regardless of whether there are dynamic elements on a page, on the basis of the scrolling distances of the view control, the electronic device can accurately identify an overlapping area between pictures obtained from two adjacent screenshot captures. Therefore, the success rate of scrolling screenshot capturing can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

A scrolling screenshot method, an electronic device, and a computationally readable storage medium

[0001] This application claims priority to Chinese Patent Application No. 202410805805.7, filed on June 20, 2024, entitled "A Scrolling Screenshot Method, Electronic Device and Computationally Readable Storage Medium", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of terminal technology, and in particular to a scrolling screenshot method, an electronic device, and a computationally readable storage medium. Background Technology

[0003] Due to the limited screen size of electronic devices such as mobile phones and tablets, they cannot display all the content of a long page at once. Instead, they can display different portions of the long page in response to swiping up or down on the screen. When a user wants to capture a screenshot of the entire long page, the device can use a scrolling screenshot function to capture the entire page, satisfying the user's need to capture long screenshots that exceed the screen height.

[0004] During scrolling screenshots, electronic devices can scroll the page and take multiple screenshots. Adjacent screenshots may contain overlapping areas. The electronic device needs to crop out the overlapping areas from one of the adjacent screenshots before stitching the images together. Currently, electronic devices often use image recognition algorithms to identify these overlapping areas. However, this method is time-consuming and its accuracy needs improvement. Summary of the Invention

[0005] This application provides a scrolling screenshot method, an electronic device, and a computationally readable storage medium. The electronic device can identify the scroll view control on the page each time a screenshot is taken and record the cumulative scroll distance of the scroll view control. By using the height of the scroll view control and the cumulative scroll distance of the scroll view control obtained in two consecutive screenshots, the overlapping area of ​​the screenshot images obtained in the two consecutive screenshots can be determined.

[0006] In a first aspect, this application provides a scrolling screenshot method. The method includes: an electronic device displaying a first user interface of a first application, the first user interface including first page content of a first long page of the first application; the electronic device acquiring a first cumulative scroll distance of a first scroll view control in the first user interface; the electronic device acquiring a first screenshot image of the first user interface; the electronic device scrolling the first long page and displaying a second user interface of the first application, the second user interface including second page content of the first long page, the second page content and the first page content having a first overlapping area; the electronic device acquiring a second cumulative scroll distance of the first scroll view control in the second user interface; the electronic device acquiring a second screenshot image of the second user interface; the electronic device determining the first overlapping area based on the height of the first scroll view control, the first cumulative scroll distance and the second cumulative scroll distance; and the electronic device obtaining a first long screenshot based on the first screenshot image, the second screenshot image and the first overlapping area.

[0007] Optionally, in addition to obtaining the first cumulative scroll distance of the first scroll view control, other interface layout information of the first user interface can also be obtained, such as any one or more of the following: the positional relationship of multiple view controls in the first user interface, the name of the view control, the type of the view control, and the elements displayed in the view control. For example, the positional relationship of multiple view controls can be similar to the positional relationship of multiple view controls shown in Figure 3.

[0008] Optionally, in addition to obtaining the second cumulative scroll distance of the first scroll view control, other interface layout information of the second user interface can also be obtained, such as any one or more of the following: the positional relationship of multiple view controls in the second user interface, the name of the view control, the type of the view control, and the elements displayed in the view control. For example, the positional relationship of multiple view controls can be similar to that shown in Figure 3.

[0009] Optionally, the cumulative scroll distance of the first long page can be used as the cumulative scroll distance of the first scroll view control. When the first long page scrolls in the first direction, the cumulative scroll distance of the first scroll view control can be added to the scroll distance of the first long page at this time. When the first long page scrolls in the second direction, the cumulative scroll distance of the first scroll view control needs to be subtracted from the scroll distance of the first long page at this time.

[0010] Optionally, whenever the user interface displayed by the first application changes, such as when the cumulative scroll distance of the first long page changes each time it is scrolled, the class scroll distance of the first scroll view control will also change.

[0011] Using this method, electronic devices can identify the scroll view control on the page each time a screenshot is taken, and record the cumulative scroll distance of the scroll view control. By using the height of the scroll view control and the cumulative scroll distance of the scroll view control obtained from two consecutive screenshots, the overlapping area of ​​the screenshot images obtained from the two consecutive screenshots can be determined.

[0012] The cumulative scroll distance of the aforementioned scroll view control is unambiguous and unaffected by changes in the displayed content of dynamic elements. Therefore, regardless of the presence of dynamic elements on the page, electronic devices can accurately identify overlapping areas in adjacent screenshots based on the cumulative scroll distance of the scroll view control. This method improves the success rate of scrolling screenshots and enhances the user experience of the scrolling screenshot function.

[0013] In conjunction with the first aspect, in one possible implementation, the electronic device determines the first repeating area based on the height of the first scroll view control, the first cumulative scroll distance, and the second cumulative scroll distance. Specifically, this includes: the electronic device calculating the difference between the first cumulative scroll distance and the second cumulative scroll distance to obtain the first distance of scrolling the first long page; the electronic device determining the height of the first repeating area based on the difference between the height of the first scroll view control and the first distance; and the electronic device determining the first repeating area based on the height of the first repeating area.

[0014] In this way, by using the height of the scroll view control and the cumulative scroll distance of the scroll view control obtained from the two screenshots, the height of the overlapping area of ​​the screenshot images obtained from the two screenshots is determined, and then the overlapping area of ​​the screenshot images obtained from the two screenshots is determined based on the height of the overlapping area.

[0015] In conjunction with the first aspect, in one possible implementation, before acquiring the first screenshot image of the first user interface, the method further includes: the electronic device receiving an operation to enable long screenshot; the electronic device acquiring the first screenshot image of the first user interface specifically includes: in response to the operation to enable long screenshot, the electronic device acquiring the first screenshot image of the first user interface.

[0016] For example, the operation to enable a long screenshot can be a preset gesture, such as drawing an "S" shape on the first user interface.

[0017] In conjunction with the first aspect, in one possible implementation, the electronic device obtains a first long screenshot based on a first screenshot image, a second screenshot image, and a first overlapping area. Specifically, this includes: the electronic device cropping out the overlapping area in the content of the first page and stitching the processed first page content and the second screenshot image together to obtain the first long screenshot; or, the electronic device cropping out the overlapping area in the content of the second page and stitching the first screenshot image and the processed second page content together to obtain the first long screenshot.

[0018] In conjunction with the first aspect, in one possible implementation, the areas in the first and second user interfaces other than the page scrolling area are non-scrolling areas. These non-scrolling areas include a top fixed area and / or a bottom fixed area. The page scrolling area is located below the top fixed area and above the bottom fixed area. The electronic device crops out the repetitive areas in the first page content and stitches the processed first page content and the second screenshot image together to obtain a first long screenshot. Specifically, this includes: the electronic device crops out the repetitive areas in the first page content and stitches the first long screenshot sequentially according to the top fixed area, the processed first page content, the second page content, and the bottom fixed area; or, the electronic device crops out the repetitive areas in the second page content and stitches the first long screenshot based on the first screenshot image and the processed second page content. Specifically, this includes: the electronic device crops out the repetitive areas in the second page content and stitches the first long screenshot sequentially according to the top fixed area, the first page content, the processed second page content, and the bottom fixed area. In this way, the electronic device can stitch two screenshot images obtained from previous and subsequent screenshots to obtain a long screenshot, ensuring that the repetitive areas appear only once in the long screenshot.

[0019] In conjunction with the first aspect, in one possible implementation, the electronic device includes a first application, a scrolling screenshot application, and a first system service; the electronic device obtains a first cumulative scroll distance of a first scrolling view control in a first user interface, specifically including: the first application of the electronic device sending the first cumulative scroll distance of the first scrolling view control to the first system service; the scrolling screenshot application of the electronic device obtaining the first cumulative scroll distance of the first scrolling view control from the first system service; the electronic device obtains a second cumulative scroll distance of the first scrolling view control in a second user interface, specifically including: the first application of the electronic device sending the second cumulative scroll distance of the first scrolling view control to the first system service; the scrolling screenshot application of the electronic device obtaining the second cumulative scroll distance of the first scrolling view control from the first system service; the electronic device determines a first repeating area based on the height of the first scrolling view control, the first cumulative scroll distance, and the second cumulative scroll distance, specifically including: the scrolling screenshot application of the electronic device determining the first repeating area based on the height of the first scrolling view control, the first cumulative scroll distance, and the second cumulative scroll distance.

[0020] In some embodiments, the first system service may also be referred to as the accessibility system service.

[0021] Optionally, the first application is not limited to sending the first cumulative scroll distance of the first scroll view control to the first system service, but may also send any one or more of other interface layout information of the first user interface, such as the positional relationship of multiple view controls in the first user interface, the name of the view control, the type of the view control, and the elements displayed in the view control, to the first system service.

[0022] Optionally, the first application is not limited to sending the second cumulative scroll distance of the first scroll view control to the first system service, but may also send any one or more of other interface layout information of the second user interface, such as the positional relationship of multiple view controls in the second user interface, the name of the view control, the type of the view control, and the elements displayed in the view control, to the first system service.

[0023] Optionally, the first application may periodically or irregularly send the user interface layout information to the first system service.

[0024] Optionally, whenever the user interface displayed by the first application changes, the first application needs to send the interface layout information of the changed user interface to the first system service.

[0025] After enabling the long screenshot function, the scrolling screenshot application can obtain the interface layout information of the user interface from the first system service, and then obtain the cumulative scrolling distance of the first scrolling view control from the interface layout information of the user interface, and then calculate the overlapping area of ​​the two screenshot images.

[0026] Optionally, whenever the user interface displayed by the first application changes, the scrolling screenshot application also needs to obtain the interface layout information after the user interface changes from the first system service.

[0027] Using this method, the scrolling screenshot application can obtain the interface layout information of the user interface displayed by the first application through the first system service, and then obtain the cumulative scrolling distance of the first scrolling view control in the user interface displayed by the first application.

[0028] In conjunction with the first aspect, in one possible implementation, before the electronic device scrolls the first long page within the page scrolling area where the first scroll view control is located, the method further includes: the electronic device's scrolling screenshot application sending a second message to the first application, the second message carrying a second distance; in response to the second message, the first application of the electronic device controlling the first long page to scroll in a first direction a first distance within the page scrolling area, the first distance being the same as or different from the second distance, the first distance being equal to the difference between the second cumulative scrolling distance and the first cumulative scrolling distance.

[0029] In this way, after enabling the long screenshot feature, the scrolling screenshot app can control the first app to scroll the first long page. That is, before the first app scrolls the first long page each time, the scrolling screenshot app needs to send a second message to the first app. After receiving the second message, the first app scrolls the first long page again, the scrolling screenshot app captures a screenshot, and then sends the second message to the first app. This process continues until the long screenshot feature is disabled.

[0030] Optionally, a second message can be omitted. With long screenshot functionality enabled, the app taking the scrolling screenshot only needs to send a second message to the first app once. Afterward, the first app can automatically scroll the first long page periodically or at regular intervals.

[0031] In conjunction with the first aspect, in one possible implementation, the type of the first scrolling view control includes any of the following: a linear layout control, a ListView control, a grid view control, a loop view control, a view pagination control, or a webpage control.

[0032] Optionally, when displaying the user interface, the first application can obtain the type of each view control displayed in the user interface. If the type of the first scroll view control among the view controls includes any of the above, the first application can record the cumulative scrolling distance of the first scroll view control in the interface layout information of the user interface.

[0033] In conjunction with the first aspect, in one possible implementation, the scrolling area of ​​the first user interface includes m view controls, and the first scrolling view control is the root view control of (m-1) view controls; the scrolling area of ​​the second user interface includes n view controls, and the first scrolling view control is the root view control of (n-1) view controls.

[0034] Optionally, when displaying the user interface, the first application can also obtain the relationship between the various view controls displayed in the user interface, and obtain the root view control, such as the first scroll view control. If the type of the first scroll view control includes any of the above, the first application can record the cumulative scroll distance of the first scroll view control in the interface layout information of the user interface.

[0035] In conjunction with the first aspect, in one possible implementation, the first screenshot image is the image obtained when the electronic device performs the k-th screenshot, and the first cumulative scroll distance includes the cumulative scroll distance of the previous (k-1) first long pages.

[0036] The second screenshot is the image obtained when the electronic device performs the (k+1)th screenshot. The second cumulative scroll distance includes the cumulative scroll distance of the first long page in the previous k steps.

[0037] In conjunction with the first aspect, in one possible implementation, when the first long page is slid in the first direction, the sliding distance of the first long page is a positive value, and when the first long page is slid in the second direction, the sliding distance of the first long page is a negative value, and the second direction is the opposite of the first direction.

[0038] In conjunction with the first aspect, in one possible implementation, the first long page is scrolled automatically by the electronic device, or the first long page is scrolled by the electronic device in response to an operation for scrolling the first long page.

[0039] In a second aspect, this application provides an electronic device, which includes one or more processors and one or more memories; the one or more memories are coupled to one or more processors, and the one or more memories are used to store computer program code, which includes computer instructions, such that when the one or more processors execute the computer instructions, the electronic device performs any possible implementation method of the first aspect.

[0040] Thirdly, this application provides a computer-readable storage medium including instructions that, when executed on an electronic device, cause the electronic device to perform any of the possible implementations described in the first aspect.

[0041] Fourthly, this application provides a computer program product that may contain computer instructions that, when executed on an electronic device, cause the electronic device to perform any of the possible implementation methods described in the first aspect.

[0042] Fifthly, this application provides a chip for use in an electronic device, the chip including one or more processors for invoking computer instructions to cause the electronic device to perform any of the possible implementation methods in the first aspect.

[0043] For the beneficial effects of aspects two through five, please refer to the description of the beneficial effects in aspect one, which will not be repeated here. Attached Figure Description

[0044] Figure 1A shows a schematic diagram of a long page;

[0045] Figures 1B-1F show schematic diagrams of the first application controlling the scrolling of a long page in a first direction;

[0046] Figure 2 shows a schematic diagram of multiple view controls displayed in a subpage;

[0047] Figure 3 shows a schematic diagram illustrating the relationship between the various view controls in the subpage;

[0048] Figure 4 shows a schematic diagram of a repeating region;

[0049] Figure 5 illustrates a schematic diagram of the hardware structure of the electronic device 100;

[0050] Figure 6 illustrates an exemplary software structure block diagram of the electronic device 100;

[0051] Figure 7 illustrates an example of the interaction between multiple software modules in electronic device 100;

[0052] Figures 8A to 8E exemplarily illustrate a scenario of obtaining a long screenshot image by scrolling through a screenshot according to an embodiment of this application;

[0053] Figures 9A-9J show the UI diagrams of an electronic device 100 that generate a long screenshot based on multiple screenshot images;

[0054] Figure 10A shows a flowchart illustrating how an electronic device 100 obtains a long screenshot after enabling the long screenshot function.

[0055] Figure 10B shows a flowchart illustrating how another electronic device 100 obtains a long screenshot after enabling the long screenshot function;

[0056] Figure 11 shows a flowchart of a scrolling screenshot method. Detailed Implementation

[0057] The technical solutions of the embodiments of this application are described below with reference to the accompanying drawings. In the description of the embodiments of this application, the terminology used in the following embodiments is for the purpose of describing specific embodiments only and is not intended to limit the application. As used in the specification and appended claims of this application, the singular expressions "a," "the," "the," "the," and "this" are intended to also include expressions such as "one or more," unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of this application, "at least one" and "one or more" refer to one or more (including two). The term "and / or" is used to describe the relationship between related objects, indicating that three relationships can exist; for example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship.

[0058] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized. The term "connection" includes direct connections and indirect connections, unless otherwise stated. "First" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated.

[0059] In the embodiments of this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.

[0060] First, the technical terms used in this application will be explained.

[0061] 1. Long pages, subpages of long pages, offset of long pages.

[0062] In some embodiments, if the length of a page exceeds the display area of ​​the electronic device 100's display screen, such a page may be referred to as a long page.

[0063] Optionally, a long page may have a horizontal length that exceeds the width of the display screen of the electronic device 100, and / or a long page may have a vertical length that exceeds the length of the display screen of the electronic device 100.

[0064] The electronic device 100 can only display a portion of the content of a long page at a time. The electronic device 100 can receive swiping actions from the user on the display screen, causing it to switch to display other content on the long page. The electronic device 100 can also automatically scroll the long page, allowing it to switch to display other content.

[0065] Figure 1A shows a schematic diagram of a long page.

[0066] As shown in Figure 1A, a long page can include multiple consecutive page contents from top to bottom, such as page content 111, page content 112, and page content 113.

[0067] The electronic device 100 can first display page content 111, then scroll the long page to display page content 112, and finally scroll the long page to display page content 113.

[0068] Therefore, the page containing content 111 can be called a subpage of the long page, the page containing content 112 can also be called a subpage of the long page, and the page containing content 113 can also be called a subpage of the long page.

[0069] Optionally, the offset of a long page can refer to the scroll distance of the long page. The unit of the scroll distance of the long page can be pixels (px).

[0070] Figures 1B-1E illustrate a schematic diagram of the first application controlling the scrolling of a long page in a first direction.

[0071] As shown in Figure 1B, at time t1, the electronic device 100 displays the page content 111 of the long page of the first application in the page scrolling area. The page content 112 and page content 113 of the long page of the first application are not displayed.

[0072] Then, the first application can scroll its long page in the first direction, so that the electronic device 100 can display other page content of the long page of the first application.

[0073] As shown in Figure 1C, the first application scrolls its long page in a first direction, for example, by a scroll distance of 1, and displays the bottom content of page content 111 and the top content of page content 112 shown in Figure 1D. For example, the first direction can be a direction perpendicular to the ground and upwards.

[0074] As can be seen from Figures 1D and 1C, the page content shown in Figure 1D and the page area shown in Figure 1C have overlapping areas. For example, the bottom content of page content 111 is an overlapping area.

[0075] Then, the first application can continue to scroll the long page of the first application in the first direction, so that the electronic device 100 can display other page content of the long page of the first application.

[0076] As shown in Figure 1E, the first application continues to scroll its long page in a first direction, for example, by a scroll distance of 2, and displays the bottom content of page content 112 and the top content of page content 113 of the long page shown in Figure 1F. For example, the first direction can be a direction perpendicular to the ground and upwards.

[0077] As can be seen from Figures 1E and 1F, the page content shown in Figure 1E and the page area shown in Figure 1F have overlapping areas. For example, the middle part of the page content 112 is an overlapping area.

[0078] From Figures 1A to 1F, the long page of the first application scrolled a total distance of (scrolling distance 1 + scrolling distance 2) in the first direction.

[0079] 2. View controls and types of view controls.

[0080] View controls are used to layout elements (or objects, or data, etc.) in an interface. In this embodiment, if the view control is considered as a container, then the objects placed within it (such as text or images) are called elements. Elements can include, but are not limited to, text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets.

[0081] Because view controls can be nested, a parent view control can have one or more child view controls. Optionally, a parent view control may not contain any child view controls.

[0082] Figure 2 shows a schematic diagram of multiple view controls displayed in a subpage.

[0083] As shown in Figure 2, the subpage displays multiple view controls, such as view control 1, view control 2, view control 3, view control 4, view control 5, and view control 6. Among them, view control 1 can be the parent view control, view control 4 is both a parent view control and a child view control, and view control 2, view control 3, and view control 6 are child view controls.

[0084] Figure 3 shows a schematic diagram illustrating the relationship between the various view controls in the subpage.

[0085] As shown in Figure 3, view control 1 can be the parent view control of view control 2, view control 3, view control 4, and view control 5. That is, view control 2, view control 3, view control 4, and view control 5 are child view controls of view control 1. View control 4 can be the parent view control of view control 5, meaning that view control 5 is a child view control of view control 4.

[0086] In some embodiments, because the content of the long page of the first application is too large to exceed the display area of ​​the electronic device 100, the electronic device 100 cannot display the entire content of the long page on the display screen at once. Therefore, the electronic device 100 can provide a scroll view control, allowing the first application to display the long page of the first application within the scroll view control, and to scroll and display other page content of the long page of the first application within the scroll view control.

[0087] In this application embodiment, view controls can be divided into scrollable view controls and non-scrollable view controls. Generally, scrollable view controls can include, but are not limited to, any of the following: Linear Layout controls, ListView controls, GridView controls, RecyclerView controls, ViewPager controls, WebView controls, etc. A brief introduction to various scrollable view controls is given below:

[0088] Linear layout control: Used to achieve a flow layout, it can control the horizontal or vertical arrangement of elements placed in the control.

[0089] The ListView control is used to display elements (or objects, which can contain text and images) in a list format. This control allows you to group elements into columns with or without column headers, and display accompanying icons and text. You can use the ListView control to organize list items called ListItem elements (which can contain text and images) into one of four different views: 1. Large (standard) icons, 2. Small icons, 3. List, 4. Report. Additionally, this control can manage the sorting method of elements in the list and the appearance of selected elements.

[0090] Grid view control: Used to display elements (or objects, which can contain text and images) in a grid format.

[0091] RecyclerView controls can display elements (or objects, including text and images) in list, grid, and other formats. Compared to ListView, RecyclerView has a more powerful element reuse mechanism and provides more layout managers to handle various layouts. You can customize the layout manager to determine the item arrangement rules, such as: 1. A linear layout similar to ListView, allowing for horizontal or vertical list element layout; 2. A grid layout, allowing you to specify the number of elements; 3. A waterfall layout, allowing you to specify the list direction and the number of elements in each direction.

[0092] View Pager Control: Provides a multi-page switching effect. This control is a container class, allowing other controls to be added to it. The ViewPager control requires the PagerAdapter class to provide data. Multiple views can be populated into the control by creating an adapter, and different views can be switched when the user swipes left or right.

[0093] Content displayed in a non-scrollable view control cannot be scrolled. Examples of non-scrollable view controls include ImageView, TextView, IconView, ButtonView, MenuView, TabView, TextBoxView, Dialog BoxView, StatusBarView, NavigationBarView, and WidgetView.

[0094] Optionally, scrollable view controls and non-scrollable view controls can also be other types, which are not limited in this application.

[0095] Optionally, generally speaking, a scrollable view control is the root node of the page; for example, view control 1 shown in Figures 2 and 3 can be a scrollable view control. Other nodes on the page besides the root node can be non-scrollable view controls, such as the view controls shown in Figures 2 and 3.

[0096] 2. View control 3. View control 4. View control 5. View control 6 can be a scrolling view control.

[0097] 3. Repeating regions.

[0098] A repeating region can represent the same area contained in an image captured by an electronic device before scrolling through a long page and in another image captured after scrolling through a long page.

[0099] Referring to the description in Figure 1A, a long page can include multiple consecutive pages of content from top to bottom, such as page content 111, page content 112, and page content 113. The height of the long page is greater than the height of the electronic device's display screen. Therefore, the electronic device cannot display all the page content of the long page on the display screen at once. Users can view different page contents on the long page by swiping up or down on the display screen.

[0100] As shown in Figure 4, at time t1, the electronic device can display a long page of content 111 on the screen. At this time, the electronic device 100 can take a screenshot to obtain an image 501 containing the page content 111. The electronic device can continue to scroll up the long page, so that the page content displayed on the screen changes from the page content 111 displayed on the screen at time t1 to a part of the page content 111 and a part of the page content 112 displayed on the screen at time t2.

[0101] As shown in Figure 4, after the electronic device scrolls through a long page, at time t2, it can display a portion of page content 111 and a portion of page content 112 on the screen. At this time, taking a screenshot on the electronic device will yield image 502, as shown in Figure 5, which contains a portion of page content 111 and a portion of page content 112.

[0102] When the electronic device takes a screenshot at time t2, a portion of page content 111 is still displayed on the screen. This portion of page content 111 exists in both image 501 and image 502. Therefore, the portion of page content 111 is a repetitive area of ​​images 501 and 502.

[0103] When stitching images 501 and 502 into a long screenshot, the electronic device needs to crop out the overlapping areas on one of the images 501 and 502 to prevent the same area of ​​page content from appearing multiple times in the long screenshot.

[0104] In some embodiments, the aforementioned repeating areas may also be referred to as public areas or similar names.

[0105] After enabling the scrolling screenshot function on electronic device 100, the device can scroll the page and capture multiple images during the scrolling screenshot process. Adjacent screenshots may contain overlapping areas. The electronic device needs to crop out the overlapping areas from one of the adjacent screenshots before stitching the images together. Currently, electronic devices often use image recognition algorithms to identify these overlapping areas. However, this method is time-consuming and its accuracy needs improvement.

[0106] Furthermore, when dynamic elements are present on the page (such as playing videos, animated images, etc.), the content displayed in the overlapping areas may differ. The aforementioned image recognition algorithm struggles to accurately identify these overlapping areas. This can lead to errors in scrolling screenshots. Electronic devices also struggle to accurately stitch together the long screenshots the user intends to capture. Consequently, the user experience with the scrolling screenshot function is poor.

[0107] Based on this, this application provides a scrolling screenshot method. When the scrolling screenshot function is enabled, the electronic device can scroll a long page in the page scrolling area and take multiple screenshots during the scrolling process. Optionally, as the number of scrolls increases, the cumulative scrolling distance of the scrolling view control is accumulated.

[0108] The electronic device can determine the height of the repeated area in the scrolling area of ​​a long page between two adjacent screenshots based on the difference in the cumulative scrolling distance of the scroll view control and the height of the scroll view control. Furthermore, the electronic device can crop the repeated area from one of the images obtained from the two adjacent screenshots based on the height of the repeated area. Then, the electronic device can stitch the cropped images together to obtain a long screenshot.

[0109] As can be seen, when taking scrolling screenshots, electronic devices can determine the height of the overlapping area between two adjacent screenshots by using the cumulative scroll distance and height of the scroll view control on the page. The cumulative scroll distance and height of the scroll view control are unambiguously determined and unaffected by changes in the displayed content of dynamic elements. Therefore, regardless of the presence of dynamic elements on the page, the electronic device can accurately identify the overlapping area in two adjacent screenshots based on the scroll distance of the view control. This method can improve the success rate of scrolling screenshots and enhance the user experience of using the scrolling screenshot function.

[0110] The structure of the electronic device involved in this application is described below.

[0111] Please refer to Figure 5, which exemplarily illustrates a schematic diagram of the hardware structure of the electronic device 100.

[0112] As shown in Figure 5, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0113] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0114] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0115] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.

[0116] The processor 110 may also include a memory for storing instructions and data. In some examples, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or is recurring. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0117] USB interface 130 is an interface that conforms to the USB standard specification. USB interface 130 can be used to connect a charger to charge electronic device 100, and can also be used for data transfer between electronic device 100 and peripheral devices.

[0118] The charging management module 140 receives charging input from a charger, which can be a wireless charger or a wired charger. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.

[0119] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, internal memory 121, external memory, display 194, camera 193, and wireless communication module 160, etc.

[0120] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.

[0121] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network.

[0122] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1.

[0123] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0124] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering.

[0125] The display screen 194 is used to display images, videos, etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1.

[0126] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.

[0127] The ISP is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, converting it into an image visible to the naked eye.

[0128] Camera 193 is used to capture still images or videos. In some embodiments, electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

[0129] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.

[0130] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.

[0131] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to perform data storage functions.

[0132] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.).

[0133] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.

[0134] Audio module 170 is used to convert digital audio information into analog audio signal output, and also to convert analog audio input into digital audio signal. Audio module 170 can also be used for encoding and decoding audio signals. In some examples, audio module 170 may be located in processor 110, or some functional modules of audio module 170 may be located in processor 110. Speaker 170A, also called a "loudspeaker," is used to convert audio electrical signals into sound signals. Receiver 170B, also called a "handset," is used to convert audio electrical signals into sound signals. Microphone 170C, also called a "microphone" or "microphone," is used to convert sound signals into electrical signals. Headphone jack 170D is used to connect wired headphones.

[0135] The sensor module 180 may include pressure sensors, gyroscope sensors, barometric pressure sensors, magnetic sensors, accelerometers, gravity sensors, distance sensors, proximity sensors, fingerprint sensors, temperature sensors, touch sensors, ambient light sensors, bone conduction sensors, etc.

[0136] Buttons 190 include a power button, volume buttons, etc. Motor 191 can generate vibration feedback. Indicator 192 can be an indicator light, used to indicate charging status, battery level changes, and also to indicate messages, missed calls, notifications, etc.

[0137] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to make contact with and separate from the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The electronic device 100 interacts with the network through the SIM card to achieve functions such as making calls and data communication.

[0138] Electronic device 100 can be a mobile phone, tablet computer, laptop computer, smartwatch, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), etc. This application embodiment does not limit the specific type of electronic device 100.

[0139] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses a layered architecture. Taking the system as an example, the software structure of electronic device 100 is illustrated.

[0140] Please refer to Figure 6, which exemplarily illustrates the software structure block diagram of electronic device 100.

[0141] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, [the following is omitted as the text is incomplete and likely refers to a specific implementation or feature]. The system is divided into four layers, from top to bottom: application layer, application framework layer, system runtime (Android Runtime) and system libraries, and kernel layer.

[0142] The application layer can include a series of application packages.

[0143] As shown in Figure 6, the application package may include applications such as camera, gallery, calendar, call, map, navigation, Bluetooth, music, SMS, scrolling screenshot application, and a first application. The scrolling screenshot application provides the scrolling screenshot function. It can activate the scrolling screenshot function in response to an operation that triggers it. The first application may provide a long page and display it on the screen. After detecting an operation that triggers the scrolling screenshot, the scrolling screenshot application can activate the scrolling screenshot function and send a message to the first application. In response to this message, the first application can begin scrolling the long page. The scrolling screenshot application can take multiple screenshots while the first application is scrolling the long page. When the page scrolls to the bottom or an operation to end the scrolling screenshot is detected, the scrolling screenshot application can send another message to the first application, instructing it to stop scrolling the long page, and the scrolling screenshot application will also stop taking screenshots. The scrolling screenshot application is also used to stitch multiple images captured while scrolling the page into a long screenshot.

[0144] In some embodiments, a scrolling screenshot application may also be referred to as a long screenshot application, a swipe screenshot application, etc. This application does not limit this.

[0145] The application framework layer provides APIs and a programming framework for applications within the application layer. The application framework layer includes some predefined functions.

[0146] As shown in Figure 6, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, accessibility system service, gesture recognition module, etc.

[0147] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture the screen, among other things.

[0148] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.

[0149] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views (view controls). For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.

[0150] The phone manager is used to provide communication functions for electronic device 100. For example, it manages call status (including connection and disconnection).

[0151] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0152] The notification manager allows applications to display notifications in the status bar (such as the pull-down notification bar). It can be used to convey informational messages and can disappear automatically after a short pause without user interaction. For example, the notification manager can be used to notify users of download completion or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.

[0153] The gesture recognition module can be used to recognize gestures and other actions performed on the display screen. For example, the gesture recognition module can recognize gestures performed on the display screen to activate the scrolling screenshot function. These gestures may include, but are not limited to, knuckle gestures used to draw a target symbol (such as the letter S) on the display screen. When the gesture is recognized, the gesture recognition module can send a message to the scrolling screenshot application at the application layer to instruct it to activate the scrolling screenshot function.

[0154] The accessibility system service periodically / irregularly receives interface layout information of the currently displayed user interface sent by the first application. In some embodiments, the accessibility system service can perform system operations based on the interface layout information of the user interface, such as broadcasting the content displayed in the user interface, so that the user can obtain the content of the user interface displayed by the first application through the voice content broadcast by the accessibility system service.

[0155] In this embodiment, the interface layout information of the user interface may include the cumulative scroll distance of the scroll view control displayed on the page. Optionally, if the page is continuously scrolled in the first direction, the cumulative scroll distance of the scroll view control is accumulated as the number of page scrolls increases. For example, the cumulative scroll distance of the scroll view control after the (k+1)th scroll is greater than the cumulative scroll distance of the scroll view control after the kth scroll, where the (k+1)th scroll is the number of scrolls after the (k+)th scroll.

[0156] Optionally, after the content of the user interface displayed by the first application changes, the first application can send the interface layout information of the changed user interface to the accessibility system service.

[0157] The scrolling screenshot application can determine the height of the overlapping area of ​​the screenshot images in the page scrolling area based on the cumulative scrolling distance difference between the two screenshots and the height of the scrolling view control. The page scrolling area can be the display area where the scrolling view control is located.

[0158] Scrolling screenshot apps can crop the overlapping region from one of two adjacent screenshots based on its height. Then, the app can stitch the cropped images together to create a longer screenshot.

[0159] The core library consists of two parts: one part is the functionalities that the Java language needs to call, and the other part is the system's core library.

[0160] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0161] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.

[0162] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.

[0163] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

[0164] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0165] A 2D graphics engine is a graphics engine for 2D drawing.

[0166] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.

[0167] Figure 7 illustrates an example of the interaction between multiple software modules in an electronic device 100.

[0168] As shown in Figure 7, the electronic device 100 includes an accessibility system service, a scrolling screenshot application, and a first application. In some embodiments, the accessibility system service may also be referred to as the first system service.

[0169] 1. The first application displays the user interface and obtains the interface layout information of the user interface.

[0170] After the first application is launched, it can display its user interface and obtain the interface layout information. Optionally, the user interface of the first application displays a first scroll view control, allowing the first application to scroll and display a first long page within the first scroll view control.

[0171] The interface layout information of the user interface includes, but is not limited to, the positional relationship of multiple view controls in the user interface, the names of the view controls, the types of the view controls, the elements displayed in the view controls, and the cumulative scroll distance of the first scrolling view control. For example, the positional relationship of multiple view controls can be similar to that shown in Figure 3.

[0172] Optionally, the name of the first scroll view control can be represented using "std::string component ID="". The type of the first scroll view control can be represented using "std::string component Type="". The cumulative scroll distance of the first scroll view control can be represented using "public int offset="". For example, when the first scroll view control is a ListView, the cumulative scroll distance of the ListView can be represented using "ListView public int offset="". When the first scroll view control is a GridView, the cumulative scroll distance of the GridView can be represented using "GridView public int offset="". When the first scroll view control is a RecyleView, the cumulative scroll distance of the RecyleView can be represented using "RecyleView public int offset="". When the first scroll view control is a WebView, the cumulative scroll distance of the WebView can be represented using "WebView public int offset="".

[0173] Optionally, if the page is continuously scrolled in the first direction, the cumulative scroll distance of the first scroll view control is accumulated as the number of page scrolls increases. For example, the cumulative scroll distance of the first scroll view control after the (k+1)th scroll is greater than the cumulative scroll distance of the first scroll view control after the (k)th scroll, and the (k+1)th scroll is the number of scrolls after the (k+)th scroll.

[0174] 2. The first application sends the user interface layout information to the accessibility system service.

[0175] After obtaining the user interface layout information, the first application can send this information to the accessibility system service. The accessibility system service can then obtain the cumulative scroll distance of the first scroll view control from the user interface layout information.

[0176] Optionally, steps 1 and 2 above can be performed periodically, irregularly, or at regular intervals. After the user interface displayed by the first application changes, the first application needs to send the updated user interface layout information to the accessibility system service.

[0177] 3. Scrolling screenshot applications obtain user interface layout information from accessibility system services.

[0178] 4. The scrolling screenshot application calculates the overlapping area of ​​the previous and subsequent screenshots based on the cumulative scrolling distance of the first scrolling view control in the user interface layout information.

[0179] After enabling the scrolling screenshot function, the scrolling screenshot application can obtain the interface layout information of the user interface from the accessibility system service to obtain the cumulative scrolling distance of the first scrolling view control. The cumulative scrolling distance of the first scrolling view control is used to calculate the overlapping area of ​​the previous and subsequent screenshots, and remove the overlapping area from one of the images to avoid the overlapping area appearing multiple times in the long screenshot obtained by the scrolling screenshot application based on the stitching of two screenshots.

[0180] Figures 8A to 8E exemplarily illustrate a scenario of obtaining a long screenshot image by scrolling through a screenshot according to an embodiment of this application.

[0181] This example illustrates how electronic device 100 takes a scrolling screenshot while displaying a long page of a social application. For scenarios where electronic device 100 takes a scrolling screenshot while displaying other application pages, please refer to Figures 8A to 8E.

[0182] The electronic device 100 can display the user interface shown in FIG8A. The user interface shown in FIG8A may include a status bar 311 and content in a social application. The content in the social application may include an application header area 312, page content 313, and an application bottom area 314.

[0183] The status bar 311 may include view controls such as signal strength indicator, Wi-Fi connection indicator, battery level indicator, and time information.

[0184] The application header area 312 can display view controls from the social application. The display position of these view controls within the application header area 312 is fixed.

[0185] The bottom area 314 of the application can display view controls from the social application. The display position of these view controls in the bottom area 314 remains fixed.

[0186] The view controls in the status bar 311, the application header area 312, and the application footer area 314 are all displayed in fixed positions and will not change their display positions as the long page in the social application is scrolled.

[0187] In some embodiments, the area containing the status bar 311, the application header area 312, and the application footer area 314 can be referred to as the non-scrollable area.

[0188] Page content 313 can be displayed in the scrollable area between the application header area 312 and the application footer area 314. Page content 313 can be the content of a subpage within a long page of a social application. Users can scroll up or down page content 313 to view the content of different subpages within the long page of the social application.

[0189] Page content 313 may contain multiple view controls from a long page in a social application. For example, page content 313 may contain view controls 313A, 313B, 313C, and 313D. View control 313A can be a user avatar. View control 313B can be a username (e.g., Henry). View control 313C can be an image. View control 313D can be a video window that is currently playing a video. For example, the video in view control 313D may be playing at the 1-minute mark. View controls 313A, 313B, and 313C are all static elements. Static elements represent view controls whose displayed content does not change. View control 313D can display different images from the video at different times. View control 313D is a dynamic element. Dynamic elements represent view controls whose displayed content changes, creating a dynamic effect.

[0190] In response to the scrolling screenshot operation shown in Figure 8A, the electronic device 100 can enable the scrolling screenshot function, scroll the page, and capture screenshots multiple times during the scrolling process. The aforementioned scrolling screenshot operation can be, for example, tapping the display screen with a single finger knuckle while keeping the knuckle on the screen, and drawing the symbol "S" on the display screen using the knuckle. This application embodiment does not limit the operation for triggering a scrolling screenshot.

[0191] In one possible implementation, after enabling the scrolling screenshot function, the social application can start scrolling the long page, for example, the social application can start scrolling the long page upwards.

[0192] Optionally, the social application can take a screenshot with each scroll. For example, when the electronic device 100 displays the user interface shown in Figure 8A or Figure 8B, the scrolling screenshot application can take a screenshot.

[0193] As shown in Figures 8B and 8C, the social application can scroll up the long page containing page content 313 to display page content 315 as shown in Figure 8C. Page content 315 can be other subpages within the long page of the social application, and page content 315 can also contain multiple view controls.

[0194] As shown in Figure 8C, some view controls in page content 315 can be some view controls in page content 313 shown in Figure 8B. For example, page content 315 also includes view control 313D. It can be seen that the video in view control 313D continues to play during the scrolling screenshot process. When the long page of the social application scrolls to the point where page content 315 as shown in Figure 8B is displayed on the screen, the video in view control 313D plays to the point corresponding to 1 minute and 1 second. That is to say, when the social application scrolls the long page, the scrolling page changes from the state of page content 313 in the long page shown in Figure 8B to the state of page content 315 in the long page shown in Figure 8B, taking 1 second.

[0195] Page content 315 also includes view controls not included in page content 313 shown in Figure 8B. For example, page content 315 also includes view control 313E. View control 313E is located below view control 313D on a long page of a social application. Understandably, as page content 313 scrolls upwards, one or more view controls located below page content 313 can be scrolled to the top, and one or more view controls located within page content 313 can be removed from the display. For example, view controls 313A and 313B shown in Figure 8B are removed from the display, and view control 313C is partially removed. Page content 315 does not include view controls 313A and 313B, and only includes a portion of view control 313C. View control 313E can also be a dynamic element. For example, view control 313E is an animated image that displays different images at different times.

[0196] Optionally, when the electronic device 100 displays the user interface shown in Figure 8C, the scrolling screenshot application can take another screenshot.

[0197] As can be seen from Figures 8B and 8C, there are overlapping areas between page content 313 and page content 315. Therefore, the two images obtained by the scrolling screenshot application also have overlapping areas.

[0198] As shown in Figures 8C and 8D, the social application can scroll up the long page containing page content 315 to display page content 316 as shown in Figure 8D. Page content 316 can be other subpages within the long page of the social application, and page content 316 can also contain multiple view controls.

[0199] As shown in Figure 8D, some view controls in page content 316 can be some view controls in page content 315 shown in Figure 8C. For example, page content 316 includes a portion of view control 313D, view control 313E, and view control 313F. It can be seen that the video in view control 313D continues to play during the scrolling screenshot process. When the long page of the social application scrolls to the point where page content 316 as shown in Figure 8D is displayed on the screen, the video in view control 313D plays to the point corresponding to 1 minute and 2 seconds. That is to say, when the electronic device 100 scrolls the long page of the social application, the scrolling page changes from the state of displaying page content 315 as shown in Figure 8C to the state of displaying page content 316 as shown in Figure 8D after 1 second. View control 313D is a dynamic element. The content displayed by view control 313D in page content 316 is different from the content displayed by view control 313D in page content 315. Similarly, view control 313E is also a dynamic element. The content displayed by view control 313E in page content 316 is different from the content displayed by view control 313E in page content 315.

[0200] Understandably, as page content 315 scrolls upwards, one or more view controls located below page content 315 can be scrolled to the top, and one or more view controls within page content 315 can be removed from the display. For example, view control 313C shown in Figure 8C is completely removed and cannot be displayed. Page content 316 contains only a portion of the content of view control 313D, all the content of view control 313E, and a portion of the content of view control 313F. View control 313E can also be a dynamic element. For example, view control 313E is an animated image that displays different images at different times.

[0201] Optionally, when the electronic device 100 displays the user interface shown in Figure 8D, the scrolling screenshot application can take another screenshot.

[0202] As can be seen from Figures 8C and 8D, there are overlapping areas between page content 315 and page content 316. Therefore, the two images obtained by the scrolling screenshot application also have overlapping areas.

[0203] Once the preset conditions are met, the electronic device 100 can also stop scrolling the long page of the social application and stitch together the screenshots of the accounting images to obtain a long screenshot.

[0204] For example, as shown in FIG8D, in response to an operation to end a scrolling screenshot, such as a user action on the display screen (e.g., a click), the electronic device 100 can stop scrolling a long page of a social application and stitch together multiple images captured during the scrolling process into a long screenshot. This application embodiment does not limit the operation for ending a scrolling screenshot.

[0205] Optionally, after the scrolling screenshot ends but before saving the long screenshot, the electronic device 100 can display a prompt message 317 as shown in Figure 8E. The prompt message 317 includes the text "Saving long screenshot...", which is used to inform the user that the electronic device 100 is saving a long screenshot. Optionally, the electronic device 100 can save the long screenshot to a gallery application, where the user can view the long screenshot.

[0206] The following section describes the specific implementation process of obtaining a long screenshot from multiple screenshot images using electronic device 100.

[0207] Figures 9A-9J show the UI diagrams of an electronic device 100 that generate a long screenshot based on multiple screenshot images.

[0208] This explanation uses the scrolling screenshot scenario shown in Figures 8A to 8E as an example, illustrating the process of the electronic device 100 performing three screenshot operations from the start to the end of the scrolling screenshot. The electronic device 100 is not limited to three screenshots; it can perform more or fewer screenshot operations. This application only uses three screenshots as an example.

[0209] As shown in Figure 9A, when the electronic device 100 takes its first screenshot, the screen can display the user interface shown in Figure 8A. Therefore, the first screenshot taken by the electronic device 100 can obtain an image containing the user interface shown in Figure 8A, such as screenshot image 1. The electronic device 100 can take its first screenshot when it detects an operation to trigger a scrolling screenshot. That is, the first screenshot can occur before the electronic device 100 starts scrolling the page.

[0210] As can be seen, screenshot 1 shown in Figure 9A can be divided into three parts from top to bottom: a fixed header area, a scrollable page area, and a fixed bottom area. The display positions of the view controls in the fixed header and bottom areas can remain fixed. The page content displayed in the scrollable page area can scroll in the first direction. That is, the display positions of the view controls in the scrollable page area can change.

[0211] Optionally, the electronic device 100 can identify the area where the first scroll view control is located in the screenshot image 1 as the page scroll area, except that the area where the first scroll view control is located is a non-page scroll area, such as the aforementioned fixed header area and the aforementioned fixed bottom area.

[0212] In some embodiments, the fixed header area may include a status bar 311 and an application header area 312. The fixed bottom area may include an application bottom area 314. The status bar 311, application header area 312, and application bottom area 314 can be referred to the description in the foregoing embodiments. Optionally, the fixed bottom area may also include view controls such as a bottom desktop navigation bar provided by the system application. This application embodiment does not limit the content included in the fixed header and fixed bottom areas.

[0213] When a screenshot is taken for the first time, the page content 313 can be displayed in the scrolling area of ​​screenshot image 1.

[0214] In some embodiments, screenshot image 1 may not include a fixed header area and / or a fixed bottom area, and screenshot image 1 may only include the page scroll area.

[0215] In some embodiments, the electronic device 100 can identify the aforementioned fixed header area, page scrolling area, and fixed bottom area, and segment the screenshot image 1 according to the division of these areas. That is, the electronic device 100 can segment the screenshot image 1 into three parts: the fixed header area (including the status bar 311 and the application header area 312), the part corresponding to the page scrolling area (including the page content 313), and the part corresponding to the fixed bottom area (including the application bottom area 314).

[0216] After taking the first screenshot, the electronic device 100 can scroll through the long page of the social application in the page scrolling area and then take a second screenshot.

[0217] As shown in Figure 9B, when the electronic device 100 takes a second screenshot, the screen can display the user interface shown in Figure 8C. That is, during the second screenshot, the content displayed in the page scrolling area is the page content 315 shown in Figure 8C. Therefore, the electronic device 100 can obtain an image containing the page content 315 shown in Figure 8C, such as screenshot image 2, by taking a second screenshot.

[0218] In one possible implementation, the electronic device 100 can capture all the content displayed on the screen shown in Figure 8C during the second screenshot, obtaining screenshot image 2. Then, the electronic device 100 can separate the page content 315 in the page scrolling area from screenshot image 2 according to the division of the header fixed area, the page scrolling area, and the bottom fixed area. In another possible implementation, the electronic device 100 can capture only the content in the page scrolling area shown in Figure 8C during the second screenshot, obtaining screenshot image 2 composed of page content 315.

[0219] After acquiring screenshot image 1 and screenshot image 2, the electronic device 100 can identify the overlapping area between page content 313 in screenshot image 1 and page content 315 in screenshot image 2. For example, as shown in FIG9C, the electronic device 100 can determine that the overlapping area between page content 313 and page content 315 is the overlapping area 1 indicated by the dashed box shown in FIG9C.

[0220] After obtaining the duplicate region 1, as shown in Figure 9D, the electronic device 100 can remove the duplicate region 1 from the page content 315 to obtain page content 3151. Page content 3151 is used to stitch together a long screenshot after the screenshot function is turned off.

[0221] Optionally, the electronic device 100 may also crop out the repeating area 1 on the page content 313, while retaining the repeating area 1 on the page content 315.

[0222] The following describes how the electronic device 100 identifies the aforementioned repeating region 1.

[0223] In some embodiments, the cumulative scroll distance of a long page in a social application can be recorded as the cumulative scroll distance of a first scroll view control. If the long page of the social application scrolls continuously in a first direction, the cumulative scroll distance of the first scroll view control gradually increases. If the long page of the social application then scrolls in a second direction, the cumulative scroll distance of the first scroll view control needs to be subtracted from the distance the long page of the social application scrolls in the second direction.

[0224] As shown in Figure 9E(a), after the electronic device 100 takes the first screenshot, the area where the first scroll view control is located is the page scroll area, and the electronic device 100 can obtain the height of the first scroll view control. Page content 313 is displayed in the page scroll area. Before scrolling the long page of the social application, the scroll distance of the long page of the social application is 0, so the cumulative scroll distance of the first scroll view control at the time of the first screenshot is equal to 0.

[0225] As shown in Figure 9E(b), after the electronic device 100 takes the first screenshot and before taking the second screenshot, the long page of the social application scrolls upward by a distance of scroll distance 1. Correspondingly, the page content of scroll distance 1 shown in Figure 9E(b) is not visible, and the page content of scroll distance 1 shown in Figure 9E(b) is displayed in the page scrolling area for the first time.

[0226] After the first scroll of the long page of the social application, the electronic device 100 performs a second screenshot operation. When the electronic device 100 performs the second screenshot operation, the scroll distance of the long page of the social application is scroll distance 1. Therefore, the cumulative scroll distance of the first scroll view control during the second screenshot is equal to the cumulative scroll distance of the first scroll view control during the first screenshot plus the distance of the first scroll of the long page of the social application (i.e., scroll distance 1). In other words, the cumulative scroll distance of the first scroll view control during the second screenshot is equal to scroll distance 1.

[0227] The electronic device 100 can obtain the height of the repeating area 1 based on the following formula: Height of repeating area 1 = Height of the first scrolling view control - (Cumulative scrolling distance of the first scrolling view control when taking the second screenshot - Cumulative scrolling distance of the first scrolling view control when taking the first screenshot).

[0228] As shown in the formula above, the cumulative scrolling distance of the first scroll view control during the second screenshot minus the cumulative scrolling distance of the first scroll view control during the first screenshot can represent the height of the page content that first appears in the page scroll area, or it can represent the height of the non-repeating area of ​​the page scroll area during the second screenshot and the page scroll area during the first screenshot, or it can represent the distance of the first scroll of the first long page. Then, by subtracting the height of the non-repeating area of ​​the page scroll area during the second screenshot and the page scroll area during the first screenshot from the height of the first scroll view control, the height of the repeating area 1 can be obtained, as shown in Figure 9E(b).

[0229] As shown in Figure 9E(a) and Figure 9E(b), after determining the height of the repeating region 1, the page content at the bottom of page content 313 with the height of the repeating region 1, or the page content at the top of page content 315 with the height of the repeating region 1, can be determined as the repeating region 1.

[0230] After taking a second screenshot, the electronic device 100 can continue scrolling through the long page of the social application in the page scrolling area, and then take a third screenshot.

[0231] As shown in Figure 9F, when the electronic device 100 takes a third screenshot, the screen can display the user interface shown in Figure 8D. That is, during the third screenshot, the content displayed in the page scrolling area is the page content 316 shown in Figure 8D. Therefore, the electronic device 100 can obtain an image containing the page content 316 shown in Figure 8D, such as screenshot image 3, by taking a third screenshot.

[0232] In one possible implementation, the electronic device 100 can capture all the content displayed on the screen as shown in Figure 8D during the second screenshot, obtaining screenshot image 3. Then, the electronic device 100 can separate the page content 316 in the page scrolling area from the screenshot image 3 according to the division of the header fixed area, the page scrolling area, and the bottom fixed area. In another possible implementation, the electronic device 100 can capture only the content in the page scrolling area shown in Figure 8D during the second screenshot, obtaining screenshot image 3 composed of page content 316.

[0233] After acquiring screenshots 2 and 3, the electronic device 100 can identify the overlapping areas of page content 315 in screenshot 2 and page content 316 in screenshot 3. For example, as shown in FIG9G, the electronic device 100 can determine that the overlapping area of ​​page content 315 and page content 316 is the overlapping area 2 indicated by the dashed box in FIG9G.

[0234] After obtaining the duplicate region 2, as shown in Figure 9H, the electronic device 100 can remove the duplicate region 2 from the page content 316 to obtain page content 3161. Page content 3161 is used to stitch together a long screenshot after the screenshot function is turned off.

[0235] Optionally, the electronic device 100 may also crop out the repeating area 2 on the page content 315, while retaining the repeating area 2 on the page content 316.

[0236] The following describes how the electronic device 100 identifies the aforementioned repeating region 2.

[0237] In some embodiments, the cumulative scroll distance of a long page in a social application can be recorded as the cumulative scroll distance of a first scroll view control. If the long page of the social application scrolls continuously in a first direction, the cumulative scroll distance of the first scroll view control gradually increases. If the long page of the social application then scrolls in a second direction, the cumulative scroll distance of the first scroll view control needs to be subtracted from the distance the long page of the social application scrolls in the second direction.

[0238] As shown in Figure 9I(a), after the electronic device 100 takes a second screenshot, the area where the first scroll view control is located becomes the page scroll area, and the electronic device 100 can obtain the height of the first scroll view control. Page content 315 is displayed within the page scroll area. During the second screenshot operation, the cumulative scroll distance of the first scroll view control is equal to the scroll distance 1.

[0239] As shown in Figure 9I(b), after the electronic device 100 takes a second screenshot but before taking a third screenshot, the long page of the social application continues to scroll upwards by a distance of scroll distance 2. Correspondingly, the page content at scroll distance 2 shown in Figure 9I(b) is not visible, and the page content at scroll distance 2 shown in Figure 9I(b) is displayed in the page scrolling area for the first time. After scrolling the long page of the social application for the second time, the electronic device 100 performs the third screenshot operation.

[0240] After the second scroll of the long page of the social application, the scroll distance of the long page of the social application is scroll distance 2. When the electronic device 100 performs the third screenshot operation, the cumulative scroll distance of the first scroll view control at the time of the third screenshot is equal to the cumulative scroll distance of the first scroll view control at the time of the second screenshot plus the scroll distance of the long page of the social application at the time of the third screenshot (i.e., scroll distance 2). That is, the cumulative scroll distance of the first scroll view control at the time of the third screenshot is equal to (scroll distance 1 + scroll distance 2).

[0241] The electronic device 100 can obtain the height of the repeating area 2 based on the following formula: Height of repeating area 2 = Height of the first scrolling view control - (Cumulative scrolling distance of the first scrolling view control during the third screenshot - Cumulative scrolling distance of the first scrolling view control during the second screenshot).

[0242] As shown in the formula above, the cumulative scrolling distance of the first scroll view control during the third screenshot minus the cumulative scrolling distance of the first scroll view control during the second screenshot can represent the height of the page content that first appears in the page scrolling area, or it can represent the height of the non-repeating area of ​​the page scrolling area during the third screenshot and the second screenshot, or it can represent the distance of the second scroll of the first long page. Then, by subtracting the height of the non-repeating area of ​​the page scrolling area during the third screenshot and the second screenshot from the height of the first scroll view control, the height of the repeating area 2 can be obtained, as shown in Figure 9I(b).

[0243] As shown in Figure 9I(a) and Figure 9I(b), after determining the height of the repeating region 2, the page content at the bottom of the page content 313 with the height of the repeating region 2, or the page content at the top of the page content 315 with the height of the repeating region 2, can be determined as the repeating region 1.

[0244] After electronic device 100 performs n screenshot operations, and after the long screenshot function is turned off, electronic device 100 can use the cropped images to stitch together to obtain a long screenshot.

[0245] For example, after the electronic device 100 performs the third screenshot operation, the electronic device 100 can use the cropped image to stitch together to obtain a long screenshot.

[0246] As shown in Figure 9J, the electronic device 100 can be assembled from top to bottom in the following order: a fixed header area, page content 313, page content 3151, page content 3161, and a fixed bottom area, to obtain the long screenshot 9001 shown in Figure 9J. The long screenshot 9001 is the long screenshot obtained in the scrolling screenshot scenario shown in Figures 8A to 8E.

[0247] Figure 10A shows a flowchart illustrating how an electronic device 100 obtains a long screenshot after enabling the long screenshot function.

[0248] Figure 10A can be a flowchart illustrating the process of obtaining a long screenshot for the first and second screenshot operations.

[0249] As shown in Figure 10A, the electronic device 100 includes an application layer and an application framework layer. The application layer includes a scrolling screenshot application and a first application, and the application framework layer includes an accessibility system service and a gesture recognition module.

[0250] In some embodiments, accessibility system services may also be referred to as first system services.

[0251] The method shown in Figure 10A includes, but is not limited to, the following steps:

[0252] S1001A, a user interface 1 is displayed, and the user interface 1 includes the page content A of the first long page in the first application.

[0253] For example, the first application can be a social application, and the user interface 1 can be the user interface shown in Figure 8A. The page content A of the first long page can be the page content 313 shown in Figure 8A, and the first long page can be the long page containing the page content 313 shown in Figure 8A.

[0254] Before enabling the long screenshot feature, the first application can continuously display the user interface 1.

[0255] S1002A, the first application sends the interface layout information of the user interface 1 to the accessibility system service, including the cumulative scroll distance 1 of the first scroll view control.

[0256] After the first application displays user interface 1, the first application can obtain the interface layout information of user interface 1 and send it to the accessibility system service.

[0257] In some embodiments, the accessibility system service can perform system operations based on the interface layout information of the user interface 1, such as broadcasting the content displayed in the user interface, so that the user can obtain the content of the user interface 1 displayed by the first application through the voice content broadcast by the accessibility system service.

[0258] For example, the interface layout information of user interface 1 includes, but is not limited to, the positional relationship of multiple view controls in user interface 1, the names of the view controls, the types of the view controls, the elements displayed in the view controls, and the cumulative scrolling distance 1 of the first scrolling view control. For example, the positional relationship of multiple view controls can be similar to the positional relationship of multiple view controls shown in Figure 3.

[0259] Generally, the first scroll view control can be the root node among multiple view controls. Electronic device 100 can obtain the root node among multiple view controls in the first user interface. If the root node among the multiple view controls includes any of the following types: Linear Layout control, ListView control, GridView control, RecyclerView control, ViewPager control, WebView control, etc., then the root node among the multiple view controls can be determined as the first scroll view control.

[0260] It should be noted that the English name of the scroll view control mentioned above is for illustrative purposes only and may be other English names, which does not constitute a limitation.

[0261] It should be noted that the scroll view control can also be of other types, and this application does not limit it.

[0262] After identifying the first scroll view control, the first application can obtain the name of the first scroll view control, its cumulative scroll distance 1, etc. The cumulative scroll distance 1 of the first view control represents the cumulative scroll distance of the long page of the first application in the first direction. For example, when the long page of the first application scrolls continuously in the first direction, the cumulative scroll distance 1 of the first view control gradually increases. If the long page of the first application then scrolls in a second direction, the cumulative scroll distance 1 of the first scroll view control needs to be subtracted from the distance the long page of the first application scrolls in the second direction.

[0263] In some embodiments, the cumulative scroll distance 1 of the first scroll view control may also be referred to as the cumulative scroll distance of the first long page of the first application.

[0264] In some embodiments, the area where the first view control is located may also be referred to as the page scroll area.

[0265] For example, when the first application is a social application, the user interface 1 can be the user interface shown in Figure 8A, and the page content 313 shown in Figure 8A is displayed in the first view control. Before the first application starts scrolling the first long page, the cumulative scroll distance of the first long page of the first application is 0, and the cumulative scroll distance 1 of the first scroll view control is 0.

[0266] Optionally, after the content of the user interface displayed by the first application changes, the first application can send the interface layout information of the changed user interface to the accessibility system service, so that the accessibility system service can promptly broadcast the content displayed in the changed user interface of the first application.

[0267] S1003A, Identify user actions used to enable the long screenshot function.

[0268] An example of user operation for enabling the long screenshot function is tapping the display screen with a single finger knuckle while keeping the knuckle on the screen, drawing the symbol "S" on the screen with the knuckle. This application does not limit the operation for triggering a scrolling screenshot.

[0269] For example, the user operation to enable the long screenshot function can be as shown in Figure 8A.

[0270] S1004A, In response to a user operation that enables the long screenshot function, the gesture recognition module sends a first message to the scrolling screenshot application.

[0271] In response to a user's action to enable the long screenshot function, the gesture recognition module can send a first message to the scrolling screenshot application. The first message instructs the scrolling screenshot application to enable the long screenshot function.

[0272] S1005 A. In response to the first message, the scrolling screenshot application enables the long screenshot function.

[0273] Upon receiving the first message, the scrolling screenshot app can enable the long screenshot function.

[0274] S1006 A. The scrolling screenshot application obtains the interface layout information of user interface 1 from the accessibility system service.

[0275] After enabling the long screenshot function, the scrolling screenshot application can obtain the interface layout information of user interface 1 from the accessibility system service. The interface layout information of user interface 1 helps the scrolling screenshot application determine the overlapping area of ​​two adjacent screenshots when stitching them together to form a long screenshot.

[0276] Optionally, after the user interface displayed by the first application changes, the first application can send the interface layout information of the changed user interface to the accessibility system service, and the scrolling screenshot application can then obtain the interface layout information of the changed user interface from the accessibility system service.

[0277] Optionally, S1006 A can be executed simultaneously with S1005 A, or before S1005 A, etc.

[0278] S1007 A, The scrolling screenshot application executes the first screenshot and obtains screenshot image 1.

[0279] After enabling the long screenshot function, when the first application displays the user interface 1, the scrolling screenshot application can capture a screenshot image 1, which includes the content displayed in the user interface 1.

[0280] For example, user interface 1 can be the user interface shown in FIG8A. For example, screenshot image 1 can be the screenshot image 1 shown in FIG9A. Screenshot image 1 includes a status bar 311, an application header area 312, page content 313, and an application bottom area 314.

[0281] Optionally, S1007 A may be executed before S1005A or S1006A, or simultaneously with S1005A or S1006A, etc., and this application does not limit this.

[0282] S1008 A. In response to enabling the long screenshot function, the scrolling screenshot application sends a second message to the first application, and the second message carries a second distance.

[0283] After receiving the first message and enabling the long screenshot function, the scrolling screenshot application can send a second message to the first application. The second message carries a second distance. The second distance indicates the distance the first application scrolls the first long page each time.

[0284] Optionally, the second distance can be less than the length of the page scroll area. This avoids the situation where the first long page of the first application scrolls too much at once, causing the scroll areas of the first screenshot and the second screenshot to not include the same view controls, thus making it impossible to calculate the scroll distance of the first long page.

[0285] Optionally, before the first application scrolls through the first long page, the scrolling screenshot application needs to send a second message to the first application, i.e., S1008 A is executed periodically / irregularly.

[0286] Optionally, the scrolling distance carried by the scrolling screenshot app can also be different each time it sends a second message to the first app.

[0287] S1009A, In response to the second message, the first application controls the first long page to scroll a first distance in a first direction and displays the user interface 2, which includes the page content B of the first long page.

[0288] Upon receiving the second message, in response to the second message, the first application can control the first long page to scroll a second distance in a first direction and display user interface 2, which includes the page content B of the first long page.

[0289] Optionally, the first distance and the second distance can be the same or different.

[0290] For example, the first direction can be a direction perpendicular to the ground and upwards. When user interface 1 is the user interface shown in Figure 8A, user interface 2 can be the user interface shown in Figure 8C. The page content B of the first long page can be the page content 315 shown in Figure 8C. The long page containing page content 315 and page content 313 is the same long page, for example, the first long page. Page content 315 can be the content located below page content 313.

[0291] Optionally, the first application may scroll the first long page in other directions, not limited to scrolling it in a direction perpendicular to the ground upwards, such as scrolling it in a direction perpendicular to the ground downwards, scrolling it in a horizontal rightward direction, or scrolling it in a horizontal leftward direction. This application does not limit this.

[0292] S1010A, the first application sends the interface layout information of the user interface 2 to the accessibility system service, including the cumulative scroll distance 2 of the first scroll view control, and the difference between the cumulative scroll distance 2 and the cumulative scroll distance 1 is the first distance.

[0293] After the content of the user interface displayed by the first application changes, the first application can send the interface layout information of the changed user interface to the accessibility system service, so that the accessibility system service can promptly broadcast the content displayed in the changed user interface of the first application. For example, after the first application displays user interface 2, the first application can obtain the interface layout information of user interface 2 and send the interface layout information of user interface 2 to the accessibility system service. The interface layout information of user interface 2 includes the cumulative scroll distance 2 of the first scroll view control, and the difference between the cumulative scroll distance 2 and the cumulative scroll distance 1 is the first distance.

[0294] As described above, the scrolling distance of the first scroll view control during the second screenshot is equal to the cumulative scrolling distance of the first scroll view control during the first screenshot plus the scrolling distance of the long page of the first application during the second screenshot. When the long page of the first application scrolls in the first direction, the scrolling distance of the long page of the first application is greater than 0; when the long page of the first application scrolls in the second direction, the scrolling distance of the long page of the first application is less than 0.

[0295] In other words, the cumulative scroll distance of the first scroll view control during the second screenshot is equal to the cumulative scroll distance of the first long page of the first application in the previous screenshot. Specifically, when the first long page scrolls in the first direction, the cumulative scroll distance of the first scroll view control needs to be added to the distance the first long page scrolls in that direction. When the first long page scrolls in the second direction, the cumulative scroll distance of the first scroll view control needs to be subtracted from the distance the first long page scrolls in that direction.

[0296] For example, when the first application displays user interface 2, the scrolling screenshot application will perform a second screenshot operation. The first long page of the first application has been scrolled once. Therefore, the cumulative scrolling distance 2 of the first scrolling view control is equal to the cumulative scrolling distance of the first long page of the first application in the previous one. That is, the cumulative scrolling distance 2 of the first scrolling view control is equal to the first distance.

[0297] S1011 A. The scrolling screenshot application obtains the interface layout information of user interface 2 from the accessibility system service.

[0298] After enabling the long screenshot function, once the first application sends the interface layout information of user interface 2 to the accessibility system service, the scrolling screenshot application can obtain the interface layout information of user interface 2 from the accessibility system service. The interface layout information of user interface 2 helps the scrolling screenshot application determine the overlapping areas of adjacent screenshots when stitching together two adjacent screenshots to obtain a long screenshot.

[0299] Optionally, after the user interface displayed by the first application changes, the first application can send the interface layout information of the changed user interface to the accessibility system service, and the scrolling screenshot application can then obtain the interface layout information of the changed user interface from the accessibility system service.

[0300] S1012 A, The scrolling screenshot application performs a second screenshot to obtain screenshot image 2.

[0301] After enabling the long screenshot function, while the first application displays user interface 2, the scrolling screenshot application can perform a second screenshot operation to obtain screenshot image 2, which includes the content displayed in user interface 2. For example, user interface 2 can be the user interface shown in Figure 8C.

[0302] For example, when screenshot image 1 can be screenshot image 1 as shown in Figure 9A, screenshot image 2 can be screenshot image 2 as shown in Figure 9B. Screenshot image 2 includes a status bar 311, an application header area 312, page content 315, and an application bottom area 314.

[0303] Optionally, S1012 A may be executed before S1010 A or S1011 A, or simultaneously with S1010 A or S1011 A, etc., and this application does not limit this.

[0304] S1013A: The scrolling screenshot application determines the height of the overlapping area 1 of screenshot image 1 and screenshot image 2 based on the difference between the cumulative scrolling distance 2 and the cumulative scrolling distance 1 and the height of the first scrolling view control. Based on the height of the overlapping area 1, the overlapping area 1 of screenshot image 1 or screenshot image 2 is cropped and then stitched together to obtain a long screenshot. The long screenshot only includes one overlapping area 1.

[0305] For example, the overlapping region 1 of screenshot image 1 and screenshot image 2 can be the overlapping region 1 shown in Figure 9C.

[0306] For the scrolling screenshot application, how to obtain a long screenshot by stitching screenshot image 1, screenshot image 2 and repeating area 1 together, please refer to the description of S1013B in the embodiment of Figure 10B, which will not be repeated here.

[0307] Optionally, after obtaining two screenshots for each screenshot, the scrolling screenshot application can stitch these two screenshots together to obtain a long screenshot. Optionally, if both screenshots include a fixed bottom area, the scrolling screenshot application will not stitch the fixed bottom area before disabling the long screenshot function. If the scrolling screenshot application obtains a third screenshot, it can calculate the overlapping area of ​​the scrolling area of ​​the second and third screenshots. In one possible implementation, the scrolling screenshot application can subtract this overlapping area from the scrolling area of ​​the third screenshot to obtain a cropped scrolling area, and then stitch the cropped scrolling area to the end of the long screenshot obtained based on the first two screenshots to obtain the long screenshot obtained from the first three screenshots. In other possible implementations, the scrolling screenshot application can subtract the overlapping area from the long screenshot obtained from the first two screenshots to get a cropped long screenshot. Then, the scrolling area of ​​the third screenshot is appended to the cropped long screenshot to obtain the long screenshot obtained from the first three screenshots. This process continues until the long screenshot function ends, at which point the scrolling screenshot application appends the fixed bottom area to the end of the long screenshot, resulting in the long screenshot obtained in this specific long screenshot operation.

[0308] It should be noted that this application does not impose any restrictions on the order of execution of the steps in the method shown in Figure 10A.

[0309] Figure 10B shows a flowchart illustrating how another electronic device 100 obtains a long screenshot after enabling the long screenshot function.

[0310] Figure 10B can be seen as a flowchart illustrating how to obtain long screenshots for the k-th and (k+1)-th screenshot operations. Here, k is a positive integer greater than 1.

[0311] As shown in Figure 10B, the electronic device 100 includes an application layer and an application framework layer. The application layer includes a scrolling screenshot application and a first application, and the application framework layer includes accessibility system services.

[0312] In some embodiments, accessibility system services may also be referred to as first system services.

[0313] The method shown in Figure 10B includes, but is not limited to, the following steps:

[0314] S1001B, The first application displays and controls the first long page to scroll a first distance in a first direction and displays the user interface k, the user interface k including the page content C of the first long page.

[0315] Optionally, before the first application controls the first long page to scroll a first distance in the first direction, the scrolling screenshot application can send a second message to the first application, the second message carrying the second distance. After receiving the second message, the first application then controls the first long page to scroll a first distance in the first direction.

[0316] Optionally, the app taking a scrolling screenshot may not send a second message to the first app. After enabling the long screenshot feature, the first app can periodically / irregularly control the first long page to scroll a first distance in the first direction.

[0317] Optionally, the scroll distance of the first long page can be the same or different each time.

[0318] Optionally, the first long page can scroll (k-1) times before displaying the user interface k. When the first application displays the user interface k, the scrolling screenshot application will perform the k-th screenshot operation.

[0319] For example, when k equals 2, the first long page scrolls once before displaying the user interface k. When the first application displays the user interface k, the scrolling screenshot application will perform a second screenshot operation. The first application can be a social application, and the user interface k can be the user interface shown in Figure 8C. The page content C of the first long page can be page content 315 shown in Figure 8C, and the first long page can be the long page containing page content 315 shown in Figure 8C.

[0320] S1002B, The first application sends the interface layout information of the user interface k to the accessibility system service, including the cumulative scroll distance k of the first scroll view control.

[0321] After the first application displays the user interface k, the first application can obtain the interface layout information of the user interface k and send it to the accessibility system service.

[0322] In some embodiments, the accessibility system service can perform system operations based on the interface layout information of the user interface k, such as broadcasting the content displayed in the user interface, so that the user can obtain the content of the user interface k displayed by the first application through the voice content broadcast by the accessibility system service.

[0323] For example, the interface layout information of user interface k includes, but is not limited to, the positional relationship of multiple view controls in user interface k, the names of the view controls, the types of the view controls, the elements displayed in the view controls, and the cumulative scrolling distance k of the first scrolling view control. For instance, the positional relationship of multiple view controls can be similar to the positional relationship of multiple view controls shown in Figure 3.

[0324] Generally, the first scroll view control can be the root node among multiple view controls. Electronic device 100 can obtain the root node among multiple view controls in the user interface k. If the root node among the multiple view controls includes any of the following types: Linear Layout control, ListView control, GridView control, RecyclerView control, ViewPager control, WebView control, etc., then the root node among the multiple view controls can be determined as the first scroll view control.

[0325] It should be noted that the scroll view control can also be of other types, and this application does not limit it.

[0326] After identifying the first scroll view control, the first application can obtain the name of the first scroll view control, its cumulative scroll distance k, etc. The cumulative scroll distance k of the first view control represents the cumulative scroll distance of the long page of the first application in the first direction. For example, when the long page of the first application scrolls continuously in the first direction, the cumulative scroll distance of the first view control gradually increases. If the long page of the first application then scrolls in a second direction, the cumulative scroll distance of the first scroll view control needs to be subtracted from the distance the long page of the first application scrolls in the second direction.

[0327] For example, when k equals 2, electronic device 100 has already performed a screenshot operation. The first application is a social application, and the first application displays the user interface shown in Figure 8C. The first view control displays the page content 315 shown in Figure 8C. The cumulative scroll distance k of the first view control is equal to the first distance.

[0328] Optionally, after the long page of the first application is scrolled, the content of the user interface displayed by the first application will change, and the scrolling distance of the first scroll view control will also change. The first application can then send the interface layout information of the changed user interface to the accessibility system service, so that the accessibility system service can broadcast the content displayed in the changed user interface of the first application in a timely manner.

[0329] S1003B, The scrolling screenshot application obtains the interface layout information of the user interface k from the accessibility system service.

[0330] The scrolling screenshot application can periodically obtain the interface layout information of the user interface in the first application from the accessibility system service. The scrolling screenshot application can obtain the cumulative scroll distance k of the first scroll view control from the interface layout information of the user interface k. The cumulative scroll distance k of the first scroll view control is used to determine the height of the overlapping area in the page scrolling area of ​​two adjacent screenshot images.

[0331] Optionally, the scrolling screenshot application may also obtain the cumulative scroll distance k of the first scroll view control only from the accessibility system service.

[0332] Optionally, after the user interface displayed by the first application changes, the first application can send the interface layout information of the changed user interface to the accessibility system service, and the scrolling screenshot application can then obtain the interface layout information of the changed user interface from the accessibility system service.

[0333] S1004B, The scrolling screenshot application executes the k-th screenshot to obtain screenshot image k.

[0334] When the first application displays the user interface k, the scrolling screenshot application can perform the k-th screenshot operation to obtain screenshot image k, which includes the content displayed in the user interface k. K is a positive integer greater than 1.

[0335] For example, when k equals 2, the scrolling screenshot application can perform a second screenshot to obtain screenshot image 2. User interface 2 can be the user interface shown in Figure 8C, and screenshot image 2 can be the screenshot image 2 shown in Figure 9B. Screenshot image 2 includes status bar 311, application header area 312, page content 315, and application bottom area 314.

[0336] Optionally, S1004B can be executed simultaneously with S1002B or S1003B, or before S1002B or S1003B.

[0337] S1005B: The scrolling screenshot application performs the (k+1)th screenshot to obtain a screenshot image k+1 containing the user interface k+1, and obtains the interface layout information of the user interface k+1, including the cumulative scrolling distance k+1 of the first scrolling view control.

[0338] After obtaining the screenshot image k, the first application can continue scrolling the first long page. In one possible implementation, the first application can scroll the first long page only after receiving a second message from the application that is scrolling the screenshot. In other possible implementations, the first application can also automatically scroll the first long page at fixed intervals or at random intervals without receiving a second message from the application that is scrolling the screenshot.

[0339] For example, after obtaining screenshot image k, the scrolling screenshot application will perform the k-th scroll of the first long page and display user interface k+1. While displaying user interface k+1, the first application can send the interface layout information of user interface k+1 to the accessibility system service. The scrolling screenshot application can then obtain the interface layout information of user interface k+1 from the accessibility system service.

[0340] When the user interface k+1 is displayed, the scrolling screenshot application can perform the (k+1)th screenshot to obtain the screenshot image k+1 of the user interface k.

[0341] This application does not restrict the order in which the scrolling screenshot application obtains the screenshot image k+1 containing the user interface k+1 and the interface layout information of the user interface k+1.

[0342] For example, the interface layout information of user interface k+1 includes, but is not limited to, the positional relationship of multiple view controls in user interface k+1, the names of the view controls, the types of the view controls, the elements displayed in the view controls, and the cumulative scrolling distance k+1 of the first scrolling view control. For example, the positional relationship of multiple view controls can be similar to the positional relationship of multiple view controls shown in Figure 3.

[0343] For example, if after the first application displays user interface k, the first long page scrolls a first distance in a first direction, then the cumulative scroll distance k+1 equals the cumulative scroll distance k plus the first distance. If after the first application displays user interface k, the first long page scrolls a first distance in a second direction, then the cumulative scroll distance k+1 equals the cumulative scroll distance k minus the first distance. The second direction is the direction opposite to the first direction.

[0344] For example, when k equals 2, the scrolling screenshot application can perform a third screenshot to obtain screenshot image 3. User interface 3 can be the user interface shown in Figure 8D, and screenshot image 3 can be the screenshot image 3 shown in Figure 9F. Screenshot image 3 includes status bar 311, application header area 312, page content 316, and application bottom area 314.

[0345] S1006B, If the preset conditions are met, the scrolling screenshot application will disable the long screenshot function.

[0346] Optionally, the preset conditions may include, but are not limited to, any of the following;

[0347] Condition 1: The gesture recognition module recognizes user actions used to disable the long screenshot function.

[0348] In some embodiments, when it is necessary to disable the long screenshot function, the electronic device 100 can receive a user operation on the display screen to disable the long screenshot function. For example, the user operation to disable the long screenshot function may be a click operation on the display screen as shown in FIG8D. In response to the user operation to disable the long screenshot function, the gesture recognition module sends a message to the scrolling screenshot application. In response to the message, the scrolling screenshot application disables the long screenshot function.

[0349] Condition 2: When the length of the long screenshot obtained by the scrolling screenshot application is greater than the preset length, the scrolling screenshot application will disable the long screenshot function.

[0350] Condition 3: When the first application detects that it has scrolled to the bottom of the first long page, it can send a message to the scrolling screenshot application. In response to this message, the scrolling screenshot application disables the long screenshot function.

[0351] The preset conditions are not limited to the above conditions; other conditions may also be preset, and this application does not limit them.

[0352] S1007B, In response to disabling the long screenshot function, the scrolling screenshot application sends a message to the first application, which instructs the first application to stop scrolling the first long page.

[0353] After the long screenshot feature is turned off, the scrolling screenshot app can send message 3 to the first app, which instructs the first app to stop scrolling the first long page.

[0354] For example, after the long screenshot function is turned off, the first application can continuously display the page content 316 of the first long page shown in Figure 8D.

[0355] Optionally, S10066B and S1007B may not be executed.

[0356] S1008B: The scrolling screenshot application determines the overlapping area k of screenshot image k and screenshot image k+1 based on the height of the first scrolling view control, the cumulative scrolling distance k, and the cumulative scrolling distance k+1. A long screenshot is obtained by stitching screenshot image k, screenshot image k+1, and overlapping area k together.

[0357] After obtaining screenshot image k and screenshot image k+1, the scrolling screenshot application can determine the height of the overlapping area k of screenshot image k and screenshot image k+1 based on the difference between the cumulative scroll distance k and the cumulative scroll distance k+1 and the height of the first scroll view control. Then, based on the height of the overlapping area k, the overlapping area k of the page scrolling area of ​​screenshot image k and screenshot image k+1 is determined, thus avoiding the overlapping area k appearing multiple times in the long screenshot obtained by the electronic device 100 based on screenshot image k and screenshot image k+1.

[0358] The height of the repeating area in a scrolling screenshot application can be obtained as follows: Height of the first scrolling view control - (Cumulative scroll distance k+1 - Cumulative scroll distance k). Here, cumulative scroll distance k+1 - cumulative scroll distance k can represent the height of the first page content appearing in the scrolling area, or the distance scrolled on the first long page for the kth time, or the height of the non-repeating area of ​​the scrolling area at the (k+1)th screenshot and the (k)th screenshot. Subtracting the height of the non-repeating area from the height of the first scrolling view control yields the height of the repeating area.

[0359] For example, when screenshot image k is screenshot image 2 and screenshot image k+1 is screenshot image 3, the overlapping region k of screenshot image k and screenshot image k+1 can be the overlapping region 2 shown in Figure 9G. The height of the overlapping region 2 can be determined by referring to the description in the embodiment of Figure 9I.

[0360] Optionally, in S1003B or S1005B, when the scrolling screenshot application obtains the interface layout information of user interface k or user interface k+1, it can obtain a first scroll view control and determine the page scrolling area of ​​the screenshot image k based on the area where the first scroll view control is located. Then, the areas in the screenshot image k other than the page scrolling area are considered non-page scrolling areas. Similarly, the scrolling screenshot application can also determine the page scrolling area and non-page scrolling area of ​​the screenshot image k+1. The page scrolling area of ​​screenshot image k and the page scrolling area of ​​screenshot image k+1 can be the same. Optionally, the non-page scrolling area of ​​screenshot image k and the non-page scrolling area of ​​screenshot image k+1 can be the same or different. This application uses the example of the non-page scrolling area of ​​screenshot image k and the non-page scrolling area of ​​screenshot image k+1 being the same for illustration.

[0361] In some embodiments, the non-scrollable area may include a fixed header area and / or a fixed bottom area. The scrollable area may be located below the fixed header area or above the fixed bottom area. The display positions of view controls in the fixed header and bottom areas may remain fixed. The page content displayed in the scrollable area may scroll in a first direction, meaning the display positions of view controls in the scrollable area may change.

[0362] For example, the fixed header area may include a status bar 311 and an application header area 312. The fixed bottom area may include an application bottom area 314. The status bar 311, application header area 312, and application bottom area 314 can be referred to the description in the foregoing embodiments. Optionally, the fixed bottom area may also include view controls such as a bottom desktop navigation bar provided by the system application. This application embodiment does not limit the content included in the fixed header and fixed bottom areas.

[0363] In some embodiments, screenshot image k and screenshot image k+1 may include only the page scroll area and exclude the non-page scroll area.

[0364] In one possible implementation, after determining the height of the repeating region k, the scrolling screenshot application can use the page content at the bottom of the scrolling area of ​​screenshot image k, which is equal to the height of the repeating region k, as the repeating region k, and then crop this part of the content from screenshot image k. This results in the first cropped area. Afterwards, the scrolling screenshot application can sequentially stitch together the fixed header area, the first cropped area, the scrolling area of ​​screenshot image k+1, and the fixed bottom area to obtain a long screenshot.

[0365] In other possible implementations, after determining the height of the repeating region k, the scrolling screenshot application can use the page content at the top of the scrolling area of ​​screenshot image k+1, with the height of the repeating region k, as the repeating region k, and then crop this part of the content in screenshot image k+1 to obtain the second cropped area. Afterwards, the scrolling screenshot application can sequentially stitch together the fixed header area, the scrolling area of ​​screenshot image k, the second cropped area, and the fixed bottom area to obtain a long screenshot.

[0366] Optionally, after each screenshot operation, the scrolling screenshot application can stitch together the fixed header area and the page scrolling areas obtained from the two previous screenshots to create a long screenshot excluding the fixed tail area. This continues until the end of the screenshot is detected, at which point the scrolling screenshot application stitches back the fixed tail area, resulting in a long screenshot including the fixed tail area. When the scrolling screenshot application can perform the (k+2)th screenshot operation, it can obtain screenshot image k+2. Based on screenshot images k+1 and k+2, the scrolling screenshot application can determine the height of the overlapping area of ​​the page scrolling areas of screenshot image k+1 and screenshot image k+2. Then, based on the height of the overlapping area of ​​the page scrolling areas of screenshot images k+1 and k+2, the application can crop the content of the page scrolling area of ​​screenshot image k+2 to obtain a third cropped area. This third cropped area is then stitched below the aforementioned long screenshot excluding the fixed tail area. This process continues until the end of the screenshot is detected, at which point the scrolling screenshot application stitches back the fixed tail area.

[0367] In other embodiments, the scrolling screenshot application can also crop the content of the scrolling area of ​​screenshot image k+1 based on the height of the overlapping area of ​​the scrolling areas of screenshot image k+1 and screenshot image k+2, and then stitch them together to obtain a long screenshot excluding the fixed tail area. How to obtain a new long screenshot based on screenshot image k, screenshot image k+1, and screenshot image k+2 is similar to the implementation of obtaining a long screenshot by stitching screenshot image k and screenshot image k+1, and will not be described in detail here.

[0368] As can be seen, when taking a scrolling screenshot, the electronic device 100 can determine the height of the repeated area in the scrolling area of ​​a long page between two adjacent screenshots based on the difference in the cumulative scrolling distance of the scrolling view control in the two screenshots and the height of the scrolling view control. Furthermore, the electronic device can crop the repeated area from one of the two adjacent screenshots based on the height of the repeated area. That is to say, the cumulative scrolling distance and height of the scrolling view control can be determined without doubt and are not affected by changes in the displayed content of dynamic elements. Regardless of whether there are dynamic elements on the page, the electronic device can accurately identify the repeated area in two adjacent screenshots based on the scrolling distance of the view control. Moreover, when the view control on the application page changes due to application updates, the above method can reduce the impact of dynamic elements and view control updates on the identification of repeated areas, improving the success rate of scrolling screenshots and enhancing the user experience of the scrolling screenshot function.

[0369] Figure 11 shows a flowchart of a scrolling screenshot method.

[0370] S1101, The electronic device displays a first user interface of a first application, the first user interface including the first page content of a first long page of the first application.

[0371] S1102, The electronic device obtains the first cumulative scroll distance of the first scroll view control in the first user interface.

[0372] S1103, The electronic device acquires the first screenshot image of the first user interface.

[0373] S1104. The electronic device scrolls through a first long page and displays a second user interface of a first application. The second user interface includes the second page content of the first long page, and the second page content and the first page content have a first overlapping area.

[0374] S1105, The electronic device obtains the second cumulative scroll distance of the first scroll view control in the second user interface.

[0375] S1106. The electronic device acquires a second screenshot image of the second user interface.

[0376] S1107. The electronic device determines the first repeating area based on the height of the first scroll view control, the first cumulative scroll distance, and the second cumulative scroll distance.

[0377] S1108. The electronic device obtains a first long screenshot based on the first screenshot image, the second screenshot image, and the first overlapping area.

[0378] Some steps in the above embodiments can be replaced by other methods in the art that can achieve the same effect, or, provided that the long screenshot function can be achieved, a certain step in the above embodiments can be omitted.

[0379] Optionally, the first and second screenshots can be taken from two consecutive screenshots.

[0380] For example, the first screenshot image can be screenshot image 1 obtained from the first screenshot as shown in Figure 10A, and the second screenshot image can be screenshot image 2 obtained from the second screenshot as shown in Figure 10A. For how to obtain the first long screenshot based on screenshot image 1 and screenshot image 2, please refer to the description in the embodiment of Figure 10A.

[0381] For example, the first user interface can be the user interface shown in Figure 8A, the second user interface can be the user interface shown in Figure 8C, the first screenshot image can be screenshot image 1 shown in Figure 9A, and the second screenshot image can be screenshot image 2 shown in Figure 9B.

[0382] For example, the first screenshot image can be screenshot image k obtained from the kth screenshot as shown in Figure 10B, and the second screenshot image can be screenshot image k+1 obtained from the (k+1)th screenshot as shown in Figure 10B. For how to obtain the first long screenshot based on screenshot image k and screenshot image k+1, please refer to the description in the embodiment of Figure 10B.

[0383] For example, the first user interface can be the user interface shown in Figure 8C, the second user interface can be the user interface shown in Figure 8D, the first screenshot image can be screenshot image 2 shown in Figure 9B, and the second screenshot image can be screenshot image 3 shown in Figure 9E.

[0384] Optionally, in addition to obtaining the first cumulative scroll distance of the first scroll view control, other interface layout information of the first user interface can also be obtained, such as any one or more of the following: the positional relationship of multiple view controls in the first user interface, the name of the view control, the type of the view control, and the elements displayed in the view control. For example, the positional relationship of multiple view controls can be similar to the positional relationship of multiple view controls shown in Figure 3.

[0385] Optionally, in addition to obtaining the second cumulative scroll distance of the first scroll view control, other interface layout information of the second user interface can also be obtained, such as any one or more of the following: the positional relationship of multiple view controls in the second user interface, the name of the view control, the type of the view control, and the elements displayed in the view control. For example, the positional relationship of multiple view controls can be similar to that shown in Figure 3.

[0386] Optionally, the cumulative scroll distance of the first long page can be used as the cumulative scroll distance of the first scroll view control. When the first long page scrolls in the first direction, the cumulative scroll distance of the first scroll view control can be added to the scroll distance of the first long page at this time. When the first long page scrolls in the second direction, the cumulative scroll distance of the first scroll view control needs to be subtracted from the scroll distance of the first long page at this time.

[0387] Optionally, whenever the user interface displayed by the first application changes, such as when the cumulative scroll distance of the first long page changes each time it is scrolled, the class scroll distance of the first scroll view control will also change.

[0388] Using this method, electronic devices can identify the scroll view control on the page each time a screenshot is taken, and record the cumulative scroll distance of the scroll view control. By using the height of the scroll view control and the cumulative scroll distance of the scroll view control obtained from two consecutive screenshots, the overlapping area of ​​the screenshot images obtained from the two consecutive screenshots can be determined.

[0389] In one possible implementation, the electronic device determines the first repeating area based on the height of the first scroll view control, the first cumulative scroll distance, and the second cumulative scroll distance. Specifically, the electronic device calculates the difference between the first cumulative scroll distance and the second cumulative scroll distance to obtain the first distance of the first long page scroll; the electronic device determines the height of the first repeating area based on the difference between the height of the first scroll view control and the first distance; and the electronic device determines the first repeating area based on the height of the first repeating area.

[0390] For example, the first repeating region can be repeating region 1 as shown in FIG9C. The height of repeating region 1 can be determined by referring to the description in the embodiment of FIG9E.

[0391] For example, the first repeating region can be repeating region 2 as shown in FIG9G. The height of repeating region 2 can be determined by referring to the description in the embodiment of FIG9I.

[0392] In this way, by using the height of the scroll view control and the cumulative scroll distance of the scroll view control obtained from the two screenshots, the height of the overlapping area of ​​the screenshot images obtained from the two screenshots is determined, and then the overlapping area of ​​the screenshot images obtained from the two screenshots is determined based on the height of the overlapping area.

[0393] In one possible implementation, before acquiring the first screenshot image of the first user interface, the method further includes: the electronic device receiving an operation to enable long screenshot; the electronic device acquiring the first screenshot image of the first user interface specifically includes: in response to the operation to enable long screenshot, the electronic device acquiring the first screenshot image of the first user interface.

[0394] For example, the operation to enable a long screenshot can be a preset gesture, such as drawing an "S" shape on the first user interface.

[0395] In one possible implementation, the electronic device obtains a first long screenshot based on a first screenshot image, a second screenshot image, and a first overlapping region. Specifically, the electronic device crops out the overlapping region in the content of the first page and stitches the processed first page content and the second screenshot image together to obtain the first long screenshot; or, the electronic device crops out the overlapping region in the content of the second page and stitches the first screenshot image and the processed second page content together to obtain the first long screenshot.

[0396] In one possible implementation, the areas in the first and second user interfaces other than the scrollable area are non-scrollable areas. These non-scrollable areas include a fixed top area and / or a fixed bottom area. The scrollable area is located below the fixed top area and above the fixed bottom area. The electronic device crops out the repetitive areas of the first page content and stitches the processed first page content and the second screenshot image together to obtain a first long screenshot. Specifically, this includes: the electronic device crops out the repetitive areas of the first page content and stitches the first long screenshot sequentially according to the fixed top area, the processed first page content, the second page content, and the fixed bottom area; or, the electronic device crops out the repetitive areas of the second page content and stitches the first long screenshot based on the first screenshot image and the processed second page content. Specifically, this includes: the electronic device crops out the repetitive areas of the second page content and stitches the first long screenshot sequentially according to the fixed top area, the first page content, the processed second page content, and the fixed bottom area. In this way, the electronic device can stitch two screenshot images obtained from previous and subsequent screenshots to obtain a long screenshot, ensuring that the repetitive areas appear only once in the long screenshot.

[0397] In one possible implementation, the electronic device includes a first application, a scrolling screenshot application, and a first system service; the electronic device obtains a first cumulative scroll distance of a first scrolling view control in a first user interface, specifically including: the first application of the electronic device sending the first cumulative scroll distance of the first scrolling view control to the first system service; the scrolling screenshot application of the electronic device obtaining the first cumulative scroll distance of the first scrolling view control from the first system service; the electronic device obtains a second cumulative scroll distance of the first scrolling view control in a second user interface, specifically including: the first application of the electronic device sending the second cumulative scroll distance of the first scrolling view control to the first system service; the scrolling screenshot application of the electronic device obtaining the second cumulative scroll distance of the first scrolling view control from the first system service; the electronic device determines a first repeating area based on the height of the first scrolling view control, the first cumulative scroll distance, and the second cumulative scroll distance, specifically including: the scrolling screenshot application of the electronic device determining the first repeating area based on the height of the first scrolling view control, the first cumulative scroll distance, and the second cumulative scroll distance.

[0398] In some embodiments, the first system service may also be referred to as the accessibility system service.

[0399] Optionally, the first application is not limited to sending the first cumulative scroll distance of the first scroll view control to the first system service, but may also send any one or more of other interface layout information of the first user interface, such as the positional relationship of multiple view controls in the first user interface, the name of the view control, the type of the view control, and the elements displayed in the view control, to the first system service.

[0400] Optionally, the first application is not limited to sending the second cumulative scroll distance of the first scroll view control to the first system service, but may also send any one or more of other interface layout information of the second user interface, such as the positional relationship of multiple view controls in the second user interface, the name of the view control, the type of the view control, and the elements displayed in the view control, to the first system service.

[0401] Optionally, the first application may periodically or irregularly send the user interface layout information to the first system service.

[0402] Optionally, whenever the user interface displayed by the first application changes, the first application needs to send the interface layout information of the changed user interface to the first system service.

[0403] After enabling the long screenshot function, the scrolling screenshot application can obtain the interface layout information of the user interface from the first system service, and then obtain the cumulative scrolling distance of the first scrolling view control from the interface layout information of the user interface, and then calculate the overlapping area of ​​the two screenshot images.

[0404] Optionally, whenever the user interface displayed by the first application changes, the scrolling screenshot application also needs to obtain the interface layout information after the user interface changes from the first system service.

[0405] Using this method, the scrolling screenshot application can obtain the interface layout information of the user interface displayed by the first application through the first system service, and then obtain the cumulative scrolling distance of the first scrolling view control in the user interface displayed by the first application.

[0406] In one possible implementation, before the electronic device scrolls the first long page within the page scrolling area where the first scroll view control is located, the method further includes: the electronic device's scrolling screenshot application sending a second message to a first application, the second message carrying a second distance; in response to the second message, the first application of the electronic device controlling the first long page to scroll in a first direction a first distance within the page scrolling area, the first distance being the same as or different from the second distance, the first distance being equal to the difference between the second cumulative scrolling distance and the first cumulative scrolling distance.

[0407] In this way, after enabling the long screenshot feature, the scrolling screenshot app can control the first app to scroll the first long page. That is, before the first app scrolls the first long page each time, the scrolling screenshot app needs to send a second message to the first app. After receiving the second message, the first app scrolls the first long page again, the scrolling screenshot app captures a screenshot, and then sends the second message to the first app. This process continues until the long screenshot feature is disabled.

[0408] Optionally, a second message can be omitted. With long screenshot functionality enabled, the app taking the scrolling screenshot only needs to send a second message to the first app once. Afterward, the first app can automatically scroll the first long page periodically or at regular intervals.

[0409] In one possible implementation, the type of the first scrolling view control includes any of the following: linear layout control, ListView control, grid view control, loop view control, view pagination control, and webpage control.

[0410] Optionally, when displaying the user interface, the first application can obtain the type of each view control displayed in the user interface. If the type of the first scroll view control among the view controls includes any of the above, the first application can record the cumulative scrolling distance of the first scroll view control in the interface layout information of the user interface.

[0411] In one possible implementation, the scrolling area of ​​the first user interface includes m view controls, and the first scrolling view control is the root view control of (m-1) view controls; the scrolling area of ​​the second user interface includes n view controls, and the first scrolling view control is the root view control of (n-1) view controls.

[0412] Optionally, when displaying the user interface, the first application can also obtain the relationship between the various view controls displayed in the user interface, and obtain the root view control, such as the first scroll view control. If the type of the first scroll view control includes any of the above, the first application can record the cumulative scroll distance of the first scroll view control in the interface layout information of the user interface.

[0413] For example, the first scroll view control can be view control 1 as shown in Figure 3.

[0414] In one possible implementation, the first screenshot image is the image obtained when the electronic device performs the k-th screenshot, and the first cumulative scroll distance includes the cumulative scroll distance of the previous (k-1) first long pages.

[0415] The second screenshot is the image obtained when the electronic device performs the (k+1)th screenshot. The second cumulative scroll distance includes the cumulative scroll distance of the first long page in the previous k steps.

[0416] In one possible implementation, when the first long page is slid in a first direction, the sliding distance of the first long page is a positive value, and when the first long page is slid in a second direction, the sliding distance of the first long page is a negative value, and the second direction is the opposite of the first direction.

[0417] In one possible implementation, the first long page is scrolled automatically by the electronic device, or the first long page is scrolled by the electronic device in response to an operation for scrolling the first long page.

[0418] This application provides an electronic device, which includes one or more processors and one or more memories; the one or more memories are coupled to one or more processors, and the one or more memories are used to store computer program code, which includes computer instructions. When the one or more processors execute the computer instructions, the electronic device performs a scrolling screenshot method as shown in FIG11.

[0419] This application provides a computer-readable storage medium including instructions that, when executed on an electronic device, cause the electronic device to perform a scrolling screenshot method as shown in FIG11.

[0420] This application provides a computer program product that may contain computer instructions that, when executed on an electronic device, cause the electronic device to perform a scrolling screenshot method as shown in FIG11.

[0421] This application provides a chip for use in an electronic device. The chip includes one or more processors, which are used to invoke computer instructions to cause the electronic device to execute a scrolling screenshot method as shown in FIG11.

[0422] It is understood that the user interfaces described in the embodiments of this application are merely example interfaces and do not constitute a limitation on the solution of this application. In other embodiments, the user interface may adopt different interface layouts, may include more or fewer controls, and may add or remove other functional options, as long as they are based on the same inventive concept provided in this application, they are all within the protection scope of this application.

[0423] It should be noted that, without causing contradictions or conflicts, any feature in any embodiment of this application, or any part of any feature, can be combined, and the combined technical solution is also within the scope of the embodiments of this application.

[0424] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A scrolling screenshot method, characterized in that, The method includes: The electronic device displays a first user interface of a first application, the first user interface including the first page content of a first long page of the first application; The electronic device acquires the first cumulative scroll distance of the first scroll view control in the first user interface; The electronic device acquires a first screenshot image of the first user interface; The electronic device scrolls the first long page and displays the second user interface of the first application. The second user interface includes the second page content of the first long page, and the second page content and the first page content have a first overlapping area. The electronic device acquires the second cumulative scroll distance of the first scroll view control in the second user interface; The electronic device acquires a second screenshot of the second user interface; The electronic device determines the first repeating area based on the height of the first scrolling view control, the first cumulative scrolling distance, and the second cumulative scrolling distance; The electronic device obtains a first long screenshot based on the first screenshot image, the second screenshot image, and the first repeated area.

2. The method according to claim 1, characterized in that, The electronic device determines the first repeating area based on the height of the first scrolling view control, the first cumulative scrolling distance, and the second cumulative scrolling distance, specifically including: The electronic device calculates the difference between the first cumulative scrolling distance and the second cumulative scrolling distance to obtain the first distance of scrolling the first long page; The electronic device determines the height of the first repeating area based on the difference between the height of the first scroll view control and the first distance; The electronic device determines the first repeating region based on the height of the first repeating region.

3. The method according to claim 1 or 2, characterized in that, Before acquiring the first screenshot image of the first user interface, the method further includes: The electronic device receives the operation to enable a long screenshot; The electronic device acquires a first screenshot image of the first user interface, specifically including: In response to the operation of enabling long screenshot, the electronic device acquires the first screenshot image of the first user interface.

4. The method according to any one of claims 1-3, characterized in that, The electronic device generates a first long screenshot based on the first screenshot image, the second screenshot image, and the first overlapping region, specifically including: The electronic device crops out the repeated areas in the content of the first page, and stitches together the processed content of the first page and the second screenshot image to obtain a first long screenshot; or, The electronic device cuts out the repeated areas in the content of the second page, and splices the first long screenshot based on the first screenshot image and the processed content of the second page.

5. The method according to claim 4, characterized in that, In the first user interface and the second user interface, the areas other than the page scrolling area are non-page scrolling areas. The non-page scrolling areas include a top fixed area and / or a bottom fixed area. The page scrolling area is located below the top fixed area and above the bottom fixed area. The electronic device crops out the repetitive areas in the content of the first page, and stitches together the processed content of the first page and the second screenshot image to obtain a first long screenshot, specifically including: The electronic device cuts out the repeated areas in the content of the first page, and then stitches them together in sequence according to the top fixed area, the processed content of the first page, the content of the second page, and the bottom fixed area to obtain the first long screenshot; or, The electronic device cuts out the repetitive areas in the content of the second page, and stitches the first long screenshot together with the first screenshot image and the processed content of the second page to obtain the first long screenshot, specifically including: The electronic device cuts out the repeated areas in the content of the second page, and then splices them together in sequence according to the top fixed area, the content of the first page, the processed content of the second page, and the bottom fixed area to obtain the first long screenshot.

6. The method according to any one of claims 1-5, characterized in that, The electronic device includes a first application, a scrolling screenshot application, and a first system service; The electronic device acquires the first cumulative scroll distance of the first scroll view control in the first user interface, specifically including: The first application of the electronic device sends the first cumulative scroll distance of the first scroll view control to the first system service; The scrolling screenshot application of the electronic device obtains the first cumulative scrolling distance of the first scrolling view control from the first system service; The electronic device acquires the second cumulative scroll distance of the first scroll view control in the second user interface, specifically including: The first application of the electronic device sends the second cumulative scroll distance of the first scroll view control to the first system service; The scrolling screenshot application of the electronic device obtains the second cumulative scrolling distance of the first scrolling view control from the first system service; The electronic device determines the first repeating area based on the height of the first scrolling view control, the first cumulative scrolling distance, and the second cumulative scrolling distance, specifically including: The scrolling screenshot application of the electronic device determines the first repeating area based on the height of the first scrolling view control, the first cumulative scrolling distance, and the second cumulative scrolling distance.

7. The method according to claim 6, wherein before the electronic device scrolls the first long page within the page scrolling area where the first scroll view control is located, the method further comprises: The scrolling screenshot application of the electronic device sends a second message to the first application, the second message carrying a second distance; In response to the second message, the first application of the electronic device controls the first long page to scroll a first distance in a first direction within the page scrolling area. The first distance may be the same as or different from the second distance, and the first distance is equal to the difference between the second cumulative scrolling distance and the first cumulative scrolling distance.

8. The method according to any one of claims 1-7, characterized in that, The first type of scroll view control includes any of the following: linear layout control, ListView control, grid view control, loop view control, view pagination control, and web page control.

9. The method according to any one of claims 1-8, characterized in that, The first user interface's page scrolling area includes m view controls, and the first scrolling view control is the root view control of (m-1) view controls; The second user interface's scrolling area includes n view controls, and the first scrolling view control is the root view control of (n-1) view controls.

10. The method according to any one of claims 1-9, characterized in that, The first screenshot image is the image obtained when the electronic device performs the kth screenshot, and the first cumulative scroll distance includes the cumulative scroll distance of the first long page in the previous (k-1) times.

11. The method according to claim 10, characterized in that, When the first long page slides in the first direction, the sliding distance of the first long page is positive; when the first long page slides in the second direction, the sliding distance of the first long page is negative. The second direction is the opposite of the first direction.

12. The method according to any one of claims 1-11, characterized in that, The first long page is scrolled automatically by the electronic device, or the first long page is scrolled by the electronic device in response to an operation for scrolling the first long page.

13. An electronic device, characterized in that, The electronic device includes a memory and a processor, wherein the memory is used to store a computer program; and the processor is used to invoke the computer program to cause the electronic device to perform the method according to any one of claims 1-12.

14. A computationally readable storage medium, comprising instructions, characterized in that, When the instructions are executed on an electronic device, the electronic device performs the method of any one of claims 1-12.

15. A computer program product, characterized in that, The computer program product includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the method of any one of claims 1-12.

Citation Information

Patent Citations

  • Screen capture method and device, storage medium and electronic equipment

    CN110286830A

  • Screen capture method, graphical interface and electronic equipment

    CN115268741A

  • Screen capture method and device

    CN115617238A

  • Screen capture method, screen capture device, electronic equipment and computer readable storage medium

    CN117389448A

  • Screenshot capturing method, device, electronic device and computer-readable medium

    US20210064222A1