Scrolling screenshot method, electronic device and computer-readable storage medium
By obtaining the position information of the view control to calculate the scroll distance, 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.
Patent Information
- Application Number
- PCT/CN2025/101105
- 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
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.
By obtaining the position information of the view control, calculating the scrolling distance of the view control between two adjacent screenshots, determining the overlapping area and cropping it, and then stitching together a long screenshot.
It improves the success rate and user experience of scrolling screenshots, ensuring that duplicate areas can be accurately identified and cropped even in the presence of dynamic elements, generating complete long screenshots.
Smart Images

Figure CN2025101105_26122025_PF_FP_ABST
Abstract
Description
A scrolling screenshot method, an electronic device, and a computationally readable storage medium
[0001] This application claims priority to Chinese Patent Application No. 202410807274.5, 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 record the position information of view controls in the user interface displayed by a first application. By using the position information of view controls in the user interface obtained from two consecutive screenshots, the overlapping area of the screenshot images obtained from the two screenshots can be determined.
[0006] In a first aspect, this application provides a scrolling screenshot method, applied to an electronic device, the electronic device including a first application, a scrolling screenshot application, and a first system service; the method includes: the first application displaying a first user interface, the first user interface including the content of a first page of a first long page of the first application; the first application sending the position information of m view controls in the first user interface to the first system service; the scrolling screenshot application acquiring a first screenshot image of the first user interface; the scrolling screenshot application acquiring the position information of the m view controls in the first user interface from the first system service; the first application scrolling the first long page and displaying a second user interface, the second user interface including the content of a second page of the first long page of the first application, the content of the second page and the content of the first page having a first overlapping area; the first application sending the position information of n view controls in the second user interface to the first system service; the scrolling screenshot application acquiring a second screenshot image of the second user interface; the scrolling screenshot application acquiring the position information of the n view controls in the second user interface from the first system service; the scrolling screenshot application determining the first overlapping area based on the position information of the m view controls in the first user interface and the position information of the n view controls in the second user interface; 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 position information of m view controls in the first user interface, 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 the m 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 position information of n view controls in the second user interface, 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 the positional relationship of multiple view controls shown in Figure 3.
[0009] Optionally, the scrolling screenshot application can also determine which view controls are common in the first user interface and the second user interface based on the other interface layout information of the m view controls in the first user interface and the position information of the n view controls in the second user interface.
[0010] Optionally, whenever the user interface displayed by the first application changes, such as each time the first long page is scrolled, the position information of some view controls in the first long page will change.
[0011] Optionally, the positional relationship of the view control can refer to the vertical coordinate of the view control on the display coordinate system, and may or may not include the horizontal coordinate of the view control on the display coordinate system.
[0012] Using this method, the electronic device can also obtain the positions of multiple view controls on the page at each screenshot. Based on the positions of these view controls in two adjacent screenshots, the electronic device can calculate the scroll distance between these view controls. The electronic device can then determine the page's scroll distance between these two adjacent screenshots based on the scroll distance of the long page. Furthermore, the electronic device can determine the overlapping region based on the scroll distance of the long page between these two adjacent screenshots and crop the overlapping region from one of the images obtained from the two adjacent screenshots. Afterwards, the electronic device can stitch the cropped images of the overlapping region together to obtain a long screenshot.
[0013] The scroll distance of the aforementioned view controls 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 scroll distances of these multiple view controls. This method improves the success rate of scrolling screenshots and enhances the user experience of the scrolling screenshot function.
[0014] In conjunction with the first aspect, in one possible implementation, the electronic device further includes a gesture recognition module; before the scrolling screenshot application acquires the first screenshot image of the first user interface, the method further includes: the gesture recognition module recognizing a first user operation by which the user enables the long screenshot function; in response to the first user operation, the gesture recognition module sending a first message to the scrolling screenshot application; the scrolling screenshot application acquiring the first screenshot image of the first user interface specifically includes: in response to the first message, the scrolling screenshot application acquiring the first screenshot image of the first user interface.
[0015] 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.
[0016] In conjunction with the first aspect, in one possible implementation, the m view controls include p view controls and o view controls, the n view controls include p view controls and o view controls, the position information of the p view controls in the first user interface is the same as the position information of the p view controls in the second user interface, and the position information of the o view controls in the first user interface is different from the position information of the o view controls in the second user interface.
[0017] Optionally, the scrolling screenshot application can also determine which view controls are identical in the first and second user interfaces based on other interface layout information of the m view controls in the first user interface and the position information of the n view controls in the second user interface, such as the name, type, and displayed elements of the view controls. For example, the scrolling screenshot application can determine that the first and second user interfaces include p identical view controls, and the position information of the p identical view controls is the same. The scrolling screenshot application can also determine that the first and second user interfaces include o identical view controls, and the position information of the o identical view controls is different.
[0018] Optionally, the scrolling screenshot application can determine that the first user interface and the second user interface include different view controls. For example, if some view controls are included in the first user interface but not in the second user interface, then those view controls become invisible as the first long page scrolls. Conversely, if some view controls are included in the second user interface but not in the first user interface, then those view controls first appear in the page scroll area as the first long page scrolls.
[0019] In conjunction with the first aspect, in one possible implementation, the scrolling screenshot application determines the first repeating area based on the position information of m view controls in the first user interface and the position information of n view controls in the second user interface. Specifically, this includes: the scrolling screenshot application determining the area in the first and second user interfaces other than the display area where p view controls are located as the page scrolling area; the scrolling screenshot application determining the first distance of the first long page scrolling based on the difference between the position information of o view controls in the page scrolling area of the first user interface and the position information of o view controls in the page scrolling area of the second user interface; and the electronic device determining the height of the first repeating area based on the height of the page scrolling area and the first distance.
[0020] The electronic device determines the first repeating region based on the height of the first repeating region.
[0021] If the scrolling screenshot application determines that the first and second user interfaces contain p identical view controls, and the position information of these p identical view controls is the same, then the area where these p view controls are located is a non-scrollable area. The other areas in the first user interface besides the non-scrollable areas are the scrollable areas.
[0022] When the scrolling screenshot application determines that the first user interface and the second user interface include o identical view controls, and the position information of the o identical view controls is different, then the o view controls are located within the page scrolling area. The scrolling screenshot application can determine the first distance of scrolling the first long page by the difference between the position information of the o view controls in the page scrolling area of the first user interface and the position information of the o view controls in the page scrolling area of the second user interface.
[0023] After determining the page scroll area, the scrolling screenshot application can determine the height of the page scroll area. After obtaining the first distance of the first long page scroll and the height of the page scroll area, the scrolling screenshot application can determine the height of the first overlapping area of the page scroll area of the first user interface and the page scroll area of the second user interface based on the difference between the height of the page scroll area and the first distance of the first long page scroll, and then determine the first overlapping area.
[0024] Optionally, the scrolling screenshot application can use the page content at the height of the first repeating area at the bottom of the scrolling area of the first user interface as the first repeating area. Optionally, the scrolling screenshot application can also use the page content at the height of the first repeating area at the top of the scrolling area of the second user interface as the first repeating area.
[0025] In conjunction with the first aspect, in one possible implementation, the first distance is less than the height of the page scroll area.
[0026] This avoids situations where the scrolling areas of the first and second user interfaces do not contain the same view controls, making it impossible to determine the first overlapping area. It also avoids situations where the first long page scrolls too much at once, causing the content of a long page to be missed in the long screenshot obtained by stitching the two pages together.
[0027] In conjunction with the first aspect, in one possible implementation, the o view controls include a first view control; the scrolling screenshot application determines the first distance of scrolling the first long page based on the difference between the position information of the o view controls in the scrolling area of the first user interface and the position information of the o view controls in the scrolling area of the second user interface, specifically including: the scrolling screenshot application determines the first distance of scrolling the first long page based on the difference between the position information of the first view control in the scrolling area of the first user interface and the position information of the first view control in the scrolling area of the second user interface.
[0028] Thus, when the scrolling screenshot application determines that the first user interface and the second user interface contain o identical view controls, and the position information of these o identical view controls is different, then these o view controls are located within the page scrolling area, and these o view controls include the first view control. The scrolling screenshot application can determine the first distance of scrolling the first long page by the difference between the position information of the first view control in the page scrolling area of the first user interface and the position information of the first view control in the page scrolling area of the second user interface. By determining the first distance of scrolling the first long page by detecting the difference in the position information of the same view control, the computational load of the electronic device can be reduced, saving power consumption.
[0029] In conjunction with the first aspect, in one possible implementation, the scrolling screenshot application determines the first distance of scrolling the first long page based on the difference between the position information of o view controls in the scrolling area of the first user interface and the position information of o view controls in the scrolling area of the second user interface. Specifically, the scrolling screenshot application determines the first distance of scrolling the first long page based on the mode of the difference between the position information of o view controls in the scrolling area of the first user interface and the position information of o view controls in the scrolling area of the second user interface.
[0030] Understandably, the size and / or layout of the o view controls in the first long page may change as the page scrolls. Therefore, the scroll distance of these o view controls between two adjacent screenshots does not represent the total scroll distance of the first long page between those two screenshots. The mode of the scroll distances of these o view controls can represent the scroll distance of the majority of view controls, providing a more accurate reflection of the scroll distance of the first long page. Therefore, the electronic device can determine the scroll distance of the o view controls and, based on the mode of their scroll distances, determine the scroll distance of the first long page. This improves the accuracy of determining the scroll distance of the first long page.
[0031] In conjunction with the first aspect, in one possible implementation, the scrolling screenshot application determines the first distance of scrolling the first long page based on the difference between the position information of o view controls in the scrolling area of the first user interface and the position information of o view controls in the scrolling area of the second user interface. Specifically, the scrolling screenshot application determines the first distance of scrolling the first long page based on the minimum value of the difference between the position information of o view controls in the scrolling area of the first user interface and the position information of o view controls in the scrolling area of the second user interface.
[0032] In this way, by determining the scroll distance of the first long page based on the minimum difference between the position information of the o view controls in two adjacent screenshots, it is possible to avoid missing the content of a long page based on the long screenshot obtained by stitching together the previous and next screenshots.
[0033] 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 region. Specifically, this includes: the electronic device cropping out the first overlapping region in the content of a 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 first overlapping region in the content of a second page, and stitching the first screenshot image and the processed second page content together to obtain the first long screenshot.
[0034] In conjunction with the first aspect, in one possible implementation, the area containing p view controls in the first or second user interface includes a top fixed area and / or a bottom fixed area, with the page scrolling area located below the top fixed area and above the bottom fixed area; the scrolling screenshot application crops the first duplicate area 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 including: the scrolling screenshot application stitches the top fixed area, the processed first page content, the second page content, and the bottom fixed area together to obtain the first long screenshot; or, the electronic device crops the duplicate area in the second page content and stitches the first screenshot image and the processed second page content together to obtain the first long screenshot, specifically including: the scrolling screenshot application stitches the top fixed area, the first page content, the processed second page content, and the bottom fixed area together to obtain the first long screenshot.
[0035] Optionally, the head fixation area or the bottom fixation area may not be included.
[0036] In this way, electronic devices can stitch together two screenshots obtained from previous and subsequent screenshots to create a long screenshot, ensuring that repeated areas appear only once in the long screenshot.
[0037] In conjunction with the first aspect, in one possible implementation, before the first application scrolls the first long page, the method further includes: the scrolling screenshot application sending a second message to the first application, the second message carrying a second distance; in response to the first message, the first application controlling the first long page to scroll a first distance in a first direction, the first distance being the same as or different from the second distance.
[0038] In this way, after enabling the long screenshot feature, the scrolling screenshot app can control the first app to scroll the first long page. Specifically, before the first app scrolls the first long page each time, the scrolling screenshot app needs to send a first message to the first app. After receiving the first message, the first app then scrolls the first long page, the scrolling screenshot app captures a screenshot, and then sends the first message to the first app again. This process continues until the long screenshot feature is disabled.
[0039] Optionally, the first message can be omitted. With long screenshots enabled, the app taking the screenshot only needs to send the first message to the first app once. Afterward, the first app can periodically or at regular intervals automatically scroll through the first long page.
[0040] In conjunction with the first aspect, in one possible implementation, the first page is scrolled automatically by the electronic device, or the first page is scrolled by the electronic device in response to an operation for scrolling the first long page.
[0041] In conjunction with the first aspect, in one possible implementation, the o view controls are the first-level child view controls of the root view control.
[0042] In conjunction with the first aspect, in one possible implementation, the m view controls in the first user interface or the n view controls in the second user interface include any one or more of the following: text controls, icon controls, button controls, menu controls, tab controls, text box controls, dialog box controls, status bar controls, navigation bar controls, and widget controls.
[0043] 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.
[0044] 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.
[0045] 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.
[0046] 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.
[0047] 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
[0048] Figure 1 shows a schematic diagram of a long page;
[0049] Figure 2 shows a schematic diagram of multiple view controls displayed in a subpage;
[0050] Figure 3 shows a schematic diagram illustrating the relationship between the various view controls in the subpage;
[0051] Figure 4 illustrates a schematic diagram for determining the position information of view controls in a subpage;
[0052] Figure 5 shows a schematic diagram of the overlapping area in two screenshots;
[0053] Figure 6 illustrates a schematic diagram of the hardware structure of the electronic device 100;
[0054] Figure 7A illustrates an exemplary software structure block diagram of electronic device 100;
[0055] Figure 7B illustrates an example of the interaction diagram of multiple software modules in electronic device 100;
[0056] Figures 8A-8E exemplarily illustrate a scenario of obtaining a long screenshot image by scrolling through a screenshot according to an embodiment of this application;
[0057] Figures 9A-9H show the UI diagrams of an electronic device 100 that generate a long screenshot based on multiple screenshot images;
[0058] Figure 10A shows a flowchart illustrating how an electronic device 100 obtains a long screenshot after enabling the long screenshot function.
[0059] Figure 10B shows a flowchart illustrating how another electronic device 100 obtains a long screenshot after enabling the long screenshot function;
[0060] Figure 11 illustrates an exemplary flowchart of a method for obtaining a long screenshot based on stitching together a screenshot image k, a screenshot image k+1, and a repeating region k according to an embodiment of this application.
[0061] Figures 12A-12D show schematic diagrams illustrating the display positions of view controls in a set of user interfaces;
[0062] Figure 13 shows a flowchart of a scrolling screenshot method. Detailed Implementation
[0063] 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.
[0064] 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.
[0065] 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.
[0066] First, the technical terms used in this application will be explained.
[0067] 1. Long pages and subpages of long pages.
[0068] 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.
[0069] 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.
[0070] 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.
[0071] Figure 1 shows a schematic diagram of a long page.
[0072] As shown in Figure 1, 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.
[0073] 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.
[0074] 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.
[0075] 2. View controls and their position information.
[0076] 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.
[0077] 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 include any child view controls.
[0078] Figure 2 shows a schematic diagram of multiple view controls displayed in a subpage.
[0079] 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.
[0080] Figure 3 shows a schematic diagram illustrating the relationship between the various view controls in the subpage.
[0081] 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.
[0082] In some embodiments, the electronic device 100 may also obtain the position information of view controls in a subpage.
[0083] Figure 4 shows a schematic diagram of determining the position information of view controls in a subpage.
[0084] As shown in Figure 4, the electronic device 100 can display the user interface shown in Figure 4. The user interface shown in Figure 4 includes a fixed header area, a fixed bottom area, and a page scrolling area, in which subpages of long pages are displayed.
[0085] When the electronic device 100 slides to display other subpages of the long page, the electronic device 100 can keep the content displayed in the fixed header area and the fixed bottom area unchanged, and only change the page content displayed in the page scrolling area.
[0086] As shown in Figure 4, the electronic device 100 can obtain the display screen coordinate system shown in Figure 4. The display screen coordinate system can be defined with the upper left corner of the electronic device 100's display screen as the origin, the upper edge of the display screen pointing horizontally to the right as the positive X-axis, and the left edge of the display screen pointing vertically to the ground as the positive Y-axis, with the X-axis and Y-axis intersecting at the origin. The unit for both the x-axis and y-axis in the display screen coordinate system can be pixels (px).
[0087] Based on the display screen coordinate system shown in Figure 4, the electronic device 100 can determine the position information of the view control based on the display position of the view control in the page content displayed in the page scrolling area.
[0088] Optionally, the position information of the view control may include the X-axis coordinates and Y-axis coordinates of the view control.
[0089] Optionally, the position information of the view control can also include only the Y-axis coordinate of the view control.
[0090] The following embodiments of this application illustrate the use of the position information of the view control, including the Y-axis coordinate of the view control, as an example.
[0091] Based on the display screen coordinate system shown in Figure 4, the electronic device 100 can obtain the position information of each view control in the page content displayed in the page scrolling area. For example, the electronic device 100 can determine that the Y-axis coordinate of view control 7 is Y7, the Y-axis coordinate of view control 1 is Y1, the Y-axis coordinate of view control 2 is Y2, the Y-axis coordinate of view control 3 is Y3, the Y-axis coordinate of view control 4 is Y4, the Y-axis coordinate of view control 5 is Y5, the Y-axis coordinate of view control 6 is Y6, and the Y-axis coordinate of view control 8 is Y8.
[0092] In some embodiments, the display positions of view control 7 and view control 8 do not change as the long page scrolls. The area where view control 7 is located can be referred to as the fixed header area, and the area where view control 8 is located can be referred to as the fixed bottom area. The fixed header area and the fixed bottom area can also be referred to as non-scrollable areas.
[0093] In some embodiments, the display positions of view control 1, view control 2, view control 3, view control 4, view control 5, and view control 6 change as the long page scrolls. The area containing view control 1, view control 2, view control 3, view control 4, view control 5, and the view controls can be referred to as the page scrolling area.
[0094] Optionally, view controls typically have a certain height. The y-coordinate of a view control in the display coordinate system can be the y-coordinate of the top edge of the view control, or the y-coordinate of the bottom edge of the view control, or the y-coordinate of a point between the top and bottom edges of the view control, such as the y-coordinate of the center point of the view control.
[0095] Optionally, the display screen coordinate system can be obtained not only in the manner shown in Figure 4, but also in other ways. This application does not limit this method.
[0096] Optionally, the position information of the view controls in the subpage can be determined not only based on the method shown in Figure 4, but also based on other methods. This application does not limit this.
[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 Figure 1, 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 5, 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 5, 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 with 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. The electronic device can also obtain the positions of multiple view controls on the page at each screenshot. Based on the positions of the multiple view controls in two adjacent screenshots, the electronic device can calculate the scrolling distance of these multiple view controls between the two adjacent screenshots. The electronic device can determine the scrolling distance of the page between these two adjacent screenshots based on the scrolling distance of the multiple view controls. Furthermore, the electronic device can determine the overlapping area based on the scrolling distance of the long page between these two adjacent screenshots and crop the overlapping area from one of the images obtained from the two adjacent screenshots. Then, the electronic device can stitch the images after cropping the overlapping area to obtain a long screenshot.
[0108] As can be seen, when taking scrolling screenshots, electronic devices can determine the scroll distance of the page between two adjacent screenshots by using the scroll distance of the view controls on the page, thereby identifying the overlapping area. The scroll distances of the aforementioned view controls can be determined without any doubt and are not affected by changes in the displayed content of dynamic elements. Therefore, regardless of whether there are dynamic elements on the page, electronic devices can accurately identify the overlapping area in two adjacent screenshots based on the scroll distance of the view controls. This method can improve the success rate of scrolling screenshots and enhance the user experience of using the scrolling screenshot function.
[0109] The structure of the electronic device involved in this application is described below.
[0110] Please refer to Figure 6, which exemplarily illustrates a schematic diagram of the hardware structure of the electronic device 100.
[0111] As shown in Figure 6, 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.
[0112] 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.
[0113] 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.
[0114] 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.
[0115] 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.
[0116] 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.
[0117] 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.
[0118] 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.
[0119] 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.
[0120] 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.
[0121] 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.
[0122] 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.
[0123] 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.
[0124] 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.
[0125] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0126] 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.
[0127] 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.
[0128] 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.
[0129] 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.
[0130] 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.
[0131] 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.).
[0132] 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.
[0133] 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.
[0134] 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.
[0135] 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.
[0136] 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.
[0137] 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.
[0138] 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.
[0139] Please refer to Figure 7A, which exemplarily shows a software structure block diagram of electronic device 100.
[0140] 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.
[0141] The application layer can include a series of application packages.
[0142] As shown in Figure 7A, 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 scrolling screenshot functionality. 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 a 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.
[0143] In some embodiments, a scrolling screenshot application may also be referred to as a long screenshot application, a sliding screenshot application, etc. This application does not limit this.
[0144] The application framework layer provides APIs and a programming framework for applications within the application layer. The application framework layer includes some predefined functions.
[0145] As shown in Figure 7A, 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.
[0146] 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.
[0147] 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.
[0148] 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.
[0149] The phone manager is used to provide communication functions for electronic device 100. For example, it manages call status (including connection and disconnection).
[0150] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0151] 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.
[0152] 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.
[0153] 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.
[0154] 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.
[0155] In this application, the interface layout information of the user interface may include the relationship between multiple view controls in the user interface, as well as the position information of the multiple view controls.
[0156] Optionally, the position information of the view control can refer to the position of the view control on the display coordinate system. For example, the display coordinate system can be established with the upper left corner of the electronic device 100 display screen as the origin, the upper edge of the display screen pointing horizontally to the right as the positive x-axis, and the left edge of the display screen pointing vertically to the ground as the positive y-axis. This application embodiment does not limit the selection method of the display coordinate system. When the first application displays a user interface on the display screen, the user interface may include multiple view controls, and the first application can obtain the position information of the multiple view controls displayed on the display screen.
[0157] Scrolling screenshot applications can determine the scrollable and non-scrollable areas of a page based on the user interface layout information obtained from two separate screenshots. For example, the non-scrollable area may include a fixed top area and a fixed bottom area, and the positions of view controls displayed within the non-scrollable area are fixed. The first application can then scroll through and display different page contents of a long page within the scrollable area.
[0158] A scrolling screenshot application can monitor the position information of view controls displayed in the scrolling area, such as the vertical coordinate of the view control on the display coordinate system. Optionally, a scrolling screenshot application can monitor the position information of one view control displayed in the scrolling area, or it can monitor the position information of multiple view controls displayed in the scrolling area, where "multiple" can refer to two or more.
[0159] A scrolling screenshot application can obtain the position information of view controls displayed in the scrolling area of the screen at each screenshot moment, and determine the scrolling distance of the view controls between two consecutive screenshots based on the position information of the view controls displayed in the scrolling area at two different times. The scrolling screenshot application then determines the scrolling distance of the long page between two consecutive screenshots based on the scrolling distance of the view controls. Based on the scrolling distance of the long page between two consecutive screenshots, the scrolling screenshot application can identify the overlapping area and crop the overlapping area from one of the images obtained from the two consecutive screenshots. Finally, the scrolling screenshot application can stitch the images with the cropped overlapping area together to obtain the long screenshot.
[0160] 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.
[0161] 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.
[0162] 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.
[0163] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0164] 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.
[0165] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0166] A 2D graphics engine is a graphics engine for 2D drawing.
[0167] 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.
[0168] Figure 7B illustrates an example of the interaction between multiple software modules in electronic device 100.
[0169] As shown in Figure 7B, 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.
[0170] 1. The first application displays the user interface and obtains the interface layout information of the user interface.
[0171] After the first application is launched, it can display the user interface within the first application and obtain the interface layout information of the user interface.
[0172] 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 positional information of the view controls. For example, the positional relationship of multiple view controls can be similar to that shown in Figure 3. Exemplarily, the positional information of a view control can include its ordinate on the display coordinate system.
[0173] 2. The first application sends the user interface layout information to the accessibility system service.
[0174] 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 control from the user interface layout information.
[0175] 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.
[0176] 3. Scrolling screenshot applications obtain user interface layout information from accessibility system services.
[0177] 4. The scrolling screenshot application calculates the overlapping area of the previous and next screenshot images based on the position information of the view controls in the interface layout information of the user interface.
[0178] After enabling the scrolling screenshot feature, the scrolling screenshot application can obtain the user interface layout information from the accessibility system service to obtain the position information of view controls. The position information of the view controls is used to calculate the overlapping areas of the preceding and following screenshots, and remove the overlapping areas from one of the images, thus preventing the overlapping areas from appearing multiple times in the long screenshot obtained by the scrolling screenshot application based on the stitching of two screenshots.
[0179] Figures 8A-8E exemplarily illustrate a scenario of obtaining a long screenshot image by scrolling through a screenshot according to an embodiment of this application.
[0180] 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.
[0181] 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.
[0182] The status bar 311 may include view controls such as signal strength indicator, Wi-Fi connection indicator, battery level indicator, and time information.
[0183] 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.
[0184] 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.
[0185] 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.
[0186] 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.
[0187] 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.
[0188] 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.
[0189] 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.
[0190] 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.
[0191] 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.
[0192] 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.
[0193] 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.
[0194] 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.
[0195] Optionally, when the electronic device 100 displays the user interface shown in Figure 8C, the scrolling screenshot application can take another screenshot.
[0196] 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.
[0197] 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.
[0198] 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.
[0199] 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.
[0200] Optionally, when the electronic device 100 displays the user interface shown in Figure 8D, the scrolling screenshot application can take another screenshot.
[0201] 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.
[0202] 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.
[0203] 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.
[0204] 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.
[0205] The following section describes the specific implementation process of obtaining a long screenshot from multiple screenshot images using electronic device 100.
[0206] Figures 9A-9H show the UI diagrams of an electronic device 100 that generate a long screenshot based on multiple screenshot images.
[0207] 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.
[0208] 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.
[0209] 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.
[0210] 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.
[0211] When a screenshot is taken for the first time, the page content 313 can be displayed in the scrolling area of screenshot image 1.
[0212] 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.
[0213] 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).
[0214] 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.
[0215] 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.
[0216] 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.
[0217] 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.
[0218] 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.
[0219] 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.
[0220] 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.
[0221] As shown in Figure 9E, 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.
[0222] 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.
[0223] 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 FIG9F, 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 FIG9F.
[0224] After obtaining the duplicate region 2, as shown in Figure 9G, 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.
[0225] 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.
[0226] 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.
[0227] 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.
[0228] As shown in Figure 9H, the electronic device 100 can be assembled from top to bottom in the following order: the fixed header area, page content 313, page content 3151, page content 3161, and the fixed bottom area, to obtain the long screenshot 9001 shown in Figure 9H. The long screenshot 9001 is the long screenshot obtained in the scrolling screenshot scenario shown in Figures 8A to 8E.
[0229] Figure 10A shows a flowchart illustrating how an electronic device 100 obtains a long screenshot after enabling the long screenshot function.
[0230] Figure 10A can be a flowchart illustrating the process of obtaining a long screenshot for the first and second screenshot operations.
[0231] 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.
[0232] In some embodiments, accessibility system services may also be referred to as first system services.
[0233] The method shown in Figure 10A includes, but is not limited to, the following steps:
[0234] 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.
[0235] 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.
[0236] Before enabling the long screenshot feature, the first application can continuously display the user interface 1.
[0237] S1002A, The first application sends the interface layout information of the user interface 1 to the accessibility system service, including the position information of the view controls in the user interface 1.
[0238] 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.
[0239] 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.
[0240] 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.
[0241] 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 positional information of the view controls. For instance, the positional relationship of multiple view controls can be similar to that shown in Figure 3. The positional information of the view controls can refer to the vertical coordinate of the view control in the display coordinate system, or it may include or exclude the horizontal coordinate of the view control in the display coordinate system.
[0242] Optionally, view controls typically have a certain height. The y-coordinate of a view control in the display coordinate system can be the y-coordinate of the top edge of the view control, or the y-coordinate of the bottom edge of the view control, or the y-coordinate of a point between the top and bottom edges of the view control, such as the y-coordinate of the center point of the view control.
[0243] S1003A, Identify user actions used to enable the long screenshot function.
[0244] 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.
[0245] For example, the user operation to enable the long screenshot function can be as shown in Figure 8A.
[0246] 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.
[0247] 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.
[0248] S1005 A. In response to the first message, the scrolling screenshot application enables the long screenshot function.
[0249] Upon receiving the first message, the scrolling screenshot app can enable the long screenshot function.
[0250] S1006 A. The scrolling screenshot application obtains the interface layout information of user interface 1 from the accessibility system service.
[0251] 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.
[0252] 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.
[0253] Optionally, S1006 A can be executed simultaneously with S1005 A, or before S1005 A, etc.
[0254] S1007 A, The scrolling screenshot application executes the first screenshot and obtains screenshot image 1.
[0255] 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.
[0256] 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.
[0257] Optionally, S1007 A may be executed before S1005A or S1006A, or simultaneously with S1005A or S1006A, etc., and this application does not limit this.
[0258] 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.
[0259] 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.
[0260] 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.
[0261] Optionally, before the first application scrolls through the first long page each time, the scrolling screenshot application needs to send a second message to the first application, i.e., S1008 A is executed periodically / irregularly.
[0262] 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.
[0263] 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.
[0264] 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.
[0265] Optionally, the first distance and the second distance can be the same or different.
[0266] 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.
[0267] 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.
[0268] S1010A, The first application sends the interface layout information of the user interface 2 to the accessibility system service, including the position information of the view controls in the user interface 2.
[0269] 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.
[0270] For example, the interface layout information of user interface 2 includes, but is not limited to, the positional relationship of multiple view controls in user interface 2, the names of the view controls, the types of the view controls, the elements displayed in the view controls, and the positional information of the view controls. For instance, the positional relationship of multiple view controls can be similar to that shown in Figure 3. The positional information of the view controls can refer to the vertical coordinate of the view control in the display coordinate system, or it may include or exclude the horizontal coordinate of the view control in the display coordinate system.
[0271] S1011 A. The scrolling screenshot application obtains the interface layout information of user interface 2 from the accessibility system service.
[0272] 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.
[0273] 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.
[0274] S1012 A, The scrolling screenshot application performs a second screenshot to obtain screenshot image 2.
[0275] 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.
[0276] 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.
[0277] 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.
[0278] S1013A: The scrolling screenshot application determines the overlapping area 1 of screenshot image 1 and screenshot image 2 based on the interface layout information of user interface 1 and user interface 2, and obtains a long screenshot by stitching screenshot image 1, screenshot image 2 and overlapping area 1 together.
[0279] For example, the overlapping region 1 of screenshot image 1 and screenshot image 2 can be the overlapping region 1 shown in Figure 9C.
[0280] 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 S1008B in the embodiment of Figure 10B, which will not be repeated here.
[0281] 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.
[0282] 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.
[0283] Figure 10B shows a flowchart illustrating how another electronic device 100 obtains a long screenshot after enabling the long screenshot function.
[0284] 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.
[0285] 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.
[0286] In some embodiments, accessibility system services may also be referred to as first system services.
[0287] The method shown in Figure 10B includes, but is not limited to, the following steps:
[0288] S1001B, The first application 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.
[0289] 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.
[0290] 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.
[0291] Optionally, the scroll distance of the first long page can be the same or different each time.
[0292] 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.
[0293] 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.
[0294] S1002B, The first application sends the interface layout information of the user interface k to the accessibility system service, including the position information of the view controls in the user interface k.
[0295] 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.
[0296] In some embodiments, the accessibility system service may 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.
[0297] 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.
[0298] 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 positional information of the view controls. For instance, the positional relationship of multiple view controls can be similar to that shown in Figure 3. The positional information of the view controls can refer to the vertical coordinate of the view control in the display coordinate system, or it may include or exclude the horizontal coordinate of the view control in the display coordinate system.
[0299] Optionally, view controls typically have a certain height. The y-coordinate of a view control in the display coordinate system can be the y-coordinate of the top edge of the view control, or the y-coordinate of the bottom edge of the view control, or the y-coordinate of a point between the top and bottom edges of the view control, such as the y-coordinate of the center point of the view control.
[0300] S1003B, The scrolling screenshot application obtains the interface layout information of the user interface k from the accessibility system service.
[0301] After the first application displays the user interface k, the scrolling screenshot application can obtain the interface layout information of the user interface k from the accessibility system service. The interface layout information of the user interface k helps the scrolling screenshot application determine the overlapping areas of two adjacent screenshots when stitching them together to form a long screenshot.
[0302] 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.
[0303] S1004B, The scrolling screenshot application executes the k-th screenshot to obtain screenshot image k.
[0304] 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.
[0305] 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.
[0306] Optionally, S1004B can be executed simultaneously with S1002B or S1003B, or before S1002B or S1003B.
[0307] 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 position information of the view controls in the user interface k+1.
[0308] 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.
[0309] 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.
[0310] 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.
[0311] 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.
[0312] 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 positional information of the view controls. For instance, the positional relationship of multiple view controls can be similar to that shown in Figure 3. The positional information of the view controls can refer to the vertical coordinate of the view control in the display coordinate system, or it may include or exclude the horizontal coordinate of the view control in the display coordinate system.
[0313] Optionally, view controls typically have a certain height. The y-coordinate of a view control in the display coordinate system can be the y-coordinate of the top edge of the view control, or the y-coordinate of the bottom edge of the view control, or the y-coordinate of a point between the top and bottom edges of the view control, such as the y-coordinate of the center point of the view control.
[0314] 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 9E. Screenshot image 3 includes status bar 311, application header area 312, page content 316, and application bottom area 314.
[0315] S1006B, If the preset conditions are met, the scrolling screenshot application will disable the long screenshot function.
[0316] Optionally, the preset conditions may include, but are not limited to, any of the following;
[0317] Condition 1: The gesture recognition module recognizes user actions used to disable the long screenshot function.
[0318] 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.
[0319] 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.
[0320] 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.
[0321] The preset conditions are not limited to the above conditions; other conditions may also be preset, and this application does not limit them.
[0322] 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.
[0323] 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.
[0324] 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.
[0325] S1008B The scrolling screenshot application determines the overlapping area k of screenshot image k and screenshot image k+1 based on the interface layout information of user interface k and user interface k+1, and obtains a long screenshot by stitching screenshot image k, screenshot image k+1 and overlapping area k together.
[0326] After the long screenshot function is turned off, the scrolling screenshot application determines the overlapping area k of screenshot image k and screenshot image k+1 based on the interface layout information of user interface k and user interface k+1. The overlapping area k is used to remove the duplicate image content of screenshot image k and screenshot image k+1, so as to avoid the overlapping area k appearing multiple times in the long screenshot obtained by electronic device 100 based on screenshot image k and screenshot image k+1.
[0327] 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 9F.
[0328] For details on how the scrolling screenshot application determines the repeating region k, and how to stitch together the screenshot image k, the screenshot image k+1, and the repeating region k to obtain a long screenshot, please refer to the description in the embodiment of Figure 11.
[0329] Figure 11 illustrates an exemplary flowchart of a method for obtaining a long screenshot based on a screenshot image k, a screenshot image k+1, and a repeating region k, according to an embodiment of this application.
[0330] As shown in Figure 11, the method may include steps S1101 to S1103. Wherein:
[0331] S1101, The scrolling screenshot application determines the page scrolling area and non-page scrolling area of screenshot image k, and the page scrolling area and non-page scrolling area of screenshot image k+1, based on the interface layout information of user interface k and user interface k+1.
[0332] In some embodiments, after acquiring screenshot image k and screenshot image k+1, the scrolling screenshot application can determine the scrollable and non-scrollable areas of screenshot image k and screenshot image k+1 based on the interface layout information of user interface k and user interface k+1. For example, the scrolling screenshot application can determine the view controls whose positions have not changed based on the position information of view controls in the interface layout information of user interface k and user interface k+1; the area where these view controls are located is the non-scrollable area. Similarly, the area where the position information of view controls has changed is the scrollable area, and the areas in screenshot image k and screenshot image k+1 other than the non-scrollable areas are the scrollable areas.
[0333] Optionally, after determining the scrollable and non-scrollable areas of screenshot image k and screenshot image k+1, when performing the (k+2)th screenshot operation, the scrolling screenshot application can capture all content in the user interface k+2 displayed on the electronic device, resulting in screenshot image 3. In another possible implementation, the scrolling screenshot application can also capture only the page content displayed within the scrollable area of the user interface k+2 displayed on the electronic device.
[0334] Figures 12A-12D show schematic diagrams illustrating the display positions of view controls in a set of user interfaces.
[0335] This explanation uses the images captured by electronic device 100 during the scrolling screenshot process as examples, specifically the images captured at the k-th and (k+1)-th times. k is a positive integer. The k-th and (k+1)-th screenshots can be any two consecutive screenshots taken by electronic device 100 during the scrolling screenshot process. For example, when electronic device 100 displays user interface k, it performs the k-th screenshot operation; when electronic device 100 displays user interface k+1, it performs the (k+1)-th screenshot operation.
[0336] As shown in Figure 12A, when the electronic device 100 takes a screenshot for the kth time, the content displayed on the screen includes view control 7, view control 2, view control 3, view control 4, view control 5, view control 6, and view control 8.
[0337] In some embodiments, the electronic device 100 can traverse the view controls on the application user interface to find the lowest-level view controls and then obtain the position information of these lowest-level view controls at the kth screenshot.
[0338] The electronic device 100 can obtain the vertical coordinate of the view control on the display coordinate system shown in Figure 12A. Optionally, the unit of both the x-axis and y-axis in the display coordinate system can be pixels (px).
[0339] For example, the electronic device 100 can obtain the position information of view controls 7, 2, 3, 4, 5, 6, and 8 in the display screen coordinate system at the time of the k-th screenshot, such as the ordinate of the view controls in the display screen coordinate system. For example, the ordinate of view control 7 is Y7, the ordinate of view control 2 is Y2, the ordinate of view control 3 is Y3, the ordinate of view control 4 is Y4, the ordinate of view control 5 is Y5, the ordinate of view control 6 is Y6, and the ordinate of view control 8 is Y8.
[0340] Optionally, a view control typically has a certain height. The ordinate of a view control in the display coordinate system can be the ordinate of the top edge of the view control, the ordinate of the bottom edge of the view control, or the ordinate of a point between the top and bottom edges of the view control.
[0341] As shown in Figure 12B, during the (k+1)th screenshot, the electronic device 100 displays view controls 7, 4, 5, 6, 8, and 9. View controls 2 and 3 are scrolled off the screen and are no longer visible. View control 9 is not displayed during the kth screenshot. View controls 4, 5, and 6 are displayed during both the kth and (k+1)th screenshots.
[0342] Electronic device 100 can obtain the vertical coordinate of the view control on the display coordinate system shown in Figure 12B. Optionally, the unit of both the x-axis and y-axis in the display coordinate system can be pixels (px).
[0343] For example, the electronic device 100 can obtain the position information of view controls 7, 4, 5, 6, 8, and 9 in the display screen coordinate system at the (k+1)th screenshot, such as the ordinate of the view controls in the display screen coordinate system. For example, the ordinate of view control 7 is Y7, the ordinate of view control 4 is Y8, the ordinate of view control 5 is Y9, the ordinate of view control 6 is Y10, the ordinate of view control 9 is Y11, and the ordinate of view control 8 is Y8.
[0344] Optionally, a view control typically has a certain height. The ordinate of a view control in the display coordinate system can be the ordinate of the top edge of the view control, the ordinate of the bottom edge of the view control, or the ordinate of a point between the top and bottom edges of the view control.
[0345] Electronic device 100 can determine the page scrolling area and non-page scrolling area based on the position information of multiple view controls in the k-th screenshot and the (k+1)-th screenshot. For example, the scrolling screenshot application can obtain the position information of multiple view controls in the k-th screenshot from the interface layout information of user interface k, and obtain the position information of multiple view controls in the (k+1)-th screenshot from the interface layout information of user interface k+1. Then, based on the position information of the multiple view controls in the k-th and (k+1)-th screenshots, the scrolling screenshot application can determine the view controls whose position information has not changed; the area where these view controls are located is the non-page scrolling area. For example, as can be seen from Figures 12A and 12B, the ordinates of view controls 7 and 8 are both Y7 in the k-th and (k+1)-th screenshots, and the ordinate of view control 8 is both Y8 in the k-th and (k+1)-th screenshots. Therefore, it can be determined that the position information of view controls 7 and 8 has not changed, and the area where view controls 7 and 8 are located can be called the non-page scrolling area.
[0346] In some embodiments, if view control 7 is located at the top of user interface k and user interface k+1, the area where view control 7 is located can also be referred to as the header fixed area. If view control 8 is located at the bottom of user interface k and user interface k+1, the area where view control 8 is located can also be referred to as the bottom fixed area.
[0347] 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 display positions of view controls in the fixed header and fixed bottom areas can remain fixed. The status bar 311, application header area 312, and application bottom area 314 can be described with reference to 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.
[0348] 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.
[0349] Similarly, scrolling screenshot applications can determine the view controls whose positions have changed based on the position information of multiple view controls in the k-th screenshot and the (k+1)-th screenshot. The area where these view controls are located is then the page scrolling area. For example, as shown in Figures 12A and 12B, the ordinates of view controls 2, 3, 4, 5, and 6 are different in the k-th and (k+1)-th screenshots. View controls 2 and 3 are invisible in the (k+1)-th screenshot. The ordinate of view control 4 in the k-th screenshot is Y4, and in the (k+1)-th screenshot it is Y8, which is different from Y4. The ordinate of view control 5 in the k-th screenshot is Y5, and in the (k+1)-th screenshot it is Y9, which is different from Y5. In the k-th screenshot, the ordinate of view control 6 is Y6, and in the (k+1)-th screenshot, the ordinate is Y10. Y6 and 10 are different. View control 9 appears for the first time in the (k+1)-th screenshot. The scrolling screenshot application can determine that the positions of view controls 4, 5, and 6 have changed. Therefore, in screenshot k, the area containing view controls 2, 3, 4, 5, and 6 can be called the page scrolling area. In screenshot k+1, the area containing view controls 4, 5, 6, and 9 can be called the page scrolling area.
[0350] In other embodiments, after determining the non-scrollable area, the areas other than the non-scrollable area in screenshot image k and screenshot image k+1 can also be used as the scrollable area.
[0351] For example, the scrolling area of the page can be the area containing page content 313, page content 315, and page content 316.
[0352] The page scroll area can be located below the fixed header area or above the fixed bottom area. The page content displayed in the scroll area can scroll in the first direction; that is, the display position of the view controls in the scroll area can change.
[0353] Using this method, the scrolling screenshot application can determine the scrolling and non-scrolling areas of screenshot image k, and the scrolling and non-scrolling areas of screenshot image k+1.
[0354] For example, when user interface k is the user interface shown in Figure 8C, screenshot image k is screenshot image 2 shown in Figure 9B, user interface k+1 is the user interface shown in Figure 8D, and the third screenshot image is screenshot image 3 shown in Figure 9E, the page scrolling area of screenshot image k can be the display area where page content 315 is located, and the page scrolling area of screenshot image k+1 can be the display area where page content 316 is located. The non-page scrolling area of screenshot image k is the same as the non-page scrolling area of screenshot image k+1, for example, it can be the display area where the status bar 311, the application header area 312, and the application bottom area 314 are located.
[0355] S1102, The scrolling screenshot application determines the height of the overlapping area k of the scrolling area of screenshot image k and the scrolling area of screenshot image k+1 based on the height of the scrolling area of the page, the position information of the o view controls in the scrolling area of screenshot image k, and the position information of the o view controls in the scrolling area of screenshot image k+1.
[0356] As described above regarding the scenarios and methods for scrolling screenshots, electronic device 100 will take multiple screenshots while scrolling the page. Adjacent screenshots often contain overlapping areas. If electronic device 100 cannot accurately identify these overlapping areas, the same view control may appear repeatedly in the stitched long screenshot. Alternatively, if electronic device 100 cannot accurately identify overlapping areas, the scrolling screenshot may fail, resulting in no long screenshot. For example, to avoid the same view control appearing repeatedly in a long screenshot, electronic device 100 can discard the later screenshot if it detects no overlapping areas or only small overlapping areas between adjacent screenshots. Therefore, electronic device 100 needs to accurately identify overlapping areas to improve the success rate of scrolling screenshots.
[0357] After determining the scrolling areas of screenshot image k and screenshot image k+1, the scrolling screenshot application can obtain the position information of o view controls within the scrolling area of screenshot image k and the same o view controls within the scrolling area of screenshot image k+1. Based on the height of the scrolling area, the position information of the o view controls within the scrolling area of screenshot image k and the same o view controls within the scrolling area of screenshot image k+1, the height of the overlapping area k of the scrolling areas of screenshot image k and screenshot image k+1 is determined.
[0358] For example, a scrolling screenshot application can determine a second scrolling distance for the first long page based on the position information of o view controls within the scrolling area of screenshot image k and the position information of the same o view controls within the scrolling area of screenshot image k+1, such as the difference between the two. Then, the scrolling screenshot application further determines the height of the overlapping area k of the scrolling areas of screenshot image k and screenshot image k+1 based on the height of the scrolling area and the second scrolling distance of the first long page, such as the difference between the two.
[0359] Optionally, the o view controls can be view controls located at the bottom of the scroll area of screenshot image k. This avoids the situation where the first long page scrolls too far at once, causing the view controls displayed in the scroll area of screenshot image k to be removed, and these view controls are not displayed in the scroll area of screenshot image k+1.
[0360] Where o is a positive integer greater than or equal to 1.
[0361] In some embodiments, o is greater than 1. During scrolling, the size and / or layout of one or more view controls on a long page of an application may change. Therefore, the scrolling distance of that view control between two adjacent screenshots does not necessarily represent the scrolling distance of the long page of the application between those two screenshots. If the electronic device 100 uses only the scrolling distance of one view control to determine the scrolling distance of the long page of the application, the scrolling distance of the long page of the application may be inaccurate. The mode of the scrolling distances of the multiple view controls can represent the scrolling distance of most view controls, and can more accurately reflect the scrolling distance of the application page. Therefore, the electronic device 100 can determine the scrolling distances of multiple view controls and determine the scrolling distance of the application page based on the mode of the scrolling distances of the multiple view controls. This can improve the accuracy of determining the scrolling distance of the application page. Therefore, if the ordinates of o view controls in the scrolling area of screenshot image k are partially the same as the ordinates of o view controls in the scrolling area of screenshot image k+1, the scrolling screenshot application can determine the second scrolling distance of the first long page based on the mode of the difference between the ordinates of the o view controls in two adjacent screenshots.
[0362] In one possible implementation, the scrolling screenshot application can determine the second scrolling distance of the first long page based on the mode of the scrolling distance of the o view controls from the k-th screenshot to the (k+1)-th screenshot.
[0363] For example, the o view controls could be view control 4, view control 5, and view control 6. View control 4 has a y-coordinate of Y4 in the k-th screenshot and Y8 in the (k+1)-th screenshot (Y4 and 8 are different). View control 5 has a y-coordinate of Y5 in the k-th screenshot and Y9 in the (k+1)-th screenshot (Y5 and 9 are different). View control 6 has a y-coordinate of Y6 in the k-th screenshot and Y10 in the (k+1)-th screenshot (Y6 and 10 are different). Y4 minus Y8 equals 1, Y5 minus Y9 equals 2, and Y6 minus Y10 equals 3. Scrolling screenshot applications can determine the second scroll distance of the first long page based on the mode of values 1, 2, and 3. For example, if the mode of values 1, 2, and 3 is 3, then the second scroll distance of the first long page can be determined to be 3.
[0364] In other possible implementations, the scrolling screenshot application can determine the second scrolling distance of the first long page based on the minimum scrolling distance of the o view controls from the k-th screenshot to the (k+1)-th screenshot. This avoids cropping non-repeating areas.
[0365] As mentioned above, the scrolling screenshot application can determine the second scrolling distance of the first long page based on the minimum value of values 1, 2, and 3. For example, if the minimum value of values 1, 2, and 3 is 3, then the second scrolling distance of the first long page can be determined to be 3.
[0366] In some embodiments, o equals 1, and the scroll distance of the first long page of the application from the kth screenshot to the (k+1)th screenshot can also be determined based on the scroll distance of a view control, thereby determining the second scroll distance of the first long page.
[0367] For example, a scrolling screenshot application can determine the second scrolling distance of the first long page based on the scrolling distance from the k-th screenshot to the (k+1)-th screenshot using any one of the view controls 4, 5, and 6. For instance, if the scrolling distance of view control 6 from the k-th screenshot to the (k+1)-th screenshot is 3, then the second scrolling distance of the first long page can be determined to be 3.
[0368] Optionally, the scrolling screenshot application can monitor the scroll distance of view controls located at the bottom of the scroll area of screenshot image k to determine a second scroll distance for the first long page. This avoids the situation where the first long page scrolls too far at once, causing view controls displayed in the scroll area of screenshot image k to be removed, and view controls not being displayed in the scroll area of screenshot image k+1.
[0369] As shown in Figures 12C and 12D, after determining the second scroll distance of the first long page, the scrolling screenshot application can determine the height of the screenshot image k and the overlapping area k of screenshot image k+1 based on the height of the page scroll area and the second scroll distance of the first long page. For example, the scrolling screenshot application can subtract the second scroll distance of the first long page from the height of the page scroll area to obtain the height of the overlapping area k of screenshot image k and screenshot image k+1.
[0370] S1103, The scrolling screenshot application determines the repeating region k based on the height of the repeating region k.
[0371] After determining the height of the overlapping area k of screenshot image k and screenshot image k+1, the scrolling screenshot application can determine the overlapping area k of screenshot image k and screenshot image k+1 based on the height of the overlapping area k.
[0372] In one possible implementation, as shown in Figure 12C, the scrolling screenshot application can use the content of the height of the repeating area k from the bottom upwards of the page scrolling area of the screenshot image k as the repeating area k of the screenshot image k and the screenshot image k+1.
[0373] In other possible implementations, as shown in Figure 12D, the scrolling screenshot application can use the content of the height of the repeating region k from the top downwards of the page scrolling area of screenshot image k+1 as the content of the repeating region k of screenshot image k and screenshot image k+1.
[0374] For example, when screenshot image k is screenshot image 2 as shown in Figure 9B, and screenshot image k+1 is screenshot image 3 as shown in Figure 9E, the overlapping region k of screenshot image k and screenshot image k+1 can be the overlapping region 2 as shown in Figure 9F.
[0375] S1104. The scrolling screenshot application crops the top content of the page scrolling area of the screenshot image k+1 based on the repeating area k to obtain the first cropped content. The long screenshot is obtained by splicing the page scrolling area of the screenshot image k, the non-page scrolling area of the screenshot image k, and the first cropped content.
[0376] In one possible implementation, after determining the overlapping area k of screenshot image k and screenshot image k+1, the scrolling screenshot application can crop the top content of the page scrolling area of screenshot image k+1 based on the overlapping area k to obtain the first cropped content. The long screenshot is then obtained by stitching together the fixed header area, the page scrolling area of screenshot image k, the first cropped content, and the fixed bottom area from top to bottom.
[0377] In other possible implementations, after determining the overlapping area k of screenshot image k and screenshot image k+1, the scrolling screenshot application can also crop the bottom content of the page scrolling area of screenshot image k based on the overlapping area k to obtain the second cropped content. The long screenshot is then obtained by stitching together the fixed header area, the second cropped content, the page scrolling area of screenshot image k+1, and the fixed bottom area from top to bottom.
[0378] Optionally, after each screenshot operation, the scrolling screenshot application can stitch together a long screenshot. For example, the scrolling screenshot application can also perform the (k+2)th screenshot operation and obtain a third screenshot. The scrolling screenshot application can determine the overlapping content of screenshots k+1 and the third screenshot based on the overlapping area k of screenshots k+1 and the third screenshot, and crop the content of the scrolling area of the third screenshot based on the overlapping content k of screenshots k+1 and the third screenshot, or crop the content of the scrolling area of screenshot k+1 based on the overlapping content of screenshots k+1 and the third screenshot, and then stitch them together to obtain a new long screenshot. How to obtain a new long screenshot based on the long screenshot obtained from screenshots k and k+1, and the third screenshot, is similar to the implementation of stitching together screenshots k and k+1 to obtain a long screenshot, and will not be elaborated here.
[0379] As can be seen, when taking scrolling screenshots, the electronic device 100 can determine the scrolling distance of the page between two adjacent screenshots by measuring the scrolling distance of the view controls on the long page, thereby identifying the overlapping area. Even if the content displayed by the same view control differs in the overlapping area of two adjacent screenshots, the scrolling distance of that view control is fixed. That is to say, the scrolling distance of the view control can be determined without any doubt and is not affected by changes in the displayed content of dynamic elements. Regardless of whether there are dynamic elements on the page, the electronic device 100 can accurately identify the overlapping area on two adjacent screenshots based on the scrolling distance of the view controls. Furthermore, when the view controls on the application page change due to application updates or other reasons, the above method can reduce the impact of factors such as the presence of dynamic elements on the page and updates to view controls on the page on identifying overlapping areas, thereby improving the success rate of scrolling screenshots and enhancing the user experience of using the scrolling screenshot function.
[0380] Figure 13 shows a flowchart of a scrolling screenshot method.
[0381] S1301, The first application displays a first user interface, which includes the content of the first page of the first long page of the first application.
[0382] S1302, The first application sends the position information of m view controls in the first user interface to the first system service.
[0383] S1303, Scrolling screenshot application obtains the first screenshot image of the first user interface.
[0384] S1304, The scrolling screenshot application obtains the position information of m view controls in the first user interface from the first system service.
[0385] Optionally, in addition to obtaining the position information of m view controls in the first user interface, 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 the m 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.
[0386] S1305, the first application scrolls the first long page and displays the second user interface, the second user interface including the second page content of the first long page of the first application, and the second page content and the first page content have a first overlapping area.
[0387] S1306, The first application sends the position information of n view controls in the second user interface to the first system service.
[0388] S1307, Scrolling screenshot application obtains a second screenshot image of the second user interface.
[0389] S1308, The scrolling screenshot application obtains the position information of n view controls in the second user interface from the first system service.
[0390] Optionally, in addition to obtaining the position information of n view controls in the second user interface, 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 the positional relationship of multiple view controls shown in Figure 3.
[0391] S1309, The scrolling screenshot application determines the first repeating area based on the position information of m view controls in the first user interface and the position information of n view controls in the second user interface.
[0392] S1310, the electronic device obtains a first long screenshot based on the first screenshot image, the second screenshot image, and the first overlapping area.
[0393] Optionally, the scrolling screenshot application can also determine which view controls are common in the first user interface and the second user interface based on the other interface layout information of the m view controls in the first user interface and the position information of the n view controls in the second user interface.
[0394] 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.
[0395] Optionally, whenever the user interface displayed by the first application changes, such as each time the first long page is scrolled, the position information of some view controls in the first long page will change.
[0396] Optionally, the positional relationship of the view control can refer to the vertical coordinate of the view control on the display coordinate system, and may or may not include the horizontal coordinate of the view control on the display coordinate system.
[0397] Using this method, the electronic device can also obtain the positions of multiple view controls on the page at each screenshot. Based on the positions of these view controls in two adjacent screenshots, the electronic device can calculate the scroll distance between these view controls. The electronic device can then determine the page's scroll distance between these two adjacent screenshots based on the scroll distance of the long page. Furthermore, the electronic device can determine the overlapping region based on the scroll distance of the long page between these two adjacent screenshots and crop the overlapping region from one of the images obtained from the two adjacent screenshots. Afterwards, the electronic device can stitch the cropped images of the overlapping region together to obtain a long screenshot.
[0398] The scroll distance of the aforementioned view controls 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 scroll distances of these multiple view controls. This method improves the success rate of scrolling screenshots and enhances the user experience of the scrolling screenshot function.
[0399] 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.
[0400] 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. The first repeating area can be repeating area 1 shown in Figure 9C.
[0401] 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.
[0402] 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. The first repeating area can be repeating area 2 shown in Figure 9F.
[0403] In one possible implementation, the electronic device further includes a gesture recognition module; before the scrolling screenshot application acquires the first screenshot image of the first user interface, the method further includes: the gesture recognition module recognizing a first user operation that enables the long screenshot function; in response to the first user operation, the gesture recognition module sending a first message to the scrolling screenshot application; the scrolling screenshot application acquiring the first screenshot image of the first user interface specifically includes: in response to the first message, the scrolling screenshot application acquiring the first screenshot image of the first user interface.
[0404] 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.
[0405] In one possible implementation, m view controls include p view controls and o view controls, and n view controls include p view controls and o view controls. The position information of the p view controls in the first user interface is the same as the position information of the p view controls in the second user interface, while the position information of the o view controls in the first user interface is different from the position information of the o view controls in the second user interface.
[0406] Optionally, the scrolling screenshot application can also determine which view controls are identical in the first and second user interfaces based on other interface layout information of the m view controls in the first user interface and the position information of the n view controls in the second user interface, such as the name, type, and displayed elements of the view controls. For example, the scrolling screenshot application can determine that the first and second user interfaces include p identical view controls, and the position information of the p identical view controls is the same. The scrolling screenshot application can also determine that the first and second user interfaces include o identical view controls, and the position information of the o identical view controls is different.
[0407] Optionally, the scrolling screenshot application can determine that the first user interface and the second user interface include different view controls. For example, if some view controls are included in the first user interface but not in the second user interface, then those view controls become invisible as the first long page scrolls. Conversely, if some view controls are included in the second user interface but not in the first user interface, then those view controls first appear in the page scroll area as the first long page scrolls.
[0408] For example, the p view controls can be view control 7 and view control 8 as shown in Figures 12A and 12B.
[0409] For example, the o view controls can be view control 4, view control 5 and view control 6 as shown in Figures 12A and 12B.
[0410] In one possible implementation, the scrolling screenshot application determines a first repeating area based on the position information of m view controls in the first user interface and n view controls in the second user interface. Specifically, the scrolling screenshot application determines the area in the first and second user interfaces other than the display area where p view controls are located as the page scrolling area; the scrolling screenshot application determines a first distance of scrolling the first long page based on the difference between the position information of o view controls in the page scrolling area of the first user interface and the position information of o view controls in the page scrolling area of the second user interface; the electronic device determines the height of the first repeating area based on the height of the page scrolling area and the first distance; and the electronic device determines the first repeating area based on the height of the first repeating area.
[0411] If the scrolling screenshot application determines that the first and second user interfaces contain p identical view controls, and the position information of these p identical view controls is the same, then the area where these p view controls are located is a non-scrollable area. The other areas in the first user interface besides the non-scrollable areas are the scrollable areas.
[0412] When the scrolling screenshot application determines that the first user interface and the second user interface include o identical view controls, and the position information of the o identical view controls is different, then the o view controls are located within the page scrolling area. The scrolling screenshot application can determine the first distance of scrolling the first long page by the difference between the position information of the o view controls in the page scrolling area of the first user interface and the position information of the o view controls in the page scrolling area of the second user interface.
[0413] After determining the page scroll area, the scrolling screenshot application can determine the height of the page scroll area. After obtaining the first distance of the first long page scroll and the height of the page scroll area, the scrolling screenshot application can determine the height of the first overlapping area of the page scroll area of the first user interface and the page scroll area of the second user interface based on the difference between the height of the page scroll area and the first distance of the first long page scroll, and then determine the first overlapping area.
[0414] Optionally, the scrolling screenshot application can use the page content at the height of the first repeating area at the bottom of the scrolling area of the first user interface as the first repeating area. Optionally, the scrolling screenshot application can also use the page content at the height of the first repeating area at the top of the scrolling area of the second user interface as the first repeating area.
[0415] For example, the height of the first repeating region can be determined by referring to the description in Figures 12A-12D.
[0416] For example, to determine the first repeating region based on its height, please refer to the description in Figure 9C or Figure 9F.
[0417] In one possible implementation, the first distance is less than the height of the page scroll area.
[0418] This avoids situations where the scrolling areas of the first and second user interfaces do not contain the same view controls, making it impossible to determine the first overlapping area. It also avoids situations where the first long page scrolls too much at once, causing the content of a long page to be missed in the long screenshot obtained by stitching the two pages together.
[0419] In one possible implementation, the o view controls include a first view control; the scrolling screenshot application determines the first distance of scrolling the first long page based on the difference between the position information of the o view controls in the scrolling area of the first user interface and the position information of the o view controls in the scrolling area of the second user interface, specifically including: the scrolling screenshot application determines the first distance of scrolling the first long page based on the difference between the position information of the first view control in the scrolling area of the first user interface and the position information of the first view control in the scrolling area of the second user interface.
[0420] Thus, when the scrolling screenshot application determines that the first user interface and the second user interface contain o identical view controls, and the position information of these o identical view controls is different, then these o view controls are located within the page scrolling area, and these o view controls include the first view control. The scrolling screenshot application can determine the first distance of scrolling the first long page by the difference between the position information of the first view control in the page scrolling area of the first user interface and the position information of the first view control in the page scrolling area of the second user interface. By determining the first distance of scrolling the first long page by detecting the difference in the position information of the same view control, the computational load of the electronic device can be reduced, saving power consumption.
[0421] For example, the first view control may be view control 4, view control 5, or view control 6 shown in Figures 12A-12D.
[0422] In one possible implementation, the scrolling screenshot application determines the first distance of scrolling the first long page based on the difference between the position information of o view controls in the scrolling area of the first user interface and the position information of o view controls in the scrolling area of the second user interface. Specifically, the scrolling screenshot application determines the first distance of scrolling the first long page based on the mode of the difference between the position information of o view controls in the scrolling area of the first user interface and the position information of o view controls in the scrolling area of the second user interface.
[0423] Understandably, the size and / or layout of the o view controls in the first long page may change as the page scrolls. Therefore, the scroll distance of these o view controls between two adjacent screenshots does not represent the total scroll distance of the first long page between those two screenshots. The mode of the scroll distances of these o view controls can represent the scroll distance of the majority of view controls, providing a more accurate reflection of the scroll distance of the first long page. Therefore, the electronic device can determine the scroll distance of the o view controls and, based on the mode of their scroll distances, determine the scroll distance of the first long page. This improves the accuracy of determining the scroll distance of the first long page.
[0424] For example, the o view controls can be any two or all of the view controls 4, 5 and 6 shown in Figures 12A-12D.
[0425] In one possible implementation, the scrolling screenshot application determines the first distance of scrolling the first long page based on the difference between the position information of o view controls in the scrolling area of the first user interface and the position information of o view controls in the scrolling area of the second user interface. Specifically, the scrolling screenshot application determines the first distance of scrolling the first long page based on the minimum value of the difference between the position information of o view controls in the scrolling area of the first user interface and the position information of o view controls in the scrolling area of the second user interface.
[0426] In this way, by determining the scroll distance of the first long page based on the minimum difference between the position information of the o view controls in two adjacent screenshots, it is possible to avoid missing the content of a long page based on the long screenshot obtained by stitching together the previous and next screenshots.
[0427] For example, the o view controls can be any two or all of the view controls 4, 5 and 6 shown in Figures 12A-12D.
[0428] 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 first overlapping region in the content of a 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 first overlapping region in the content of a second page and stitches the first screenshot image and the processed second page content together to obtain the first long screenshot.
[0429] In one possible implementation, the area containing p view controls in the first or second user interface includes a top fixed area and / or a bottom fixed area, with the page scrolling area located below the top fixed area and above the bottom fixed area. The scrolling screenshot application crops the first repeating area 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, the scrolling screenshot application stitches the top fixed area, the processed first page content, the second page content, and the bottom fixed area sequentially to obtain the first long screenshot. Alternatively, the electronic device crops the repeating area in the second page content and stitches the first screenshot image and the processed second page content together to obtain the first long screenshot. Specifically, the scrolling screenshot application stitches the top fixed area, the first page content, the processed second page content, and the bottom fixed area sequentially to obtain the first long screenshot.
[0430] Optionally, the head fixation area or the bottom fixation area may not be included.
[0431] In this way, electronic devices can stitch together two screenshots obtained from previous and subsequent screenshots to create a long screenshot, ensuring that repeated areas appear only once in the long screenshot.
[0432] For an example of how to obtain the first long screenshot, please refer to the description in the embodiment of Figure 9H.
[0433] In one possible implementation, before the first application scrolls the first long page, the method further includes: the scrolling screenshot application sending a second message to the first application, the second message carrying a second distance; in response to the first message, the first application controlling the first long page to scroll a first distance in a first direction, the first distance being the same as or different from the second distance.
[0434] In this way, after enabling the long screenshot feature, the scrolling screenshot app can control the first app to scroll the first long page. Specifically, before the first app scrolls the first long page each time, the scrolling screenshot app needs to send a first message to the first app. After receiving the first message, the first app then scrolls the first long page, the scrolling screenshot app captures a screenshot, and then sends the first message to the first app again. This process continues until the long screenshot feature is disabled.
[0435] Optionally, the first message can be omitted. With long screenshots enabled, the app taking the screenshot only needs to send the first message to the first app once. Afterward, the first app can periodically or at regular intervals automatically scroll through the first long page.
[0436] In one possible implementation, the first page is scrolled automatically by the electronic device, or the first page is scrolled by the electronic device in response to an operation for scrolling the first long page.
[0437] In one possible implementation, the o view controls are the first-level child view controls of the root view control. For example, the root view control can be view control 1 as shown in Figure 4.
[0438] In one possible implementation, the m view controls in the first user interface or the n view controls in the second user interface include any one or more of the following: text control, icon control, button control, menu control, tab control, text box control, dialog box control, status bar control, navigation bar control, and widget control.
[0439] 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, the computer program code including computer instructions, and when the one or more processors execute the computer instructions, the electronic device performs a scrolling screenshot method as shown in FIG13.
[0440] 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 FIG13.
[0441] 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 FIG13.
[0442] This application provides a chip for use in an electronic device. The chip includes one or more processors that invoke computer instructions to cause the electronic device to execute a scrolling screenshot method as shown in FIG13.
[0443] 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.
[0444] 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.
[0445] 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 is applied to an electronic device, the electronic device including a first application, a scrolling screenshot application, and a first system service; the method includes: The first application displays a first user interface, which includes the content of the first page of the first long page of the first application. The first application sends the position information of m view controls in the first user interface to the first system service; The scrolling screenshot application obtains a first screenshot image of the first user interface; The scrolling screenshot application obtains the position information of m view controls in the first user interface from the first system service; The first application scrolls the first long page and displays a second user interface, the second user interface including the second page content of the first long page of the first application, and the second page content and the first page content have a first overlapping area; The first application sends the position information of n view controls in the second user interface to the first system service; The scrolling screenshot application obtains a second screenshot image of the second user interface; The scrolling screenshot application obtains the position information of n view controls in the second user interface from the first system service; The scrolling screenshot application determines the first repeating area based on the position information of m view controls in the first user interface and the position information of n view controls in the second user interface; 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 further includes a gesture recognition module; before the scrolling screenshot application acquires the first screenshot image of the first user interface, the method further includes: The gesture recognition module recognizes the first user operation that enables the long screenshot function. In response to the first user operation, the gesture recognition module sends a first message to the scrolling screenshot application; The scrolling screenshot application obtains the first screenshot image of the first user interface, specifically including: In response to the first message, the scrolling screenshot application obtains a first screenshot image of the first user interface.
3. The method according to claim 1 or 2, characterized in that, The m view controls include the p view controls and the o view controls, and the n view controls include the p view controls and the o view controls. The position information of the p view controls in the first user interface is the same as the position information of the p view controls in the second user interface, and the position information of the o view controls in the first user interface is different from the position information of the o view controls in the second user interface.
4. The method according to claim 3, characterized in that, The scrolling screenshot application determines the first repeating area based on the position information of m view controls in the first user interface and the position information of n view controls in the second user interface, specifically including: The scrolling screenshot application defines the area outside the display area where the p view controls are located in the first user interface and the second user interface as the page scrolling area; The scrolling screenshot application determines the first distance of scrolling the first long page based on the difference between the position information of the o view controls in the scrolling area of the first user interface and the position information of the o view controls in the scrolling area of the second user interface. The electronic device determines the height of the first repeating area based on the height of the page scrolling area and the first distance. The electronic device determines the first repeating region based on the height of the first repeating region.
5. The method according to claim 4, characterized in that, The first distance is less than the height of the page scrolling area.
6. The method according to claim 4 or 5, characterized in that, The o view controls include a first view control; The scrolling screenshot application determines the first distance of scrolling the first long page based on the difference between the position information of the o view controls in the scrolling area of the first user interface and the position information of the o view controls in the scrolling area of the second user interface, specifically including: The scrolling screenshot application determines the first distance of scrolling the first long page based on the difference between the position information of the first view control in the scrolling area of the first user interface and the position information of the first view control in the scrolling area of the second user interface.
7. The method according to claim 4 or 5, characterized in that, The scrolling screenshot application determines the first distance of scrolling the first long page based on the difference between the position information of the o view controls in the scrolling area of the first user interface and the position information of the o view controls in the scrolling area of the second user interface, specifically including: The scrolling screenshot application determines the first distance of scrolling the first long page based on the mode of the difference between the position information of o view controls in the scrolling area of the first user interface and the position information of o view controls in the scrolling area of the second user interface.
8. The method according to claim 4 or 5, characterized in that, The scrolling screenshot application determines the first distance of scrolling the first long page based on the difference between the position information of the o view controls in the scrolling area of the first user interface and the position information of the o view controls in the scrolling area of the second user interface, specifically including: The scrolling screenshot application determines the first distance of scrolling the first long page based on the minimum value of the difference between the position information of o view controls in the scrolling area of the first user interface and the position information of o view controls in the scrolling area of the second user interface.
9. The method according to claim 2, 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 first repeated area in the content of the first page, and stitches the processed content of the first page and the second screenshot image together to obtain a first long screenshot; or, The electronic device cuts out the first repeated area from 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.
10. The method according to claim 9, characterized in that, The area where the p view controls are located in the first user interface or the second user interface includes a top fixed area and / or a bottom fixed area, and the page scrolling area is located below the top fixed area and above the bottom fixed area; The scrolling screenshot application crops the first repeated area 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 including: The scrolling screenshot application sequentially stitches together the top fixed area, the processed first page content, the second page content, 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 scrolling screenshot application sequentially stitches together the top fixed area, the first page content, the processed second page content, and the bottom fixed area to obtain the first long screenshot.
11. The method according to any one of claims 1-10, wherein before the first application scrolls the first long page, the method further comprises: The scrolling screenshot application sends a second message to the first application, the second message carrying a second distance; In response to the first message, the first application controls the first long page to scroll the first distance in the first direction, the first distance being the same as or different from the second distance.
12. The method according to any one of claims 1-11, characterized in that, The first page is scrolled automatically by the electronic device, or the first page is scrolled by the electronic device in response to an operation for scrolling the first long page.
13. The method according to any one of claims 3-10, characterized in that, The o view controls are the first-level child view controls of the root view control.
14. The method according to any one of claims 1-13, characterized in that, The m view controls in the first user interface or the n view controls in the second user interface include any one or more of the following: text control, icon control, button control, menu control, tab control, text box control, dialog box control, status bar control, navigation bar control, and widget control.
15. 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-14.
16. 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-14.
17. 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-14.
Citation Information
Patent Citations
Terminal screen capturing method and device and mobile terminal
CN107967099A
Screenshot method, terminal and computer readable storage medium
CN109976859A
Webpage long screenshot method and device, equipment and storage medium
CN113448470A
Method and device for rolling screen capture
CN115145457A
Screen capture method, graphical interface and electronic equipment
CN115268741A