CN115237312A - Screen capturing method, electronic device and storage medium - Google Patents

Screen capturing method, electronic device and storage medium Download PDF

Info

Publication number
CN115237312A
CN115237312A CN202110714224.9A CN202110714224A CN115237312A CN 115237312 A CN115237312 A CN 115237312A CN 202110714224 A CN202110714224 A CN 202110714224A CN 115237312 A CN115237312 A CN 115237312A
Authority
CN
China
Prior art keywords
image
spliced
area
screen
screen capture
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
CN202110714224.9A
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.)
Cloudminds Beijing Technologies Co Ltd
Original Assignee
Cloudminds Beijing Technologies 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 Cloudminds Beijing Technologies Co Ltd filed Critical Cloudminds Beijing Technologies Co Ltd
Priority to CN202110714224.9A priority Critical patent/CN115237312A/en
Publication of CN115237312A publication Critical patent/CN115237312A/en
Pending legal-status Critical Current

Links

Images

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/04847Interaction techniques to control parameter settings, e.g. interaction with sliders or dials
    • 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/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures

Abstract

The embodiment of the invention relates to the field of data processing, and discloses a screen capturing method, electronic equipment and a storage medium. In some embodiments of the present application, a screen capture method includes: continuously intercepting a plurality of images after detecting a trigger signal of screen capturing operation; judging whether a change area exists in the ith image relative to the (i-1) th image; wherein the initial value of i is 2; if the change area exists, obtaining an image to be spliced according to the image of the change area; let i = i +1; judging whether the i is not more than N, wherein N is the number of the intercepted images; if the determination is true, returning to execute the step of judging whether the ith image has a change area relative to the (i-1) th image; and after determining that the i is not larger than or equal to the N, or after obtaining the image to be spliced according to the image of the change area, splicing the image to be spliced according to the image to be spliced to obtain the screenshot image. The technical scheme provided by the embodiment of the application enables the operation of obtaining the screen shot image with long content by the user to be simpler.

Description

Screen capturing method, electronic device and storage medium
Technical Field
The embodiment of the invention relates to the field of data processing, in particular to a screen capturing method, electronic equipment and a storage medium.
Background
It is a common function to capture a screen of a mobile phone or a computer using a screen capture function. The user can typically trigger a screenshot by clicking on a certain button or physical key. The current screenshot modes include two, namely, the currently selected content is intercepted and the long screenshot is intercepted. The long screen shot can capture content which is not displayed in the current page.
However, if the user wants to share a segment of text or image content, it is often necessary to perform a complicated operation to obtain the sharing of the segment of text or image content by means of screenshot.
Disclosure of Invention
An object of embodiments of the present invention is to provide a screen capture method, an electronic device, and a storage medium, which enable a user to obtain a long-content screen capture image with a simpler operation.
In order to solve the foregoing technical problem, in a first aspect, an embodiment of the present invention provides a screen capture method, including: continuously capturing a plurality of images after detecting a trigger signal of screen capturing operation; judging whether a change area exists in the ith image relative to the (i-1) th image; wherein the initial value of i is 2; if the change area exists, obtaining an image to be spliced according to the image of the change area; let i = i +1; judging whether the number of the images is larger than or equal to N, wherein N is the number of the intercepted images; if the determination is true, returning to execute the step of judging whether the ith image has a change area relative to the (i-1) th image; and after determining that the i is not larger than or equal to the N, or after obtaining the image to be spliced according to the image of the change area, splicing according to the image to be spliced to obtain the screenshot image.
In a second aspect, an embodiment of the present invention provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the screen capture method as mentioned in the above embodiments.
In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the screen capturing method mentioned in the foregoing embodiment.
Compared with the prior art, the method and the device have the advantages that after the screen capture operation is triggered, the multiple images are continuously captured, and the final screen capture image is obtained through splicing according to the images of the change areas of the multiple images. Because the screenshot image is obtained based on the plurality of captured images, the screenshot image can embody the contents of the plurality of captured images, so that the screenshot image can be used as a screenshot image of long contents contained in the plurality of captured images, and a user can share the screenshot image of the long contents. The user only needs to trigger the screen capture operation and does not need to perform other operations, so that the operation of obtaining the screen capture image with long content is simpler.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the figures in which like reference numerals refer to similar elements and which are not to scale unless otherwise specified.
FIG. 1 is a flow chart of a screen capture method in an embodiment of the present application;
FIG. 2 is a flow diagram of a screen capture method in another embodiment of the present application;
FIG. 3 is a flow diagram of a screen capture method in yet another embodiment of the present application;
FIG. 4 is a flow chart of a screen capture method in yet another embodiment of the present application;
FIG. 5a is a schematic view of the i-1 st image in the present embodiment;
FIG. 5b is a schematic diagram of the ith image in the present embodiment;
5 c-5 e are schematic diagrams of screenshot images of the present embodiment;
fig. 6 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present application in various embodiments of the present invention. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments. The following embodiments are divided for convenience of description, and should not constitute any limitation to the specific implementation manner of the present invention, and the embodiments may be mutually incorporated and referred to without contradiction.
In the description of the present disclosure, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In addition, in the description of the present disclosure, "a plurality" means two or more unless otherwise specified.
In an embodiment of the present application, the screen capturing method shown in fig. 1 is executed by an electronic device, where the electronic device may be a terminal (a mobile phone or a computer), a server, a cloud server, or the like. The screen capture method comprises the following steps.
Step 101: and continuously intercepting a plurality of images after detecting a trigger signal of screen capturing operation.
Step 102: and judging whether the ith image has a change area relative to the (i-1) th image. Where i has an initial value of 2.
Specifically, if it is determined that there is a change area, step 103 is performed, otherwise, step 104 is performed.
Step 103: and obtaining the images to be spliced according to the images of the change areas.
Step 104: let i = i +1.
Step 105: and judging whether the i is less than or equal to N. N is the number of the intercepted images;
specifically, if the determination is positive, the process returns to step 102, and if the determination is not positive, step 106 is performed.
Step 106: and splicing to obtain a screen shot image according to the image to be spliced.
In another embodiment, the screen capturing method shown in fig. 2 is performed by an electronic device, which may be a terminal (mobile phone or computer), a server or a cloud server. The screen capture method comprises the following steps.
Step 201: and continuously intercepting a plurality of images after detecting a trigger signal of screen capturing operation.
Step 202: and judging whether the ith image has a change area relative to the (i-1) th image. Where i has an initial value of 2.
Specifically, if it is determined that the changed region exists, step 203 is performed, otherwise, step 205 is performed.
Step 203: and obtaining the images to be spliced according to the images of the change areas.
Step 204: and splicing to obtain a screen shot image according to the image to be spliced.
Step 205: let i = i +1.
Step 206: and judging whether the i is less than or equal to N. N is the number of the intercepted images;
specifically, if the determination is true, the process returns to step 202, and if the determination is false, the process ends.
In the embodiment of the application, after the screen capture operation is triggered, the multiple images are continuously captured, and the final screen capture image is obtained by splicing according to the images in the change areas of the multiple images. Because the screen shot image is obtained based on the plurality of captured images, the screen shot image can embody the contents of the plurality of captured images, so that the screen shot image can be used as a screen shot image of long contents contained in the plurality of captured images, and a user can share the screen shot image of the long contents. The user only needs to trigger the screen capture operation and does not need to perform other operations, so that the operation of obtaining the screen capture image with long content is simpler.
It should be noted that, for clarity of explanation, in fig. 1, the step 104 is described as an example when the electronic device determines that there is no change area in the ith image, and in practical applications, after determining that there is no change area in the ith image, the electronic device may selectively perform other steps, for example, delete the (i-2) th image, which is not limited in this embodiment.
In one embodiment, the manner of triggering the screen capture operation supported by the electronic device includes, but is not limited to, the following:
mode 1: and triggering by a physical key. Under the condition that screen recording is not performed, a user triggers a trigger signal of screen capturing operation by pressing a physical key of the electronic equipment, such as a long-time volume key, and simultaneously pressing a volume key, an on-off key and the like.
Mode 2: and triggering the virtual control. Under the condition that screen recording is not carried out, a user triggers a trigger signal of screen capturing operation by touching or clicking a screen capturing control displayed on a display screen of the electronic equipment.
Mode 3: specifying a screen signal trigger. The user triggers the trigger signal of the screen capturing operation by completing the specified operation on the display screen, such as drawing the specified pattern, continuously clicking the display screen, long-pressing the display screen and the like.
In one embodiment, an adjustable screen capture frame is displayed after a trigger signal triggering a screen capture operation, such that a user selects a screen capture area by adjusting the screen capture frame.
In one embodiment, after detecting the trigger signal of the screen capture operation, continuously capturing a plurality of images comprises: starting screen recording after a trigger signal of screen capturing operation is detected; after detecting a recording ending signal, ending screen recording; and extracting a plurality of video frames from the recorded video as a plurality of images according to a video frame extraction rule. Specifically, after a user starts a screen capture operation, the electronic device performs screen recording, and acquires a plurality of images for generating a screen capture image from a recorded video.
Optionally, the video frame extraction rule may be to extract video frames according to a certain frequency, may also continuously extract a number of video frames specified by a user, and may also extract video frames according to other rules, which is not limited in this embodiment.
Alternatively, the manner in which the electronic device triggers the recording ending signal includes, but is not limited to, the following:
mode 1: and ending the recording through a physical key. Specifically, in the case of not performing screen recording, the user triggers a trigger signal of the screen capturing operation by pressing a physical key of the electronic device, such as pressing a volume key for a long time, and simultaneously pressing a volume key, an on-off key, and the like. Under the condition of screen recording, a user presses a physical key of the electronic equipment, such as a volume key, and simultaneously presses a volume key, an on-off key and the like, so as to trigger the recording ending signal.
Mode 2: and triggering the virtual control. And triggering a recording ending signal by touching or clicking a recording ending control displayed on a display screen of the electronic equipment by a user.
Mode 3: and (5) indicating that the screen signal is interrupted, and ending screen recording. For example, in the case where the user presses the display screen for a long time, the electronic apparatus may detect a specified screen signal and start screen recording. And after the user leaves the display screen, the appointed screen signal is interrupted, and the screen recording is finished.
Mode 4: and configuring the screen capture time length, and stopping screen recording after the screen capture time length is reached.
Mode 5: and configuring the screen capture number, and stopping screen recording after the number of the video frames in the recorded video reaches the screen capture number.
In one embodiment, before determining whether the ith image has a changed area relative to the (i-1) th image, the screen capture method further comprises: comparing each area to be compared divided from the ith image with the corresponding area of the (i-1) th image respectively to determine the color variation of each area to be compared; comparing the color variation of each region to be compared with a threshold value respectively to obtain a comparison result; and if the comparison result indicates that the area to be compared with the color variation larger than the threshold exists, taking the area to be compared with the color variation larger than the threshold as a variation area. Specifically, the electronic device compares the colors of the regions to be compared, which are divided from the ith image, with the colors of the regions of the corresponding (i-1) th image, and if the regions to be compared have large color changes, the electronic device indicates that the images of the regions to be compared have changed relative to the images of the regions corresponding to the (i-1) th image, and therefore the regions to be compared are taken as changed regions.
It is worth mentioning that the content change displayed by the two adjacent images is determined by comparing the color change amount of the two adjacent images.
Alternatively, the color variation of each to-be-compared region may be the sum of absolute values of the color variations of each pixel in the to-be-compared region, or the average value of the absolute values of the color variations of each pixel in the to-be-compared region, and may also be calculated in other manners, which is not limited in this embodiment. Wherein the color change amount of the pixel (x, y) of the ith image = RGB value of the pixel (x, y) of the ith image-RGB value of the pixel (x, y) of the ith-1 image, or the color change amount of the pixel (x, y) of the ith image = RGB value of the pixel (x, y) of the ith-1 image-RGB value of the pixel (x, y) of the ith image.
In one embodiment, before comparing the color variation of each region of the ith image with a threshold respectively to obtain a comparison result, the screen capture method further includes: acquiring the change parameters of the ith image according to the color number of the ith image and/or the color number of the (i-1) th image; and acquiring a threshold corresponding to the ith image according to the change parameters and the constraint relation between the change parameters and the threshold.
Alternatively, the electronic device may use the number of colors of the ith image as a parameter threshold, may use the number of colors of the (i-1) th image as a parameter threshold, and may use an average value of the number of colors of the ith image and the number of colors of the (i-1) th image as a parameter threshold. The present embodiment is not limited.
It is worth mentioning that the threshold is determined based on the number of colors of the image, so that the threshold can be adjusted according to the image content, so that the threshold is more suitable for the current image, and the finally locked change area is more accurate.
It should be noted that, as will be understood by those skilled in the art, the threshold may also be a fixed value, that is, the same threshold is used for all images, and the fixed value may be set empirically, and the specific setting manner of the threshold is not limited in the present embodiment.
In one embodiment, the constraint relationship indicates that the variation parameter is in an inverse relationship with the threshold.
Specifically, the constraint relationship may be set as needed. For example, the constraint relationship is an inverse proportional relationship, and for example, when the variation parameter is in a first range of values, the threshold is a first threshold, when the variation parameter is in a second range of values, the threshold is a second threshold … …, and so on. Wherein the maximum value of the first range of values is less than the minimum value of the second range of values, the first threshold value is greater than the second threshold value … …, and so on. The number of the numerical ranges and the number of the threshold values may be set as required, and are not limited herein.
It should be noted that, for an image with a small number of colors, a smaller threshold is set, so that whether there is a large change in the region to be compared can be determined more accurately.
In one embodiment, before comparing each region to be compared divided from the ith image with the corresponding region of the (i-1) th image, and determining the color variation of each region to be compared, the screen capture method further comprises: determining the dividing range of the ith image according to the first indication information; dividing the range into the whole area of the ith image or the partial area of the ith image; and according to the dividing rule, dividing the area to be compared from the dividing range of the ith image. Specifically, the electronic device may perform color comparison on the entire region of the image, or may perform color comparison on a part of the region of the image (such as a text region or a pure graphic region), and define the region to be compared as a division range of the image. For the division range, it may be divided according to a division rule.
It is worth mentioning that the user can select the content shared by the screen capturing according to the needs, so that the screen capturing mode can meet more requirements of the user.
It should be noted that, as will be understood by those skilled in the art, the first indication information may be input by the user before or after the screen capture, for example, the user selects or inputs the division range through the display screen of the electronic device, and the electronic device generates the first indication information according to the operation of the user. The first indication information may also be preset, and this embodiment is not limited.
For example, the electronic device continuously captures images of part or all of the area of the display screen to obtain a plurality of images. If the user is more concerned or more hopes to show the change of the characters, first indication information is input and indicates that the division range is the character area of the image. If the user is more concerned or more hopes to show the change of the image, the first indication information is input and indicates that the division range is the image area of the image.
The partial area may be a text area or an image area of the ith image. The text area or the image area may be determined by recognition, or may be defined in advance by the user, which is not limited in this embodiment.
It should be noted that the partial region may also be a middle region, an upper partial region, a lower partial region, a left partial region, or a right partial region of the ith image, and this embodiment is not limited.
Optionally, before the area to be compared is divided from the dividing range of the ith image according to the dividing rule, the screen capture method further includes: and determining a division rule corresponding to the division range according to the division range. Specifically, different division rules may be set for different division ranges, for example, if the division range is a text region of an image, the division rule may be to use the entire division range as a region to be compared; if the division range is an image area of the image, the division rule can be that the division range is averagely divided into a specified number of areas to be compared; if the dividing range is the whole area of the image, the dividing rule may equally divide the dividing range into a specified number of areas to be compared, or may divide the dividing range into a first area to be compared and a second area to be compared, where the first area to be compared is the image area and the second area to be compared is the text area. The present embodiment does not limit the specific division rule.
It should be noted that, as can be understood by those skilled in the art, the same division rule may also be used for different division ranges, and the embodiment is not limited.
The following illustrates a manner of obtaining an image to be stitched according to an image of a change region.
In the first example, the image of the changed region is taken as the image to be stitched.
In the second example, the line where the uppermost pixel of the uppermost changing region is located is taken as the cut line, and the image located below the cut line is taken as the image to be stitched.
In a third example, the line where the lowermost pixel of the lowermost variation region is located is taken as a capturing line, and the image located above the capturing line is captured as the image to be stitched.
In the fourth example, the column of the leftmost pixel of the leftmost variation region is taken as the cut-off line, and the image located on the right side of the cut-off line is taken as the image to be stitched.
In the fifth example, the column of the rightmost pixel of the rightmost variation region is taken as the intercept line, and the image located on the left side of the intercept line is taken as the image to be stitched.
It should be noted that the embodiment enables the content of the image to be stitched to be continuous, and avoids the situation that the content of each region in the image to be stitched is discontinuous.
In one embodiment, after it is determined that i is not greater than N, a step of obtaining a screenshot image by splicing according to the images to be spliced is performed. That is, in the screen capture method shown in fig. 1, the screen capture image is obtained by splicing according to the images to be spliced, and the method includes: sequentially splicing the images to be spliced in a first direction of the 1 st image according to a time sequence to obtain a screen shot image; displaying the screen shot image; judging whether a direction replacing instruction is received or not; if so, splicing the images to be spliced in the direction indicated by the replacement direction instruction of the 1 st image in sequence according to the time sequence; updating the screen capture image according to the spliced image; and returning to the step of displaying the screen shot image.
Specifically, the first orientation may be a preset orientation, such as a left side, a right side, an upper side or a lower side, or may be an orientation designated by a user through the display screen before the splicing is performed. And the electronic equipment splices the images to be spliced in the first direction of the 1 st image to obtain a spliced image. If the user is not satisfied with the spliced screenshot image, the splicing direction of the image to be spliced can be changed by triggering the direction replacing instruction until the direction replacing instruction is not triggered any more.
It is worth mentioning that the user can adjust the splicing orientation by himself, so that the final screen capture image can better meet the requirements of the customer.
In one embodiment, after the images to be spliced are obtained according to the images of the change areas, the step of splicing the images to be spliced to obtain the screen shot images is executed. That is, in the screen capture method shown in fig. 2, the screen capture image is obtained by stitching according to the image to be stitched, and the method includes: and splicing the image to be spliced in the first direction of the last screen capture image to obtain the screen capture image. The previous screen capture image is a screen capture image obtained from the 1 st image to the (i-1) th image; after determining that i is not more than N, the method further comprises the following steps: displaying the screen shot image; judging whether a direction replacing instruction is received or not; if so, splicing the images to be spliced in the direction indicated by the replacement direction instruction of the 1 st image in sequence according to the time sequence; updating the screen shot image according to the spliced image; and returning to the step of displaying the screen shot image. Wherein, if i =2, the previous screenshot image may be the 1 st image.
The above embodiments can be mutually combined and cited, for example, the following embodiments are examples after being combined, but not limited thereto; the embodiments can be arbitrarily combined into a new embodiment without contradiction.
In one embodiment, a screen capture method performed by an electronic device is shown in fig. 3, and includes the following steps.
Step 301: and continuously intercepting a plurality of images after detecting a trigger signal of screen capturing operation.
Step 302: and comparing each region to be compared divided from the ith image with the corresponding region of the (i-1) th image respectively, and determining the color variation of each region to be compared. The initial value of i is 2.
Step 303: and comparing the color variation of each area to be compared with a threshold value respectively to obtain a comparison result.
Step 304: and if the comparison result indicates that the area to be compared with the color variation larger than the threshold exists, taking the area to be compared with the color variation larger than the threshold as a variation area.
Step 305: and judging whether the ith image has a change area relative to the (i-1) th image. Where i has an initial value of 2.
Specifically, if it is determined that there is a change area, step 306 is executed, otherwise, step 307 is executed.
Step 306: and obtaining the images to be spliced according to the images of the change areas.
Optionally, obtaining an image to be stitched according to the image of the change region, including: taking the line of the uppermost pixel of the uppermost changing area as an intercepting line, and intercepting an image positioned on the lower side of the intercepting line as an image to be spliced; or, taking the line of the lowest pixel of the lowest variation region as an intercepting line, and intercepting the image positioned on the upper side of the intercepting line as an image to be spliced; or, taking the column of the leftmost pixel of the leftmost changing area as an intercepting line, and intercepting the image on the right side of the intercepting line as the image to be spliced; or, taking the column of the rightmost pixel of the rightmost variation region as an intercepting line, and intercepting the image positioned on the left side of the intercepting line as the image to be spliced.
Step 307: let i = i +1.
Step 308: and judging whether the i is less than or equal to N. N is the number of the intercepted images;
specifically, if the determination is positive, the process returns to step 302, and if the determination is not positive, the process proceeds to step 309.
Step 309: and sequentially splicing the images to be spliced in the first direction of the 1 st image according to the time sequence to obtain the screen shot image.
Step 310: and displaying the screen shot image.
Step 311: and judging whether a replacing direction instruction is received.
If yes, go to step 312, otherwise, end the process.
Step 312: sequentially splicing the images to be spliced at the position indicated by the replacement position instruction of the 1 st image according to the time sequence; and updating the screen capture image according to the spliced image. Step 310 is then performed.
Optionally, before comparing the color variation of each region to be compared with the threshold respectively to obtain the comparison result, the screen capture method further includes: acquiring the change parameters of the ith image according to the color number of the ith image and/or the color number of the (i-1) th image; and acquiring a threshold corresponding to the ith image according to the change parameters and the constraint relation between the change parameters and the threshold.
Alternatively, the constraint relationship indicates that the variation parameter is in inverse relationship to the threshold.
Optionally, before comparing each region to be compared partitioned from the ith image with the corresponding region of the (i-1) th image, and determining the color variation of each region to be compared, the screen capture method further includes: determining the dividing range of the ith image according to the first indication information; dividing the range into the whole area of the ith image or the partial area of the ith image; and according to the dividing rule, dividing the area to be compared from the dividing range of the ith image.
Optionally, before the area to be compared is divided from the dividing range of the ith image according to the dividing rule, the screen capture method further includes: and determining a division rule corresponding to the division range according to the division range.
In one embodiment, a screen capture method performed by an electronic device is shown in fig. 4, and includes the following steps.
Step 401: and continuously intercepting a plurality of images after detecting a trigger signal of screen capturing operation.
Step 402: and comparing each region to be compared divided from the ith image with the corresponding region of the (i-1) th image respectively, and determining the color variation of each region to be compared. The initial value of i is 2.
Step 403: and comparing the color variation of each region to be compared with a threshold value respectively to obtain a comparison result.
Step 404: and if the comparison result indicates that the area to be compared with the color variation larger than the threshold exists, taking the area to be compared with the color variation larger than the threshold as a variation area.
Step 405: and judging whether the ith image has a change area relative to the (i-1) th image. Where i has an initial value of 2.
Specifically, if it is determined that there is a changed area, step 406 is performed, otherwise, step 408 is performed.
Step 406: and obtaining the images to be spliced according to the images of the change areas.
Optionally, obtaining an image to be stitched according to the image of the change region, including: taking the line of the uppermost pixel of the uppermost changing area as an intercepting line, and intercepting an image positioned on the lower side of the intercepting line as an image to be spliced; or, taking the line of the lowest pixel of the lowest variation region as an intercepting line, and intercepting the image positioned on the upper side of the intercepting line as an image to be spliced; or, taking the column of the leftmost pixel of the leftmost changing area as an intercepting line, and intercepting the image on the right side of the intercepting line as the image to be spliced; or, taking the column of the rightmost pixels of the rightmost variation region as an intercepting line, and intercepting the image on the left side of the intercepting line as the image to be spliced.
Step 407: and splicing the image to be spliced in the first direction of the last screen capture image to obtain the screen capture image. Wherein, if i =2, the previous screenshot image may be the 1 st image.
Step 408: let i = i +1.
Step 409: and judging whether the i is less than or equal to N. And N is the number of the intercepted images.
Specifically, if the determination is positive, the process returns to step 402, and if the determination is not positive, the process goes to step 410.
Step 410: and displaying the screen shot image.
Step 311: and judging whether a direction replacing instruction is received or not.
If yes, go to step 312, otherwise, end the process.
Step 312: sequentially splicing the images to be spliced at the position indicated by the replacement position instruction of the 1 st image according to the time sequence; and updating the screen capture image according to the spliced image. Step 310 is then performed.
Optionally, before comparing the color variation of each region to be compared with the threshold respectively to obtain the comparison result, the screen capture method further includes: acquiring the change parameters of the ith image according to the color number of the ith image and/or the color number of the (i-1) th image; and acquiring a threshold corresponding to the ith image according to the change parameters and the constraint relation between the change parameters and the threshold.
Alternatively, the constraint relationship indicates that the variation parameter is in inverse relationship to the threshold.
Optionally, before comparing each region to be compared, which is divided from the ith image, with the corresponding region of the (i-1) th image, and determining the color variation of each region to be compared, the screen capture method further includes: determining the dividing range of the ith image according to the first indication information; dividing the range into the whole area of the ith image or the partial area of the ith image; and according to the dividing rule, dividing the area to be compared from the dividing range of the ith image.
Optionally, before the area to be compared is divided from the dividing range of the ith image according to the dividing rule, the screen capture method further includes: and determining a division rule corresponding to the division range according to the division range.
The following is exemplified in connection with an actual scenario.
For example, the i-1 th image captured by the electronic device is shown in fig. 5a, the i-th image is shown in fig. 5B, the image is divided into the whole area of the image, and the division rule is to divide the image into an image area a and a text area B. For convenience of explanation, it is assumed that the entire image of the i-1 st image is retained in the screenshot image. And if the color variation of the image area A1 of the i-1 th image and the color variation of the image area A2 of the i-1 th image are smaller than the threshold value, and the color variation of the character area B1 of the i-1 th image and the color variation of the character area B2 of the i-1 th image are smaller than the threshold value, determining that no variation area exists in the i-th image, and not splicing the content of the i-th image to the screen capture image. If the color variation of the image area A1 of the i-1 th image and the color variation of the image area A2 of the i-1 th image are larger than the threshold value, and the color variation of the text area B1 of the i-1 th image and the color variation of the text area B2 of the i-1 th image are smaller than the threshold value, determining that the i-1 th image has a variation area, and optionally splicing the image area A2 to the lower part of the i-1 th image, wherein the screenshot image is shown in FIG. 5 c; alternatively, both the image area A2 and the text area B2 can be stitched under the (i-1) th image, and the screen shot image is shown in FIG. 5 d. If the color variation of the image area A1 of the i-1 th image and the color variation of the image area A2 of the i-1 th image are smaller than the threshold value, and the color variation of the text area B1 of the i-1 th image and the color variation of the text area B2 of the i-1 th image are larger than the threshold value, determining that the i-1 th image has a variation area, and optionally splicing the text area B2 to the lower part of the i-1 th image, wherein the screenshot image is shown in FIG. 5 e; alternatively, both the image area A2 and the text area B2 can be stitched under the i-1 st image, and the corresponding screenshot image is shown in fig. 5 d. If the color variation of the image area A1 of the i-1 th image and the image area A2 of the i-th image is larger than the threshold value, and the color variation of the text area B1 of the i-1 th image and the color variation of the text area B2 of the i-1 th image are larger than the threshold value, determining that a variation area exists in the i-th image, splicing the image area A2 and the text area B2 to the lower part of the i-1 th image, and splicing the corresponding screenshot image as shown in fig. 5 d.
The steps of the above methods are divided for clarity, and the implementation may be combined into one step or split some steps, and the steps are divided into multiple steps, so long as the same logical relationship is included, which are all within the protection scope of the present patent; it is within the scope of the patent to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.
An embodiment of the present application further provides an electronic device, as shown in fig. 6, including: at least one processor 601; and a memory 602 communicatively coupled to the at least one processor 601; wherein the memory stores instructions executable by the at least one processor 601, the instructions being executable by the at least one processor 601 to enable the at least one processor 601 to perform the above-described method embodiments.
Where the memory 602 and the processor 601 are coupled by a bus, the bus may comprise any number of interconnected buses and bridges that couple one or more of the various circuits of the processor 601 and the memory 602 together. The bus may also connect various other circuits such as peripherals, voltage regulators, power management circuits, etc., which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor 601 is transmitted over a wireless medium via an antenna, which further receives the data and transmits the data to the processor 601.
The processor 601 is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. While memory 602 may be used to store data used by processor 601 in performing operations.
An embodiment of the present application further provides a computer-readable storage medium storing a computer program. The computer program realizes the above-described method embodiments when executed by a processor.
That is, as can be understood by those skilled in the art, all or part of the steps in the method for implementing the embodiments described above may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples for carrying out the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.

Claims (10)

1. A screen capture method, comprising:
continuously intercepting a plurality of images after detecting a trigger signal of screen capturing operation;
judging whether a change area exists in the ith image relative to the (i-1) th image; wherein the initial value of i is 2;
if the change area exists, obtaining an image to be spliced according to the image of the change area;
let i = i +1; judging whether the i is not more than N, wherein N is the number of the intercepted images;
if the determination is positive, returning to execute the step of judging whether the ith image has a change area relative to the (i-1) th image;
and after determining that the i is not larger than or equal to the N, or after obtaining the image to be spliced according to the image of the change area, splicing according to the image to be spliced to obtain the screenshot image.
2. The screen capture method according to claim 1, wherein before the determining whether the ith image has a changed area relative to the (i-1) th image, the screen capture method further comprises:
comparing each region to be compared divided from the ith image with the corresponding region of the (i-1) th image respectively, and determining the color variation of each region to be compared;
comparing the color variation of each region to be compared with a threshold value respectively to obtain a comparison result;
if the comparison result indicates that the area to be compared with the color variation larger than the threshold exists, the area to be compared with the color variation larger than the threshold is taken as the variation area.
3. The screen capture method according to claim 2, wherein before comparing the color variation of each of the regions to be compared with a threshold respectively to obtain a comparison result, the screen capture method further comprises:
obtaining the change parameters of the ith image according to the color number of the ith image and/or the color number of the (i-1) th image;
and acquiring a threshold corresponding to the ith image according to the change parameters and the constraint relation between the change parameters and the threshold.
4. The screen capture method of claim 3, wherein the constraint relationship indicates that the variation parameter and the threshold are in an inverse relationship.
5. The screen capturing method according to claim 2, wherein before the comparing the regions to be compared divided from the ith image with the corresponding regions of the (i-1) th image respectively to determine the color variation of each of the regions to be compared, the screen capturing method further comprises:
determining the dividing range of the ith image according to the first indication information; the dividing range is the whole area of the ith image or the partial area of the ith image;
and dividing the area to be compared from the dividing range of the ith image according to a dividing rule.
6. The screen capture method according to claim 5, wherein before the dividing the area to be compared from the divided range of the ith image according to the dividing rule, the screen capture method further comprises:
and determining a division rule corresponding to the division range according to the division range.
7. The screen capture method of any one of claims 1 to 6, wherein obtaining the image to be stitched according to the image of the change region comprises:
taking the image of the change area as the image to be spliced; alternatively, the first and second electrodes may be,
taking the line of the uppermost pixel of the uppermost changing region as an intercepting line, and intercepting an image positioned on the lower side of the intercepting line as the image to be spliced; alternatively, the first and second electrodes may be,
taking the line of the lowest pixel of the lowest changing area as an intercepting line, and intercepting an image positioned on the upper side of the intercepting line as the image to be spliced; alternatively, the first and second electrodes may be,
taking the column of the leftmost pixel of the left-most changing area as an intercepting line, and intercepting an image on the right side of the intercepting line as the image to be spliced; alternatively, the first and second electrodes may be,
and taking the column of the rightmost pixel of the rightmost change area as an intercepting line, and intercepting the image positioned on the left side of the intercepting line as the image to be spliced.
8. The screen capture method according to any one of claims 1 to 6, wherein the step of obtaining the screen capture image by means of splicing according to the image to be spliced is executed after it is determined that i ≦ N is not established; according to the image to be spliced, splicing to obtain a screen shot image, the method comprises the following steps: sequentially splicing the images to be spliced to a first position of a1 st image according to a time sequence to obtain a screen shot image; displaying the screen shot image; judging whether a direction replacing instruction is received or not; if so, splicing the images to be spliced in the direction indicated by the replacing direction instruction of the 1 st image in sequence according to the time sequence; updating the screen shot image according to the spliced image; returning to the step of displaying the screen capture image;
alternatively, the first and second electrodes may be,
after obtaining the image to be spliced according to the image of the change area, executing the step of splicing to obtain a screen capture image according to the image to be spliced; obtaining an image to be spliced according to the image of the change area, comprising: splicing the image to be spliced in a first direction of a last screen capture image to obtain the screen capture image; wherein the previous screenshot image is a screenshot image obtained for the 1 st image to the i-1 st image; after determining that i ≦ N does not hold, further comprising: displaying the screen shot image; judging whether a direction replacing instruction is received or not; if so, splicing the images to be spliced in the direction indicated by the replacement direction instruction of the 1 st image in sequence according to the time sequence; updating the screen shot image according to the spliced image; and returning to the step of executing the display screen capture image.
9. An electronic device, comprising: at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the screen capture method of any one of claims 1 to 8.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out a screen capture method according to any one of claims 1 to 8.
CN202110714224.9A 2021-06-25 2021-06-25 Screen capturing method, electronic device and storage medium Pending CN115237312A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110714224.9A CN115237312A (en) 2021-06-25 2021-06-25 Screen capturing method, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110714224.9A CN115237312A (en) 2021-06-25 2021-06-25 Screen capturing method, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN115237312A true CN115237312A (en) 2022-10-25

Family

ID=83666076

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110714224.9A Pending CN115237312A (en) 2021-06-25 2021-06-25 Screen capturing method, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN115237312A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104766271A (en) * 2015-04-13 2015-07-08 广东欧珀移动通信有限公司 Screen capture method, device and electronic device
US20180284981A1 (en) * 2017-03-28 2018-10-04 Beijing Xiaomi Mobile Software Co., Ltd. Method and apparatus for screen capture processing
CN110597439A (en) * 2019-08-29 2019-12-20 Oppo广东移动通信有限公司 Screen capture method and device, electronic equipment and computer readable medium
CN111522742A (en) * 2020-04-16 2020-08-11 北京三快在线科技有限公司 Page view generating method and device, computer equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104766271A (en) * 2015-04-13 2015-07-08 广东欧珀移动通信有限公司 Screen capture method, device and electronic device
US20180284981A1 (en) * 2017-03-28 2018-10-04 Beijing Xiaomi Mobile Software Co., Ltd. Method and apparatus for screen capture processing
CN110597439A (en) * 2019-08-29 2019-12-20 Oppo广东移动通信有限公司 Screen capture method and device, electronic equipment and computer readable medium
CN111522742A (en) * 2020-04-16 2020-08-11 北京三快在线科技有限公司 Page view generating method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
US9491366B2 (en) Electronic device and image composition method thereof
CN111698553B (en) Video processing method and device, electronic equipment and readable storage medium
US8948505B2 (en) Image processing apparatus, image processing method, program and imaging apparatus
CN112135046B (en) Video shooting method, video shooting device and electronic equipment
CN107613202B (en) Shooting method and mobile terminal
CN107659722B (en) Image selection method and mobile terminal
US20220417417A1 (en) Content Operation Method and Device, Terminal, and Storage Medium
RU2669511C2 (en) Method and device for recognising picture type
US11462002B2 (en) Wallpaper management method, apparatus, mobile terminal, and storage medium
EP2966849B1 (en) Color adjustment device, image display device, and color adjustment method
CN106802758B (en) Processing method and device for screen capture
CN108701439A (en) A kind of image display optimization method and device
CN110572706B (en) Video screenshot method, terminal and computer-readable storage medium
US9432583B2 (en) Method of providing an adjusted digital image representation of a view, and an apparatus
CN112188108A (en) Photographing method, terminal, and computer-readable storage medium
CN117270736A (en) Image display method and device and electronic equipment
CN115237312A (en) Screen capturing method, electronic device and storage medium
CN109766530B (en) Method and device for generating chart frame, storage medium and electronic equipment
EP2811732B1 (en) Image processing apparatus, image processing method, computer-readable storage medium and program
CN106055229B (en) Display interface adjusting method and display interface adjusting module based on screen reading
CN113284199A (en) Image gray area determination method, electronic device and server
CN106484215B (en) Method and device for managing desktop of mobile terminal
CN113473012A (en) Virtualization processing method and device and electronic equipment
US10877641B2 (en) Image adjustment method, apparatus, device and computer readable storage medium
CN111179161B (en) Picture scaling processing method and device 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