CN117389448A - Screen capturing method, screen capturing device, electronic apparatus, and computer-readable storage medium - Google Patents

Screen capturing method, screen capturing device, electronic apparatus, and computer-readable storage medium Download PDF

Info

Publication number
CN117389448A
CN117389448A CN202210767720.5A CN202210767720A CN117389448A CN 117389448 A CN117389448 A CN 117389448A CN 202210767720 A CN202210767720 A CN 202210767720A CN 117389448 A CN117389448 A CN 117389448A
Authority
CN
China
Prior art keywords
image
height
screen
region
screenshot
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210767720.5A
Other languages
Chinese (zh)
Inventor
谭传勇
邱志帆
阮方燃
黄成意
范辉强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Samsung Guangzhou Mobile R&D Center
Samsung Electronics Co Ltd
Original Assignee
Samsung Guangzhou Mobile R&D Center
Samsung Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Samsung Guangzhou Mobile R&D Center, Samsung Electronics Co Ltd filed Critical Samsung Guangzhou Mobile R&D Center
Priority to CN202210767720.5A priority Critical patent/CN117389448A/en
Publication of CN117389448A publication Critical patent/CN117389448A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/0485Scrolling or panning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T3/4038Scaling the whole image or part thereof for image mosaicing, i.e. plane images composed of plane sub-images

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Image Processing (AREA)

Abstract

The present disclosure provides a screen capturing method, a screen capturing apparatus, an electronic device, and a computer-readable storage medium, including: acquiring a first screen capturing image of a page; determining a scrolling height based on region information of a dynamic region in the case where a part of the dynamic region exists at the bottom of the first screen shot image; scrolling the page and acquiring a second screen capture image of the page based on the determined scroll height; and obtaining a long screen shot image by stitching the first screen shot image and the second screen shot image.

Description

Screen capturing method, screen capturing device, electronic apparatus, and computer-readable storage medium
Technical Field
The present disclosure relates to the field of computer technology, and more particularly, to a screen capturing method, a screen capturing apparatus, an electronic device, and a computer readable storage medium.
Background
Today, mobile phones support long shots, which are preferred by more people to share some information. The long screenshot is formed by splicing a piece Zhang Jietu, but if a dynamic image (for example, video, gif, etc.) is encountered in the screenshot process, the dynamic image is just at the splicing position of the upper screenshot and the lower screenshot, and when the long screenshot is spliced, the whole dynamic image is split into two parts and is intercepted twice. Because the dynamic diagram is always changing, the interception time of two parts of the dynamic diagram is different, and the intercepted contents are different, so that the two inconsistent screenshot splicing of the two contents is caused when the two parts are spliced, the generated long screenshot is disordered, and the generated long screenshot is not a complete spliced image.
Disclosure of Invention
The present disclosure provides a screen capturing method, a screen capturing apparatus, an electronic device, and a computer-readable storage medium to solve at least the problems in the related art described above, or to not solve any of the problems described above.
According to a first aspect of embodiments of the present disclosure, there is provided a screen capturing method, which may include: acquiring a first screen capturing image of a page; determining a scrolling height based on region information of a dynamic region in the case where a part of the dynamic region exists at the bottom of the first screen shot image; scrolling the page and acquiring a second screen capture image of the page based on the determined scroll height; and obtaining a long screen shot image by stitching the first screen shot image and the second screen shot image.
Optionally, the step of determining the roll height may include: determining a height of the portion of the dynamic region based on the region information of the dynamic region and the bottom position information of the first screen capture image; and determining a scroll height based on a difference between the screen height and the height of the portion of the dynamic region.
Optionally, the step of obtaining a long screen shot image by stitching the first screen shot image and the second screen shot image may include: removing a bottom region from the first screen capture image having a height that is the difference between the screen height and the determined scroll height; and stitching the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
Optionally, when the actual scrolling height is smaller than the determined scrolling height, the step of stitching the removed first screen capture image and the second screen capture image to obtain the long screen capture image may include: removing a top region from the second screen capture image having a height that is the difference between the determined scroll height and the actual scroll height; and stitching the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
Optionally, the step of determining the roll height may include: the difference between the screen height and the height of the portion of the dynamic region is determined as the scroll height.
Optionally, the step of determining the roll height may include: a value obtained by subtracting a preset height from a difference between the screen height and the height of the portion of the dynamic region is determined as a scroll height.
Optionally, the step of obtaining a long screen shot image by stitching the first screen shot image and the second screen shot image may include: taking a region with the height of the preset height at the top of the second screen capturing image as a comparison region; looking up a region of the first screenshot image that is the same as the contrast region starting above the portion of dynamic region of the first screenshot image; removing the found region and the portion of the dynamic region from the first screen shot image; and stitching the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
Optionally, when the actual scrolling height is smaller than the determined scrolling height, the step of stitching the removed first screen capture image and the second screen capture image to obtain the long screen capture image may include: removing a top region from the second screen capture image having a height that is the difference between the determined scroll height and the actual scroll height; and stitching the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
Optionally, in the case that the first screen capturing image and the second screen capturing image include at least one preset area, the step of determining the scroll height based on a difference between a screen height and a height of the portion of the dynamic area may include: the scroll height is determined based on a value obtained by subtracting the height of the at least one preset area from the screen height and subtracting the height of the part of the dynamic area.
Optionally, in the case that the at least one preset area includes a top preset area, the step of obtaining a long screen shot image by stitching the first screen shot image and the second screen shot image may include: removing a bottom region having a height from the first screen capture image that is a value obtained by subtracting the determined scroll height from the screen height and subtracting the top preset region height; removing a top preset region from the second screen shot image; and stitching the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
Optionally, when the actual scrolling height is smaller than the determined scrolling height, the step of stitching the removed first screen capture image and the removed second screen capture image to obtain the long screen capture image may include: removing from the removed second screen shot image an area having a height immediately below the top preset area that is the difference between the determined scroll height and the actual scroll height; and stitching the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
Optionally, in the case that the at least one preset area includes a bottom preset area, the step of obtaining a long screen shot image by stitching the first screen shot image and the second screen shot image may include: removing a bottom region from the first screen capture image having a height that is the difference between the screen height and the determined scroll height; and stitching the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
Optionally, when the actual scrolling height is smaller than the determined scrolling height, the step of stitching the removed first screen capture image and the second screen capture image to obtain the long screen capture image may include: removing a top region from the second screen capture image having a height that is the difference between the determined scroll height and the actual scroll height; and stitching the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
Optionally, in the case that the at least one preset area includes a top preset area and a bottom preset area, the step of obtaining a long screen shot image by stitching the first screen shot image and the second screen shot image may include: removing a bottom region having a height from the first screen capture image that is a value obtained by subtracting the determined scroll height from the screen height and subtracting the top preset region height; removing a top preset region from the second screen shot image; and stitching the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
Optionally, when the actual scrolling height is smaller than the determined scrolling height, the step of stitching the removed first screen capture image and the removed second screen capture image to obtain the long screen capture image may include: removing from the removed second screen shot image an area having a height immediately below the top preset area that is the difference between the determined scroll height and the actual scroll height; and stitching the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
Optionally, the step of obtaining a long screen shot image by stitching the first screen shot image and the second screen shot image may include: removing the at least one preset area of the first screen capturing image and the second screen capturing image to obtain a corresponding first image and second image respectively; removing a bottom region from the first image having a height that is the difference between the height of the first image and the determined scroll height; and stitching the removed first image and the removed second image to obtain the long screen capturing image.
Optionally, when the actual scrolling height is smaller than the determined scrolling height, the step of stitching the removed first image and the second image to obtain the long screen shot image may include: removing a top region from the second image having a height that is the difference between the determined scroll height and the actual scroll height; splicing the removed first image and the removed second image; and splicing the corresponding at least one preset area at the corresponding position of the spliced image to obtain a long screen capturing image.
Optionally, after acquiring the first screen capturing image, the method may further include: a determination is made as to whether a portion of a dynamic region exists at the bottom of the first screen shot image.
Optionally, the step of determining whether a portion of the dynamic region exists at the bottom of the first screen shot image may include: acquiring area information of the dynamic area and user interface UI layout information of the first screen capturing image; calculating bottom position information of the first screen capturing image based on the UI layout information and the screen resolution of the first screen capturing image; and determining whether a part of the dynamic region exists at the bottom of the first screen shot image based on the region information of the dynamic region and the bottom position information of the first screen shot image.
According to a second aspect of the embodiments of the present disclosure, there is provided a screen capturing apparatus, including: a first screen capturing image acquisition unit configured to acquire a first screen capturing image of a page; a scroll height determining unit configured to determine a scroll height based on area information of a dynamic area in a case where a part of the dynamic area exists at a bottom of the first screen shot image; a second screen capture image acquisition unit configured to scroll the page and acquire a second screen capture image of the page based on the determined scroll height; and a stitching unit configured to obtain a long screen shot image by stitching the first screen shot image and the second screen shot image.
Alternatively, the scroll height determination unit may be configured to: determining a height of the portion of the dynamic region based on the region information of the dynamic region and the bottom position information of the first screen capture image; and determining a scroll height based on a difference between the screen height and the height of the portion of the dynamic region.
Alternatively, the splicing unit may be configured to: removing a bottom region from the first screen capture image having a height that is the difference between the screen height and the determined scroll height; and stitching the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
Optionally, when the actual roll height is smaller than the determined roll height, the stitching unit may be further configured to: removing a top region from the second screen capture image having a height that is the difference between the determined scroll height and the actual scroll height; and stitching the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
Alternatively, the scroll height determination unit may be configured to: the difference between the screen height and the height of the portion of the dynamic region is determined as the scroll height.
Alternatively, the scroll height determination unit may be configured to: a value obtained by subtracting a preset height from a difference between the screen height and the height of the portion of the dynamic region is determined as a scroll height.
Alternatively, the splicing unit may be configured to: taking a region with the height of the preset height at the top of the second screen capturing image as a comparison region; looking up a region of the first screenshot image that is the same as the contrast region starting above the portion of dynamic region of the first screenshot image; removing the found region and the portion of the dynamic region from the first screen shot image; and stitching the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
Optionally, when the actual roll height is smaller than the determined roll height, the stitching unit may be further configured to: removing a top region from the second screen capture image having a height that is the difference between the determined scroll height and the actual scroll height; and stitching the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
Alternatively, in the case where the first screen capturing image and the second screen capturing image include at least one preset area, the scroll height determining unit may be configured to: the scroll height is determined based on a value obtained by subtracting the height of the at least one preset area from the screen height and subtracting the height of the part of the dynamic area.
Optionally, in case the at least one preset area comprises a top preset area, the stitching unit may be configured to: removing a bottom region having a height from the first screen capture image that is a value obtained by subtracting the determined scroll height from the screen height and subtracting the top preset region height; removing a top preset region from the second screen shot image; and stitching the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
Optionally, when the actual roll height is smaller than the determined roll height, the stitching unit may be further configured to: removing from the removed second screen shot image an area having a height immediately below the top preset area that is the difference between the determined scroll height and the actual scroll height; and stitching the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
Optionally, in case the at least one preset area comprises a bottom preset area, the stitching unit may be configured to: removing a bottom region from the first screen capture image having a height that is the difference between the screen height and the determined scroll height; and stitching the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
Optionally, when the actual roll height is smaller than the determined roll height, the stitching unit may be further configured to: removing a top region from the second screen capture image having a height that is the difference between the determined scroll height and the actual scroll height; and stitching the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
Optionally, in case the at least one preset area comprises a top preset area and a bottom preset area, the stitching unit may be configured to: removing a bottom region having a height from the first screen capture image that is a value obtained by subtracting the determined scroll height from the screen height and subtracting the top preset region height; removing a top preset region from the second screen shot image; and stitching the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
Optionally, when the actual roll height is smaller than the determined roll height, the stitching unit may be further configured to: removing from the removed second screen shot image an area having a height immediately below the top preset area that is the difference between the determined scroll height and the actual scroll height; and stitching the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
Alternatively, the splicing unit may be configured to: removing the at least one preset area of the first screen capturing image and the second screen capturing image to obtain a corresponding first image and second image respectively; removing a bottom region from the first image having a height that is the difference between the height of the first image and the determined scroll height; and stitching the removed first image and the removed second image to obtain the long screen capturing image.
Optionally, when the actual roll height is smaller than the determined roll height, the stitching unit may be further configured to: removing a top region from the second image having a height that is the difference between the determined scroll height and the actual scroll height; splicing the removed first image and the removed second image; and splicing the corresponding at least one preset area at the corresponding position of the spliced image to obtain a long screen capturing image.
Optionally, the screen capturing apparatus may further include a dynamic region determining unit configured to: after the first screen capturing image is acquired by the first screen capturing image acquisition unit, it is determined whether a part of the dynamic area exists at the bottom of the first screen capturing image.
Alternatively, the dynamic region determination unit may be configured to: acquiring area information of the dynamic area and user interface UI layout information of the first screen capturing image; calculating bottom position information of the first screen capturing image based on the UI layout information and the screen resolution of the first screen capturing image; and determining whether a part of the dynamic region exists at the bottom of the first screen shot image based on the region information of the dynamic region and the bottom position information of the first screen shot image.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device, including: a processor; a memory for storing the processor-executable instructions, wherein the processor-executable instructions, when executed by the processor, cause the processor to perform the screen capture method.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, cause the processor to implement the screen capture method.
According to the screen capturing method and the screen capturing device, when a long screen capturing is executed, under the condition that a part of a dynamic image or video exists at the bottom of an upper screen capturing, the lower screen capturing can comprise a complete dynamic image or video, and the complete dynamic image or video in the lower screen capturing is reserved when the upper screen capturing and the lower screen capturing are spliced, so that the complete long screen capturing of the dynamic image or the video can be synthesized, the picture connection disorder at the splicing position is avoided, the quality of the long screen capturing is improved, and the user experience is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure and do not constitute an undue limitation on the disclosure.
FIG. 1 is a diagram illustrating obtaining a long screen shot image by stitching a first screen shot image and a second screen shot image;
FIG. 2 is a flowchart illustrating a method of obtaining a long screen shot image according to an example embodiment of the present disclosure;
FIG. 3 is a diagram illustrating a portion of a dynamic region determining whether a dynamic region exists at the bottom of a first screen shot image according to an example embodiment of the present disclosure;
FIG. 4 is a diagram illustrating stitching a first screen capture image and a second screen capture image to obtain a long screen capture image according to a first example embodiment of the present disclosure;
FIG. 5 is a diagram illustrating stitching a first screen capture image and a second screen capture image to obtain a long screen capture image according to a second example embodiment of the present disclosure;
fig. 6 and 7 are diagrams illustrating a method of obtaining a long screen shot image by stitching a first screen shot image and a second screen shot image in a case where at least one preset area includes a top preset area according to a third exemplary embodiment of the present disclosure;
Fig. 8 and 9 are diagrams illustrating a method of obtaining a long screen shot image by stitching a first screen shot image and a second screen shot image in a case where at least one preset area includes a bottom preset area according to a fourth exemplary embodiment of the present disclosure;
fig. 10 and 11 are diagrams illustrating a method of obtaining a long screen shot image by stitching a first screen shot image and a second screen shot image in a case where at least one preset area includes a top preset area and a bottom preset area according to a fifth exemplary embodiment of the present disclosure;
FIG. 12 is a flowchart illustrating an application scenario to which a method of obtaining a long screen shot image according to an example embodiment of the present disclosure is applied;
FIG. 13 is a block diagram of a screen capture device according to an exemplary embodiment of the present disclosure; and
fig. 14 is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The embodiments described in the examples below are not representative of all embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
It should be noted that, in this disclosure, "at least one of the items" refers to a case where three types of juxtaposition including "any one of the items", "a combination of any of the items", "an entirety of the items" are included. For example, "including at least one of a and B" includes three cases side by side as follows: (1) comprises A; (2) comprising B; (3) includes A and B. For example, "at least one of the first and second steps is executed", that is, three cases are juxtaposed as follows: (1) performing step one; (2) executing the second step; (3) executing the first step and the second step.
Currently, when a long screenshot is obtained, if a dynamic region appears in the screenshot process, there is no method for identifying the dynamic region, so as to splice multiple shots based on the position of the dynamic region. Fig. 1 is a diagram showing that a long screen shot image is obtained by stitching a first screen shot image and a second screen shot image. As shown in fig. 1 (a) and (b), since the first screen capturing image and the second screen capturing image include two portions of one dynamic image, the time of acquiring the first screen capturing image is before or after the time of acquiring the second screen capturing image, and thus the two portions of the dynamic image may belong to different image contents of the dynamic image, so that the resulting long screen capturing image has a disorder of the image contents at the splicing position (as shown in fig. 1 (c)).
In order to solve the above-mentioned problems, the present disclosure provides a screen capturing method and a screen capturing device, which can identify a dynamic region when a part of the dynamic region exists at the bottom of a first screen capturing image, and determine the height of screen scrolling according to the information of the dynamic region, so that a second screen capturing image contains a complete moving picture, and then clip and splice the first screen capturing image and the second screen capturing image, so that a perfect long screen capturing can be synthesized.
A screen capturing method and a screen capturing apparatus according to example embodiments of the present disclosure will be described in detail below with reference to fig. 2 to 13.
Fig. 2 is a flowchart illustrating a method of obtaining a long screen shot image according to an example embodiment of the present disclosure.
According to example embodiments of the present disclosure, after the long graph intercept function is initiated, a first screen shot image of a page may be acquired at step S210. The first screen capture image of the page may be the entire screen, or a portion of the screen (e.g., the user may set the capture area of the screen as desired). In the following, by way of example only, the first screen capture image of a page is the entire screen.
In step S220, in case that a part of the dynamic area exists at the bottom of the first screen shot image, the scroll height may be determined based on the area information of the dynamic area.
According to an exemplary embodiment of the present disclosure, after the first screen shot image is acquired, it may be determined whether a portion of the dynamic region exists at the bottom of the first screen shot image. If there is no portion of the dynamic region at the bottom of the first screenshot, the page may be scrolled and a second screenshot of the page may be acquired and the first and second screenshots stitched according to conventional methods. If a part of the dynamic area exists at the bottom of the first screen shot image, the second screen shot image can be made to comprise the complete dynamic area, the part of the dynamic area of the first screen shot image is removed when the second screen shot image is spliced, and the complete dynamic area in the second screen shot image is reserved, so that a complete long screenshot is synthesized. The process of determining whether a portion of the dynamic region exists at the bottom of the first screen shot image will be described in detail below in connection with fig. 3.
Fig. 3 is a diagram illustrating a determination of whether there is a portion of a dynamic region at the bottom of a first screen shot image according to an example embodiment of the present disclosure.
First, area information of a dynamic area may be acquired. By way of example only, application (app) layer information (such as application package name, layer name, etc.) displayed at the top layer on the current screen may be obtained by the Android system, and region information (e.g., coordinates, size, etc.) of the dynamic region being changed on the layer may be obtained by Android SurfaceFlinger. The region information may be expressed as a plurality of Rect [ ], rect0[ X0, Y0, X1, Y1], rect1[ ], where Rect is empty may indicate that the current screen is unchanged, i.e., there is no dynamic region, rect0[ X0, Y0, X1, Y1] may indicate the upper leftmost angular coordinate (X0, Y0) and the lower rightmost angular coordinate (X1, Y1) of the dynamic region, or may indicate the upper rightmost angular coordinate (X0, Y0) and the lower leftmost angular coordinate (X1, Y1) of the dynamic region. There may be multiple dynamic regions in the first screen shot image, and multiple non-empty arrays Rect may be obtained.
Since the screen displayed interface is a tree structure constructed of various components, all User Interface (UI) layout information of the current displayed interface can be obtained through android uiautomator, and these information record all display controls of the current interface, including content descriptions displayed by the components and sizes, coordinates, etc. of the region.
After the UI layout information is obtained, bottom position information of the first screen shot image (for example, the bottommost coordinates of the scrollable content of the current screen, such as the coordinates of the point at the leftmost lower corner thereof, but not limited thereto, may be, for example, the coordinates of any point on the bottommost line thereof) may be calculated. Specifically, the bottommost coordinates S (x, y) may be calculated from the obtained UI layout information and screen resolution. If there is no bottom preset area (e.g., an application internal navigation bar and a system navigation bar), the bottommost coordinates S (x, y) are bottom position information of the first screen shot image. If the screen interface has a system navigation bar without applying an internal navigation bar (as in the right-hand diagram of fig. 3), the bottommost coordinates S' (x, y) can be obtained as the bottom position information of the first screen shot image according to the position of the system navigation bar.
It may be determined whether a portion of the dynamic region exists at the bottom of the first screen shot image based on the region information of the dynamic region and the bottom position information of the first screen shot image. For example, it may be determined whether the above calculated bottommost coordinates S (x, y) or S' (x, y) overlap with the region information Rect [ ] (excluding the upper and lower boundaries of the dynamic region) of the dynamic region, and if so, it is determined that a portion of the dynamic region exists at the bottom of the first screen shot image, and otherwise, it is determined that a portion of the dynamic region does not exist at the bottom of the first screen shot image.
According to an exemplary embodiment of the present disclosure, a height H of a portion of the dynamic region in the first screen capture image (e.g., H may be an absolute value of a difference between an upper left-corner ordinate Y0 of the dynamic region and Y of the bottom position information of the first screen capture image) may be determined based on region information of the dynamic region (e.g., rect0[ X0, Y0, X1, Y1 ]) and bottom position information of the first screen capture image (e.g., bottommost coordinates S (X, Y) or S' (X, Y) as described above), and a scroll height G may be determined based on a difference between the screen height H and the height H of the portion of the dynamic region. That is, the determined scroll height needs to ensure that the complete dynamic region can be presented in the second screenshot image of the page (i.e., G.ltoreq.H-H). For example, the difference between the screen height and the height of the portion of the dynamic region may be determined as the scroll height (i.e., g=h-H).
In step S230, the page may be scrolled and a second screenshot of the page may be acquired based on the determined scroll height.
In step S240, a long screen shot image may be obtained by stitching the first screen shot image and the second screen shot image. For example, when the scroll height is H-H, a long screen shot image may be acquired by removing a bottom region of the first screen shot image having a height of H (i.e., the partial dynamic region) and stitching the removed first screen shot image and second screen shot image.
A process of obtaining a long screen shot image by stitching the first screen shot image and the second screen shot image will be described below with reference to fig. 4 to 11.
Fig. 4 is a diagram illustrating stitching of a first screen capture image and a second screen capture image to obtain a long screen capture image according to a first example embodiment of the present disclosure.
In the case where a part of the dynamic area exists at the bottom of the first screen shot image as shown in fig. 4 (a), a difference between the screen height and the height of the part of the dynamic area may be determined as a scroll height, and based on the determined scroll height H-H, the page is scrolled and a second screen shot image is acquired (as shown in fig. 4 (b)).
A long screen shot image may be obtained by removing a bottom region having a height that is the difference between the screen height H and the determined scroll height G from the first screen shot image (i.e., removing the portion of the dynamic region from the first screen shot image), and stitching the removed first screen shot image and second screen shot image (as shown in (c) of fig. 4).
Fig. 5 is a diagram illustrating stitching of a first screenshot image and a second screenshot image to obtain a long screenshot image according to a second example embodiment of the present disclosure.
As shown in fig. 5 (a), in the case where a part of the dynamic region exists at the bottom of the first screen shot image, a value obtained by subtracting a preset height hx from a difference between the screen height and the height of the part of the dynamic region may be determined as a scroll height (g=h-H-hx), and based on the determined scroll height, the page is scrolled and a second screen shot image is acquired (as shown in fig. 5 (b)). As shown in fig. 5 (a) and (b), the region of height hx may be a non-dynamic region, or may contain all but not a portion of the other dynamic region.
Similar to the stitching method described with reference to fig. 4, a long screen shot image may be obtained by removing a bottom region having a height that is a difference between the screen height H and the determined scroll height G from the first screen shot image (i.e., removing the partial dynamic region and a region having a height hx immediately above the partial dynamic region from the first screen shot image), and stitching the removed first screen shot image and second screen shot image (as shown in (c) of fig. 5).
However, when the actual scroll height is less than the determined scroll height (e.g., when the page has been scrolled to the bottommost portion during scrolling of the page and cannot continue scrolling to the determined scroll height, or when the user manually scrolls the page such that the actual scroll height is less than the determined scroll height), the step of stitching the removed first and second screenshot images described with reference to fig. 4 or 5 may include: and removing a top area with the height being the difference between the determined scrolling height and the actual scrolling height from the second screen capture image, and stitching the removed first screen capture image and the removed second screen capture image to obtain a long screen capture image.
Further, the method of stitching the first screen shot image and the second screen shot image to obtain a long screen shot image described with reference to fig. 5 is not limited thereto, and for example, a long screen shot image may also be obtained by the following method of finding a contrast region: taking a region with the height of the preset height hx at the top of the second screen capturing image as a comparison region; searching the region of the first screen capturing image, which is the same as the contrast region, upwards from the upper part of the dynamic region of the first screen capturing image; removing the found region and the portion of the dynamic region from the first screen shot image; and splicing the removed first screen capturing image and the second screen capturing image to obtain a long screen capturing image. Here, the region at the top of the second screen shot image having the height of the preset height hx cannot include other dynamic regions or a part thereof, and when the region at the height of the preset height hx includes other dynamic regions or a part thereof, the hx size may be appropriately modified, for example, the hx may be reduced such that the region at the preset height hx does not include other dynamic regions or a part thereof. Further, similarly, when the actual scroll height is smaller than the determined scroll height, the step of stitching the removed first screen capture image and the removed second screen capture image to obtain a long screen capture image may include: removing a top region from the second screen capture image having a height that is the difference between the determined scroll height and the actual scroll height; and stitching the removed first screen capture image and the removed second screen capture image to obtain a long screen capture image.
According to example embodiments of the present disclosure, the application screen may include at least one preset area (e.g., an area that is not scrollable), that is, the first screen capture image and the second screen capture image may include at least one preset area. The at least one preset region may include, for example, but not limited to, a top preset region Ht, a bottom preset region Hb, or both the top preset region and the bottom preset region (Ht and Hb). Further, the top preset area and the bottom preset area may be one or more, and are described herein using one top preset area and/or one bottom preset area by way of example only. In the case where the first screen capture image and the second screen capture image include at least one preset region, the step of determining the scroll height based on a difference between the screen height and the height of the portion of the dynamic region may include: the scroll height is determined based on a value obtained by subtracting the height of at least one preset area from the screen height and subtracting the height of the part of the dynamic area. A method of obtaining a long screen shot image by stitching the first screen shot image and the second screen shot image in a case where the first screen shot image and the second screen shot image include at least one preset area is described below with reference to fig. 6 to 11.
Fig. 6 and 7 are diagrams illustrating a method of obtaining a long screen shot image by stitching a first screen shot image and a second screen shot image in a case where at least one preset area includes a top preset area according to a third exemplary embodiment of the present disclosure.
As shown in fig. 6, in the case where at least one preset area includes a top preset area (e.g., an a area having a height of Ht in fig. 6), the scroll height G may be determined as H-Ht. At this time, the step of obtaining the long screen shot image by stitching the first screen shot image and the second screen shot image may include: removing a bottom region having a height that is a value obtained by subtracting the determined scroll height from the screen height and subtracting the top preset region height from the first screen shot image (i.e., removing a bottom dynamic region having a height h from the first screen shot image); removing the top preset region from the second screen shot image; and stitching the removed first screenshot image and the removed second screenshot image to obtain a long screenshot image (as shown in fig. 6 (c)).
As shown in FIG. 7, the roll height G may be determined as H-H-hx-Ht. Similar to the steps described with reference to fig. 6, the step of obtaining a long screen shot image by stitching the first screen shot image and the second screen shot image may include: removing a bottom region having a height that is a value obtained by subtracting the determined scroll height from the screen height and subtracting the top preset region height from the first screen shot image (i.e., removing a bottom region having a height h+hx from the first screen shot image); removing the top preset region from the second screen shot image; and stitching the removed first screenshot image and the removed second screenshot image to obtain a long screenshot image (as shown in fig. 7 (c)).
In addition, when the scrolling height is H-hx-Ht, the first screen capturing image and the second screen capturing image may be spliced to obtain a long screen capturing image by the method of searching the contrast area as described above, which will not be described herein.
Further, when the actual scroll height is smaller than the determined scroll height, the step of stitching the removed first screen shot image and the removed second screen shot image, described with reference to fig. 6 and 7, to obtain a long screen shot image may include: removing a region having a height immediately below the top preset region from the removed second screen shot image as a difference between the determined scroll height and the actual scroll height; and stitching the removed first screen capture image and the removed second screen capture image to obtain a long screen capture image.
Fig. 8 and 9 are diagrams illustrating a method of obtaining a long screen shot image by stitching a first screen shot image and a second screen shot image in a case where at least one preset area includes a bottom preset area according to a fourth exemplary embodiment of the present disclosure.
As shown in fig. 8, in the case where at least one preset area includes a bottom preset area (e.g., the B area having a height Hb in fig. 8), the scroll height G may be determined as H-Hb. At this time, the step of obtaining the long screen shot image by stitching the first screen shot image and the second screen shot image may include: removing a bottom region having a height that is the difference between the screen height and the determined scroll height from the first screen capture image (i.e., removing the portion of the dynamic region and the bottom preset region from the first screen capture image); and splicing the removed first screen capturing image and the second screen capturing image to obtain a long screen capturing image.
As shown in fig. 9, in the case where at least one preset area includes a bottom preset area (e.g., the B area having a height Hb in fig. 9), the scroll height G may be determined as H-hx-Hb. Similar to the steps described with reference to fig. 8, the step of obtaining a long screen shot image by stitching the first screen shot image and the second screen shot image may include: the bottom region having a height of the difference between the screen height and the determined scroll height is removed from the first screen shot image (i.e., the region having a height hx immediately above the partial dynamic region, and the bottom preset region are removed from the first screen shot image), and the removed first screen shot image and second screen shot image are stitched to obtain a long screen shot image.
In addition, when the scrolling height is H-hx-Hb, the first screen capturing image and the second screen capturing image may be spliced to obtain a long screen capturing image by the method of searching the contrast area as described above, which will not be described herein.
Further, when the actual scroll height is smaller than the determined scroll height, the step of stitching the removed first and second screen shots, described with reference to fig. 8 and 9, to obtain a long screen shot may include: and removing a top area with the height being the difference between the determined scrolling height and the actual scrolling height from the second screen capture image, and stitching the removed first screen capture image and the removed second screen capture image to obtain a long screen capture image.
Fig. 10 and 11 are diagrams illustrating a method of obtaining a long screen shot image by stitching a first screen shot image and a second screen shot image in a case where at least one preset area includes a top preset area and a bottom preset area according to a fifth exemplary embodiment of the present disclosure.
As shown in fig. 10, in case that at least one preset area includes a top preset area and a bottom preset area, the roll height G may be determined as H-Hb-Ht. At this time, the step of obtaining the long screen shot image by stitching the first screen shot image and the second screen shot image may include: removing a bottom region having a height that is a value obtained by subtracting the determined scroll height from the screen height and subtracting the top preset region height from the first screen shot image (i.e., removing the partial dynamic region and the bottom preset region from the first screen shot image), removing the top preset region from the second screen shot image, and stitching the removed first screen shot image and the removed second screen shot image to obtain a long screen shot image (as shown in (c) of fig. 10).
As shown in FIG. 11, the roll height G may be determined as H-H-hx-Hb-Ht. Similar to the steps described with reference to fig. 10, the step of obtaining a long screen shot image by stitching the first screen shot image and the second screen shot image may include: removing a bottom region having a height that is a value obtained by subtracting the determined scroll height from the screen height and subtracting the top preset region height from the first screen shot image (i.e., removing the partial dynamic region, the bottom preset region, and a region having a height hx immediately above the partial dynamic region from the first screen shot image), removing the top preset region from the second screen shot image, and stitching the removed first screen shot image and the removed second screen shot image to obtain a long screen shot image (as shown in (c) of fig. 11).
In addition, when the scrolling height is H-hx-Hb-Ht, the first screen capturing image and the second screen capturing image may be spliced to obtain a long screen capturing image by the method of searching the contrast area as described above, which will not be described herein.
Further, when the actual scroll height is smaller than the determined scroll height, the step of stitching the removed first screen shot image and the removed second screen shot image, described with reference to fig. 10 and 11, to obtain a long screen shot image may include: and removing the area with the height which is the difference between the determined rolling height and the actual rolling height from the removed second screen capturing image, and splicing the removed first screen capturing image and the removed second screen capturing image to obtain a long screen capturing image.
According to another example embodiment of the present disclosure, when the first and second screen shots include at least one preset area, a bottom area having a height that is a difference between the height of the first image and the determined scroll height may be removed from the first image by removing at least one preset area of the first and second screen shots to obtain corresponding first and second images, respectively, and the removed first and second images may be stitched.
In addition, when the actual scroll height is smaller than the determined scroll height, the step of stitching the removed first image and the removed second image may include: and removing a top area with the height being the difference between the determined rolling height and the actual rolling height from the second image, stitching the removed first image and the removed second image, and stitching at least one corresponding preset area at the corresponding position of the stitched image to obtain a long screen capturing image.
The method of obtaining a long screen shot image according to an example embodiment of the present disclosure may be applicable to both schemes of manually scrolling screen content (e.g., scrolling screen content up a distance by manually clicking a button) and automatically scrolling screen content (e.g., automatically scrolling a screen by a cell phone, scrolling screen content a specific distance at a time). The principle of the two schemes is the same, whether the scrolling is performed by clicking by a user or the mobile phone automatically scrolls, the screen capturing image of the screen is obtained, and then the screen capturing image is cut (or not cut) to obtain a long screenshot. The method for obtaining the long screen shot image can be applied to all schemes for combining the long screen shots through multiple screen shots. Regardless of the manner in which the individual screen shots are taken, there must be a cut line, and as long as there is a moving image, this moving image may appear on the cut line. To avoid the moving image being cut into two parts, the moving image must be identified and then properly scrolled to include the complete moving image in the screenshot image, so that the integrity of the moving image is maintained during stitching. Thus, the method of obtaining a long screen shot image according to an example embodiment of the present disclosure is applicable to both of the above-described schemes.
Fig. 12 is a flowchart illustrating an application scenario to which a method of obtaining a long screen shot image according to an example embodiment of the present disclosure is applied.
For example only, the current screen may include a top preset area and a bottom preset area, and the user may initiate a long screenshot function of automatically scrolling screen content at step S1210.
In step S1220, a screen shot image of the page (e.g., which may be referred to as a first screen shot image or an upper screen shot image) may be acquired.
In step S1230, the region information of the dynamic region and the bottom position information of the screen shot image may be obtained, and whether a part of the dynamic region exists at the bottom of the screen shot image and the height of the part of the dynamic region are determined based on the region information of the dynamic region and the bottom position information of the screen shot image.
In the case where a part of the dynamic region exists at the bottom of the screen shot image, in step S1240, it may be determined whether to end the screen shot. When the screen capturing is not ended (no at step S1240), at step S1250, the scroll height G may be determined as the upper screen capturing image height H-the height H of the partial dynamic region-the top preset region height Ht-the bottom preset region height Hb, and the page is scrolled according to the determined scroll height, and then another screen capturing image (for example, may be referred to as a second screen capturing image or a lower screen capturing image) of the page is acquired (return to step S1220). When the screen capturing is ended (yes at step S1240), since the user activates the long screen capturing function of automatically scrolling the screen content, it may occur that the actual scroll height is different from the determined scroll height when the last screen capturing image is acquired, and the actual scroll height of the last page may be compared with the determined scroll height at step S1260. In step S1270-1, when the actual scroll height is equal to the determined scroll height, the partial dynamic region and the bottom preset region may be removed from the upper screen shot image (i.e., the bottom region whose height is a value obtained by subtracting the determined scroll height from the screen height and then subtracting the top preset region height is removed from the upper screen shot image), the top preset region is removed from the lower screen shot image, the removed upper screen shot image and the removed lower screen shot image are stitched, and the stitched screen shot image may be used as the upper screen shot image to be stitched next time. In step S1280, it may be determined whether the splice is complete. When the stitching is not completed (no at step S1280), the procedure returns to step S1260, and the stitching is continued in the order in which the screen capture images are captured. Further, at step 1260, when the stitching of the last lower screen shot image is performed, it may be determined whether to further remove the lower screen shot image based on a comparison of the last actual scroll height of the page with the determined scroll height. In step S1270-2, when the actual scroll height of the last time of the page is smaller than the determined scroll height, a region whose height immediately below the top preset region is the difference between the determined scroll height and the actual scroll height is removed from the lower screen shot image from which the top preset region is removed, and the removed upper screen shot image and the removed lower screen shot image are stitched. When the stitching is completed (yes at step S1280), a long screen capturing image can be obtained.
Fig. 13 is a block diagram of a screen capture device 1300 according to an exemplary embodiment of the present disclosure.
Referring to fig. 13, a screen capture apparatus 1300 according to an exemplary embodiment of the present disclosure may include a first screen capture image acquisition unit 1310, a scroll height determination unit 1320, a second screen capture image acquisition unit 1330, and a stitching unit 1340.
The first screenshot image acquiring unit 1310 may acquire a first screenshot image of a page; the scroll height determining unit 1320 may determine the scroll height based on the region information of the dynamic region in a case where a part of the dynamic region exists at the bottom of the first screen shot image; the second screen shot image acquiring unit 1330 may scroll the page and acquire a second screen shot image of the page based on the determined scroll height; and the stitching unit 1340 may obtain a long screen shot image by stitching the first screen shot image and the second screen shot image.
According to an exemplary embodiment of the present disclosure, the scroll height determining unit 1320 may determine the height of the partial dynamic region based on the region information of the dynamic region and the bottom position information of the first screen capture image, and determine the scroll height based on the difference between the screen height and the height of the partial dynamic region. The stitching unit 1340 may remove a bottom region having a height that is a difference between the screen height and the determined scroll height from the first screen shot image, and stitch the removed first screen shot image and second screen shot image to obtain a long screen shot image. And when the actual scroll height is smaller than the determined scroll height, the stitching unit 1340 may further remove a top region having a height that is a difference between the determined scroll height and the actual scroll height from the second screen shot image and stitch the removed first screen shot image and the removed second screen shot image to obtain a long screen shot image.
According to an exemplary embodiment of the present disclosure, the scroll height determining unit 1320 may determine a difference between the screen height H and the height H of the partial dynamic region as a scroll height (g=h-H). At this time, the stitching unit 1340 may remove a bottom region having a height that is a difference between the screen height and the determined scroll height from the first screen shot (i.e., remove a bottom dynamic region from the first screen shot), and stitch the removed first screen shot and second screen shot to obtain a long screen shot. And when the actual scroll height is smaller than the determined scroll height, the stitching unit 1340 may further remove a top region having a height that is a difference between the determined scroll height and the actual scroll height from the second screen shot image and stitch the removed first screen shot image and the removed second screen shot image to obtain a long screen shot image.
According to an exemplary embodiment of the present disclosure, the scroll height determining unit 1320 may determine a value obtained by subtracting a preset height hx from a difference between the screen height and the height of the partial dynamic region as the scroll height (g=h-H-hx). At this time, the stitching unit 1340 may use an area with a preset height at the top of the second screenshot image as a comparison area, search for an area of the first screenshot image that is the same as the comparison area from above the partial dynamic area of the first screenshot image, remove the searched area and the partial dynamic area from the first screenshot image, and stitch the removed first screenshot image and the removed second screenshot image to obtain a long screenshot image. Another way to obtain a long screen shot image is that the stitching unit 1340 may remove a bottom region having a height that is a difference between the screen height and the determined scroll height from the first screen shot image (i.e., remove a bottom dynamic region and a region having a height hx immediately above the bottom dynamic region from the first screen shot image) and stitch the removed first and second screen shot images to obtain a long screen shot image. And when the actual scroll height is smaller than the determined scroll height, the stitching unit 1340 may further remove a top region having a height that is a difference between the determined scroll height and the actual scroll height from the second screen shot image and stitch the removed first screen shot image and the removed second screen shot image to obtain a long screen shot image.
According to an exemplary embodiment of the present disclosure, in case that the first and second screen capturing images include at least one preset area, the scroll height determining unit 1320 may determine the scroll height based on a value obtained by subtracting the height of the at least one preset area from the height of the screen and subtracting the height of the part of the dynamic area. For example, the scroll height determining unit 1320 may determine a value obtained by subtracting the height of at least one preset area from the height of the screen and subtracting the height of the partial dynamic area as the scroll height, or may determine a value obtained by subtracting the preset height from the above-described difference as the scroll height.
According to an exemplary embodiment of the present disclosure, in case that the at least one preset area includes a top preset area, the stitching unit 1340 may remove a bottom area having a height that is a value obtained by subtracting the determined scroll height from the screen height and subtracting the top preset area height from the first screen shot image, remove the top preset area from the second screen shot image, and stitch the removed first screen shot image and the removed second screen shot image to obtain a long screen shot image. When the actual scrolling height is smaller than the determined scrolling height, the stitching unit 1340 may further remove an area having a height immediately below the top preset area from the removed second screenshot image as a difference between the determined scrolling height and the actual scrolling height, and stitch the removed first screenshot image and the removed second screenshot image to obtain a long screenshot image.
According to an exemplary embodiment of the present disclosure, in case that the at least one preset area includes a bottom preset area, the stitching unit 1340 may remove the bottom area having a height that is a difference between the screen height and the determined scroll height from the first screen capture image and stitch the removed first screen capture image and the second screen capture image to obtain a long screen capture image. And when the actual scroll height is smaller than the determined scroll height, the stitching unit 1340 may further remove a top region having a height that is a difference between the determined scroll height and the actual scroll height from the second screen shot image and stitch the removed first screen shot image and the removed second screen shot image to obtain a long screen shot image.
According to an exemplary embodiment of the present disclosure, in case that the at least one preset area includes a top preset area and a bottom preset area, the stitching unit 1340 may remove the bottom area having a height that is a value obtained by subtracting the determined scroll height from the screen height and subtracting the top preset area height from the first screen capture image; and removing the top preset area from the second screen shot image, and splicing the removed first screen shot image and the removed second screen shot image to obtain a long screen shot image. When the actual scrolling height is smaller than the determined scrolling height, the stitching unit 1340 may further remove an area having a height immediately below the top preset area from the removed second screenshot image as a difference between the determined scrolling height and the actual scrolling height, and stitch the removed first screenshot image and the removed second screenshot image to obtain a long screenshot image.
According to another exemplary embodiment of the present disclosure, in case that the first and second screen capturing images include at least one preset area, the stitching unit 1340 may remove at least one preset area of the first and second screen capturing images to obtain corresponding first and second images, respectively, remove a bottom area from the first image having a height that is a difference between the height of the first image and the determined scroll height, and stitch the removed first and second images to obtain a long screen capturing image. And when the actual scrolling height is smaller than the determined scrolling height, the stitching unit 1340 may further remove a top region having a height that is a difference between the determined scrolling height and the actual scrolling height from the second image, stitch the removed first image and the removed second image, and stitch at least one preset region corresponding to the stitched image at a corresponding position of the stitched image to obtain a long screenshot image.
According to an exemplary embodiment of the present disclosure, the screen capture apparatus 1300 may further include a dynamic region determining unit (not shown) that may determine whether a portion of the dynamic region exists at the bottom of the first screen capture image after the first screen capture image acquisition unit 1310 acquires the first screen capture image. The dynamic region determining unit may acquire region information of the dynamic region and user interface UI layout information of the first screen shot image, calculate bottom position information of the first screen shot image based on the UI layout information and screen resolution of the first screen shot image, determine whether a part of the dynamic region exists at the bottom of the first screen shot image based on the region information of the dynamic region and the bottom position information of the first screen shot image.
Fig. 14 is a block diagram of an electronic device 1400 according to an exemplary embodiment of the present disclosure.
The electronic device 1400 according to exemplary embodiments of the present disclosure may include a processor 1410 and a memory 1420 for storing processor-executable instructions. The processor-executable instructions, when executed by the processor, cause the processor to perform a screen capture method according to an exemplary embodiment of the present disclosure.
By way of example, the electronic device 1400 may be a PC computer, tablet device, personal digital assistant, smart phone, or other device capable of executing the above-described set of instructions. Here, the electronic device 1400 is not necessarily a single electronic device, but may be any apparatus or a collection of circuits capable of executing the above-described instructions (or instruction set) individually or in combination. The electronic device 1400 may also be part of an integrated control system or system manager, or may be configured as a portable electronic device that interfaces with either locally or remotely (e.g., via wireless transmission).
In electronic device 1400, processor 1410 may include a Central Processing Unit (CPU), a Graphics Processor (GPU), a programmable logic device, a special purpose processor system, a microcontroller, or a microprocessor. By way of example, and not limitation, processors may also include analog processors, digital processors, microprocessors, multi-core processors, processor arrays, network processors, and the like.
The processor 1410 may execute instructions or code stored in the memory 1420, wherein the memory 1420 may also store data. The instructions and data may also be transmitted and received over a network via a network interface device, which may employ any known transmission protocol.
Memory 1420 may be integrated with processor 1410, for example, RAM or flash memory disposed within an integrated circuit microprocessor or the like. In addition, memory 1420 may include a separate device, such as an external disk drive, a storage array, or other storage device usable by any database system. The memory 1420 and the processor 1410 may be operatively coupled or may communicate with each other, for example, through an I/O port, a network connection, etc., so that the processor 1410 can read files stored in the memory.
In addition, electronic device 1400 may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, mouse, touch input device, etc.). All components of the electronic device 1400 may be connected to each other via buses and/or networks.
According to example embodiments of the present disclosure, a computer-readable storage medium may be provided, in which a computer program is stored which, when executed, implements a method according to example embodiments of the present disclosure. Examples of the computer readable storage medium herein include: read-only memory (ROM), random-access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random-access memory (RAM), dynamic random-access memory (DRAM), static random-access memory (SRAM), flash memory, nonvolatile memory, CD-ROM, CD-R, CD + R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD + R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, blu-ray or optical disk storage, hard Disk Drives (HDD), solid State Disks (SSD), card memory (such as multimedia cards, secure Digital (SD) cards or ultra-fast digital (XD) cards), magnetic tape, floppy disks, magneto-optical data storage, hard disks, solid state disks, and any other means configured to store computer programs and any associated data, data files and data structures in a non-transitory manner and to provide the computer programs and any associated data, data files and data structures to a processor or computer to enable the processor or computer to execute the computer programs. The computer programs in the computer readable storage media described above can be run in an environment deployed in a computer device, such as a terminal, client, host, proxy device, server, etc., and further, in one example, the computer programs and any associated data, data files, and data structures are distributed across networked computer systems such that the computer programs and any associated data, data files, and data structures are stored, accessed, and executed in a distributed fashion by one or more processors or computers.
According to example embodiments of the present disclosure, by determining a scroll height based on region information of a dynamic region of an upper screen shot image, and based on the determined scroll height, scrolling a page and acquiring a lower screen shot image of the page, and stitching the upper screen shot image and the lower screen shot image, a long screen shot with an intact dynamic region may be synthesized.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the claims.

Claims (22)

1. A method of screen capturing, comprising:
Acquiring a first screen capturing image of a page;
determining a scrolling height based on region information of a dynamic region in the case where a part of the dynamic region exists at the bottom of the first screen shot image;
scrolling the page and acquiring a second screen capture image of the page based on the determined scroll height; and is also provided with
A long screen shot image is obtained by stitching the first screen shot image and the second screen shot image.
2. The method of screenshot according to claim 1, wherein the step of determining a scroll height comprises:
determining a height of the portion of the dynamic region based on the region information of the dynamic region and the bottom position information of the first screen capture image; and is also provided with
The scroll height is determined based on a difference between the screen height and the height of the portion of the dynamic region.
3. The method of capturing a screen of claim 2, wherein the step of obtaining a long screen capture image by stitching the first screen capture image and the second screen capture image comprises:
removing a bottom region from the first screen capture image having a height that is the difference between the screen height and the determined scroll height; and is also provided with
And splicing the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
4. A method of capturing a screen as recited in claim 3, wherein when the actual scroll height is less than the determined scroll height, stitching the removed first and second captured images to obtain the long captured image comprises:
removing a top region from the second screen capture image having a height that is the difference between the determined scroll height and the actual scroll height; and is also provided with
And splicing the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
5. The method of screenshot according to claim 2 wherein the step of determining a scroll height comprises: the difference between the screen height and the height of the portion of the dynamic region is determined as the scroll height.
6. The method of screenshot according to claim 2 wherein the step of determining a scroll height comprises:
a value obtained by subtracting a preset height from a difference between the screen height and the height of the portion of the dynamic region is determined as a scroll height.
7. The method of capturing images according to claim 6, wherein the step of obtaining a long screen capture image by stitching the first screen capture image and the second screen capture image comprises:
Taking a region with the height of the preset height at the top of the second screen capturing image as a comparison region;
looking up a region of the first screenshot image that is the same as the contrast region starting above the portion of dynamic region of the first screenshot image;
removing the found region and the portion of the dynamic region from the first screen shot image; and is also provided with
And splicing the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
8. The method of screenshot according to claim 7, wherein when the actual scroll height is less than the determined scroll height, stitching the removed first screenshot image and the second screenshot image to obtain the long screenshot image comprises:
removing a top region from the second screen capture image having a height that is the difference between the determined scroll height and the actual scroll height; and is also provided with
And splicing the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
9. The method of screenshot according to claim 2, wherein, in case the first screenshot image and the second screenshot image comprise at least one preset area, the step of determining a scroll height based on a difference between a screen height and a height of the portion of the dynamic area comprises:
The scroll height is determined based on a value obtained by subtracting the height of the at least one preset area from the screen height and subtracting the height of the part of the dynamic area.
10. The method of screenshot according to claim 9, wherein, in case the at least one preset area comprises a top preset area, the step of obtaining a long screenshot image by stitching the first screenshot image and the second screenshot image comprises:
removing a bottom region having a height from the first screen capture image that is a value obtained by subtracting the determined scroll height from the screen height and subtracting the top preset region height;
removing a top preset region from the second screen shot image; and is also provided with
And splicing the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
11. The method of screenshot according to claim 10, wherein when the actual scroll height is less than the determined scroll height, stitching the removed first screenshot image and the removed second screenshot image, obtaining the long screenshot image comprises:
removing from the removed second screen shot image an area having a height immediately below the top preset area that is the difference between the determined scroll height and the actual scroll height; and is also provided with
And splicing the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
12. The method of screenshot according to claim 9, wherein, in case the at least one preset area comprises a bottom preset area, the step of obtaining a long screenshot image by stitching the first screenshot image and the second screenshot image comprises:
removing a bottom region from the first screen capture image having a height that is the difference between the screen height and the determined scroll height; and is also provided with
And splicing the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
13. The method of screenshot according to claim 12, wherein when the actual scroll height is less than the determined scroll height, the step of stitching the removed first screenshot image and the second screenshot image to obtain the long screenshot image comprises:
removing a top region from the second screen capture image having a height that is the difference between the determined scroll height and the actual scroll height; and is also provided with
And splicing the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
14. The method of screenshot according to claim 9, wherein, in case the at least one preset area comprises a top preset area and a bottom preset area, the step of obtaining a long screenshot image by stitching the first screenshot image and the second screenshot image comprises:
removing a bottom region having a height from the first screen capture image that is a value obtained by subtracting the determined scroll height from the screen height and subtracting the top preset region height;
removing a top preset region from the second screen shot image; and is also provided with
And splicing the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
15. The method of screenshot according to claim 14, wherein when the actual scroll height is less than the determined scroll height, stitching the removed first screenshot image and the removed second screenshot image, obtaining the long screenshot image comprises:
removing from the removed second screen shot image an area having a height immediately below the top preset area that is the difference between the determined scroll height and the actual scroll height; and is also provided with
And splicing the removed first screen capturing image and the removed second screen capturing image to obtain the long screen capturing image.
16. The method of capturing images of claim 9, wherein the step of obtaining a long screenshot image by stitching the first screenshot image and the second screenshot image comprises:
removing the at least one preset area of the first screen capturing image and the second screen capturing image to obtain a corresponding first image and second image respectively;
removing a bottom region from the first image having a height that is the difference between the height of the first image and the determined scroll height; and is also provided with
And splicing the removed first image and the removed second image to obtain the long screen capturing image.
17. The method of screenshot according to claim 16, wherein when the actual scroll height is less than the determined scroll height, the step of stitching the removed first image and the second image to obtain the long screenshot image comprises:
removing a top region from the second image having a height that is the difference between the determined scroll height and the actual scroll height;
splicing the removed first image and the removed second image;
and splicing the corresponding at least one preset area at the corresponding position of the spliced image to obtain a long screen capturing image.
18. The screen capture method of claim 1, further comprising, after acquiring the first screen capture image: a determination is made as to whether a portion of a dynamic region exists at the bottom of the first screen shot image.
19. The method of screenshot according to claim 18, wherein the step of determining whether a portion of a dynamic region exists at the bottom of the first screenshot image comprises:
acquiring area information of the dynamic area and user interface UI layout information of the first screen capturing image;
calculating bottom position information of the first screen capturing image based on the UI layout information and the screen resolution of the first screen capturing image; and is also provided with
Based on the region information of the dynamic region and the bottom position information of the first screen shot image, whether a part of the dynamic region exists at the bottom of the first screen shot image is determined.
20. A screen capturing apparatus, comprising:
a first screen capturing image acquisition unit configured to acquire a first screen capturing image of a page;
a scroll height determining unit configured to determine a scroll height based on area information of a dynamic area in a case where a part of the dynamic area exists at a bottom of the first screen shot image;
A second screen capture image acquisition unit configured to scroll the page and acquire a second screen capture image of the page based on the determined scroll height; and is also provided with
And a stitching unit configured to obtain a long screen capture image by stitching the first screen capture image and the second screen capture image.
21. An electronic device, the electronic device comprising:
a processor;
a memory for storing the processor-executable instructions,
wherein the processor executable instructions, when executed by the processor, cause the processor to perform the screen capture method according to any one of claims 1 to 19.
22. A computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, cause the processor to implement the screen capture method of any of claims 1-19.
CN202210767720.5A 2022-06-30 2022-06-30 Screen capturing method, screen capturing device, electronic apparatus, and computer-readable storage medium Pending CN117389448A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210767720.5A CN117389448A (en) 2022-06-30 2022-06-30 Screen capturing method, screen capturing device, electronic apparatus, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210767720.5A CN117389448A (en) 2022-06-30 2022-06-30 Screen capturing method, screen capturing device, electronic apparatus, and computer-readable storage medium

Publications (1)

Publication Number Publication Date
CN117389448A true CN117389448A (en) 2024-01-12

Family

ID=89468949

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210767720.5A Pending CN117389448A (en) 2022-06-30 2022-06-30 Screen capturing method, screen capturing device, electronic apparatus, and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN117389448A (en)

Similar Documents

Publication Publication Date Title
US20210168234A1 (en) Page control method and apparatus, and computer-readable storage medium
WO2016101757A1 (en) Image processing method and device based on mobile device
US10353721B2 (en) Systems and methods for guided live help
US10152539B2 (en) Webpage searching method and browser
CN112445579B (en) Zero terminal data processing system and file copying method and device thereof
US10402470B2 (en) Effecting multi-step operations in an application in response to direct manipulation of a selected object
US10191838B2 (en) Method and device for checking influence of deleting cache file, and mobile terminal
US11262883B2 (en) Associating browser with application
US20190332524A1 (en) Unit testing for changes to version control
US20180107686A1 (en) Search method and apparatus
JP2018528634A (en) Method and device for previewing moving image and method and device for displaying expression package
CN112579187A (en) Optimization method and device for cold start of application program
WO2017008646A1 (en) Method of selecting a plurality targets on touch control terminal and equipment utilizing same
US9971789B2 (en) Selective disk volume cloning for virtual disk creation
CN113518187B (en) Video editing method and device
CN109240678B (en) Code generation method and device
CN107621951B (en) View level optimization method and device
CN113419655A (en) Application screen capturing method and device for electronic terminal
CN110941516B (en) Operating system restoration method, device, equipment and storage medium
CN117389448A (en) Screen capturing method, screen capturing device, electronic apparatus, and computer-readable storage medium
US9223766B2 (en) Preserving formatting of content selection through snippets
CN114115623B (en) Information display method and device and information transmission method and device
CN107749892B (en) Network reading method and device for conference record, intelligent tablet and storage medium
CN113888674A (en) Image processing method and device
CN112579952A (en) Page display method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination