Screen capture method, device, terminal and readable storage medium
By obtaining screenshot instructions and instructions on the terminal, and determining and seizing the target area in the display area, the problem of too much information during direct screenshot is solved, and the accuracy and experience of screenshots are improved.
Patent Information
- Application Number
- CN202210931548.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-04
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2042-08-04
AI Technical Summary
When taking a direct screenshot, the screenshot image contains a lot of unnecessary information, resulting in a poor screenshot experience.
By obtaining screenshot instructions and pre-set screenshot instructions information, the target area in the terminal display area is determined, and screenshots are taken in that area to obtain the target image.
It realizes accurate screenshots based on the screenshot instructions, reducing the appearance of unnecessary information and improving the screenshot experience.
Smart Images

Figure CN115291777B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of image processing technology, and specifically relates to a screenshot method, device, terminal and readable storage medium. Background Art
[0002] Currently, when a screenshot is taken directly of the current page, the resulting screenshot image includes all information of the entire page, for example, information content information, entertainment content information, and notification message information of the current page. It is necessary to search in the screenshot image to obtain valid information, and the screenshot experience is poor. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a screenshot method, device, terminal and readable storage medium, which can solve the problem of poor screenshot experience.
[0004] In a first aspect, an embodiment of the present application provides a screenshot method, comprising:
[0005] Get the screenshot command;
[0006] Determining a target area in a display area of a terminal based on the screenshot instruction and pre-acquired screenshot indication information;
[0007] A screenshot is taken of the target area to obtain a target image.
[0008] In a second aspect, an embodiment of the present application provides a screen capture device, including:
[0009] The acquisition module is used to obtain the screenshot instruction;
[0010] A determination module, configured to determine a target area in a display area of a terminal based on the screenshot instruction and pre-acquired screenshot indication information;
[0011] The screenshot module is used to take a screenshot of the target area to obtain a target image.
[0012] In a third aspect, an embodiment of the present application proposes a terminal, comprising a processor and a memory, wherein the memory stores programs or instructions that can be executed on the processor, and when the programs or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0013] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0014] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0015] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.
[0016] In an embodiment of the present application, based on the screenshot instruction and the pre-acquired screenshot indication information, the target area in the display area of the terminal is determined, and a screenshot is taken of the target area to obtain a target image. The currently displayed page of the terminal can be captured according to the screenshot indication information to obtain a target image that conforms to the screenshot indication information, thereby improving the screenshot experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 One of the flowcharts of the screenshot method provided in the embodiment of the present application;
[0018] Figure 2 The second flowchart of the screenshot method provided in the embodiment of the present application;
[0019] Figure 3 One of the schematic diagrams of shielding notifications when taking screenshots provided in an embodiment of the present application;
[0020] Figure 4 The second schematic diagram of shielding notifications when taking screenshots provided in an embodiment of the present application;
[0021] Figure 5 One of the schematic diagrams of shielding the status bar and virtual buttons when taking screenshots provided in an embodiment of the present application;
[0022] Figure 6 The second schematic diagram of shielding the status bar and virtual buttons when taking a screenshot provided in an embodiment of the present application;
[0023] Figure 7 A schematic diagram of selecting a key area when taking a screenshot provided in an embodiment of the present application;
[0024] Figure 8 A schematic diagram of the structure of a screen capture device provided in an embodiment of the present application;
[0025] Fig. 9 One of the structural schematic diagrams of a terminal provided in an embodiment of the present application;
[0026] Fig.10 The second structural diagram of a terminal provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0028] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0029] The screenshot method provided in the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0030] Please refer to Figure 1 , Figure 1 This is one of the flowcharts of a screenshot method provided in an embodiment of the present application. Figure 1 As shown, an embodiment of the present application provides a screenshot method, which includes the following steps:
[0031] Step 101: Get the screenshot instruction.
[0032] Among them, the above-mentioned screenshot instruction can be an instruction input by the user to the terminal for triggering screenshot, for example: clicking the screenshot button of the terminal, triggering a specific operation pre-set for screenshot, or voice input screenshot instruction, etc., thereby triggering the terminal to take a screenshot.
[0033] Step 102: Determine a target area in a display area of the terminal based on the screenshot instruction and pre-acquired screenshot indication information.
[0034] It can be understood that the target area is located in the display area currently displayed by the terminal, for example, in the entire area or a part of the area of the terminal display screen.
[0035] Step 103: Take a screenshot of the target area to obtain a target image.
[0036] The screenshot indication information may be preset or determined by the user. For example, the screenshot indication information may include information on shielding certain areas or retaining certain areas when taking a screenshot. The screenshot may shield the status bar area, the button bar area, and the pop-up window area of the notification message, etc., or only the key areas may be taken as screenshots. Specifically, the screenshot indication information may include indication information indicating whether to shield the status bar and the button bar when taking a screenshot, indication information indicating whether to shield the notification message when taking a screenshot, or indication information indicating whether to select the key areas when taking a screenshot, etc.
[0037] Specifically, if the above-mentioned screenshot indication information includes indication information indicating blocking the status bar and the button bar, the status bar area and the button bar area in the above-mentioned display area can be excluded from the target area for screenshot, and a target image that does not include the status bar and the button bar can be obtained; if the above-mentioned screenshot indication information includes indication information indicating blocking notification messages, the notification message area in the above-mentioned display area can be excluded from the target area for screenshot, and a target image that does not include the status bar and the button bar can be obtained; if the above-mentioned screenshot indication information includes indication information indicating box-selecting a key area, the key area in the above-mentioned display area can be identified, and the image of the above-mentioned key area can be output as the above-mentioned target image. For example, the key area can be understood as the area corresponding to the content including the center of the display area, so that the key area can be boxed out based on the screenshot indication information.
[0038] In an embodiment of the present application, based on the screenshot instruction and the pre-acquired screenshot indication information, the target area in the display area of the terminal is determined, and a screenshot is taken of the target area to obtain a target image. The currently displayed page of the terminal can be captured according to the screenshot indication information to obtain a target image that conforms to the screenshot indication information, thereby improving the screenshot experience.
[0039] Optionally, the screenshot instruction information includes instruction information for instructing to shield a target object;
[0040] Determining the target area in the display area of the terminal based on the screenshot instruction and the pre-acquired screenshot indication information in step 102 includes:
[0041] Based on the screenshot instruction and pre-acquired screenshot indication information, when the display area includes the target object, the area corresponding to the target object in the display area image is shielded to obtain the target area.
[0042] Among them, the above-mentioned target object can be one or more of the status bar, virtual button or notification bar, etc. For example, the status bar of a mobile phone is usually at the top of the display area, and the area position and size corresponding to the status bar can be determined according to the screen size and model of the mobile phone.
[0043] In the case where the screenshot indication information includes indication information indicating shielding of the target object, if the target object is identified in the display area, the area corresponding to the target object can be shielded to obtain a target image that does not contain the target object. In the process of identifying the target object, the area where the target object may appear can be predetermined, so as to specifically identify whether the area where the target object may appear includes the target object. For example, when the target object is a virtual button, a certain area at the bottom of the display area can be determined as an area where the virtual button may appear. When it is identified that there is a virtual button in the area, the area is the area corresponding to the virtual button, and the area can be directly shielded.
[0044] In this implementation, based on the screenshot instruction and pre-acquired screenshot indication information, when the target object is included in the display area, the area corresponding to the target object in the display area is cropped to obtain the target area, and the target area can be screenshoted, so that the target image that meets the above-mentioned screenshot indication information can be quickly obtained.
[0045] Optionally, the display area includes a first area and a second area, and the first area is a pop-up window display area of the terminal;
[0046] Determining the target area in the display area of the terminal based on the screenshot instruction and the pre-acquired screenshot indication information in step 102 includes:
[0047] Based on the screenshot instruction and pre-acquired screenshot indication information, acquiring content information of the first area;
[0048] Based on a preset rule and content information of the first area, the second area or the display area is selected as the target area.
[0049] It can be understood that the first area corresponds to the pop-up window display area, the second area corresponds to the screenshot content display area, and the screenshot images of the first area and the second area can be captured in the corresponding areas respectively. The screenshot indication information may include an indication message indicating whether to intelligently select whether to block the pop-up window notification message, for example, pre-setting the content information of the target category to be blocked, so that after obtaining the content information of the first area, the content category of the first area can be determined and compared with the target category to determine whether it needs to be blocked.
[0050] Optionally, the above-mentioned preset rules include: shielding content information of a target category;
[0051] Wherein, based on a preset rule and content information of the first area, selecting the second area or the display area as the target area includes:
[0052] comparing the content information of the first area with the target category;
[0053] In a case where the content information of the first area matches the target category, selecting the second area as the target area;
[0054] In a case where the content information of the first area does not match the target category, the display area is selected as the target area.
[0055] It should be noted that the above-mentioned screenshot indication information may include indication information indicating whether to use the above-mentioned preset rules. Specifically, for the pop-up display area, the above-mentioned screenshot indication information may directly indicate whether to block the pop-up message, or indicate whether to use the above-mentioned preset rules to identify the category of the pop-up message to determine whether to block the pop-up message. The pop-up messages belonging to the target category can be blocked by the above-mentioned preset rules, so that the pop-up messages are intelligently blocked according to the content information of the pop-up display area. Among them, the above-mentioned target category can be pre-set or selected by the user. For example, a screenshot is triggered when a pop-up notification such as a takeaway message, a logistics message, or an IoT device message is received. In this scenario, the corresponding pop-up message can be captured and used; some game, information, and video live broadcast related message push, which is easy to be shared by users, can also be retained in the screenshot image; and some consumption, transfer, recruitment and other information involving user privacy can delete or hide the notification pop-up window of this category of information.
[0056] It can be understood that when the content of the above-mentioned pop-up display area matches the target category, the second area is selected as the target area, that is, the target image obtained is the image obtained by capturing the second area. Specifically, the first area and the second area can be captured respectively to obtain two images, and the image obtained by capturing the pop-up display area (that is, the above-mentioned first area) can be deleted, that is, the image obtained by capturing the second area is directly used as the target image; when the content of the above-mentioned pop-up display area does not match the target category, the image captured by the pop-up display area can be displayed, that is, the image obtained by the display area can be used as the target image, and the above-mentioned target image can be obtained by splicing the image captured from the first area and the image captured from the second area.
[0057] In this implementation, by acquiring content information of the first area based on the screenshot indication information, and selecting the second area or the display area as the target area based on preset rules and the content information of the first area, the target area can be flexibly determined according to the shielding indication information.
[0058] Optionally, after determining the target area in the display area of the terminal based on the screenshot instruction and the pre-acquired screenshot indication information in step 102, the method further includes:
[0059] Scaling the background page content of the display area to the target area, where the target area is smaller than the display area;
[0060] The area outside the target area in the display area is used to display a pop-up message, and the screenshot indication information includes indication information indicating to shield the pop-up message.
[0061] Among them, in the absence of a pop-up message, the above-mentioned background page content is the entire content of the above-mentioned display area; in the case of a pop-up message, the content of the above-mentioned display area includes the above-mentioned background page content and the above-mentioned pop-up message, and a part of the above-mentioned background page content will be covered by the pop-up message. The present application can completely display the above-mentioned background page content in the target area in the above-mentioned display area by scaling the above-mentioned background page content to the above-mentioned target area for display, display the pop-up message in the area outside the target area in the above-mentioned display area, and intercept the background page content displayed in the target area. In this way, only the above-mentioned background page content can be intercepted, and the display of the pop-up message will not be affected.
[0062] The target area can be obtained by scaling the display area of the terminal in proportion to improve the screenshot effect. Moreover, the scaling ratio can be determined based on the display area size of the pop-up message to reserve a sufficiently large area for the normal display of the pop-up message without affecting the acquisition of the screenshot content.
[0063] In this embodiment, the display area of the terminal can be divided into an area for displaying pop-up messages and a target area for displaying screenshot content. The target image is obtained by scaling the content currently displayed by the terminal to the target area and capturing the image in the target area. The pop-up message can be displayed normally without affecting the acquisition of the screenshot content, which complies with the screenshot indication information indicating the capture of the pop-up message, thereby improving the screenshot effect.
[0064] Optionally, taking a screenshot of the target area in step 103 to obtain a target image includes:
[0065] Taking a screenshot of the target area to obtain a first image;
[0066] dividing the first image into a plurality of second regions;
[0067] Based on the central area in the first image, determine at least one second area from the plurality of second areas, the at least one second area including the second area where the central area is located;
[0068] Based on the at least one second area, the target image is obtained.
[0069] It can be understood that the first image can be obtained by taking a screenshot of the target area.
[0070] Among them, the above-mentioned multiple second regions can be obtained based on an image segmentation algorithm. Specifically, the image can be divided into regions according to features such as grayscale, color, texture, and shape, so that there are obvious differences between regions and similarities within regions. For example, a region growing method based on regional grayscale difference, a threshold-based segmentation algorithm, an edge-based segmentation algorithm, a region-based segmentation algorithm, a graph theory-based segmentation algorithm, and a capability functional-based segmentation algorithm, etc.
[0071] The screenshot indication information may include indication information indicating the selection of a key area. It is understood that the content that the user wants to share in the screenshot is usually located near the center area of the display, so at least one second area can be determined as the key area based on the center area of the first image.
[0072] Wherein, the target image includes the at least one second region, that is, the image corresponding to the at least one second region is in the target image, or the image corresponding to the at least one second region is the target image. In the case where the at least one second region includes only one second region, the target image includes the one second region, and in the case where the at least one second region includes at least two second regions, the target image includes the region obtained by merging the at least two second regions.
[0073] The image corresponding to the at least one second area determined above can be marked in the above-mentioned target image. For example, the area outside the at least one second area (which can be understood as a non-key area) is covered with a gray mask, or the image corresponding to the at least one second area (which can be understood as a key area) is displayed using different color frames, etc.; or the image corresponding to the at least one second area is directly displayed as the above-mentioned target image.
[0074] Optionally, the determining at least one second area from the plurality of second areas based on the central area of the first image includes:
[0075] Based on the central area, determining a target second area among the plurality of second areas, wherein the central area is located within the target second area;
[0076] Based on the target second area, at least one second area is determined, the at least one second area includes the target second area, the similarity between the grayscale value information of each area in the at least one second area and the grayscale value information of the target second area is greater than or equal to a preset value, and when the at least one second area is at least two second areas, among the multiple second areas, the at least two second areas are adjacent to each other in sequence.
[0077] The gray value information may include gray value distribution information of each second region, and the regions may be merged according to the similarity of the gray value distribution information of each second region.
[0078] It can be understood that multiple areas are adjacent in sequence. For example, area A1, area A2 and area A3 are adjacent in sequence, that is, area A1 and area A2 are adjacent, area A2 and area A3 are adjacent, and area A2 is located between area A1 and area A3.
[0079] As a specific example, the above-mentioned first image can be divided into multiple second areas: area A1-area A7, area A1-area A7 are 7 second areas adjacent to each other in sequence, among which area A1 is adjacent to area A2, area A2 is adjacent to area A3, area A3 is adjacent to area A4, area A4 is adjacent to area A5, area A5 is adjacent to area A6, area A6 is adjacent to area A7, and the central area of the first image is located in area A4, and area A4 can be determined as the target second area. In the first image, there are two adjacent areas to area A4: area A3 and area A5, the similarity between the grayscale value information of area A3 and the grayscale value information of area A4 is greater than a preset value, the similarity between the grayscale value information of area A5 and the grayscale value information of area A4 is greater than a preset value, the similarity between the grayscale value information of area A2 and the grayscale value information of area A4 is less than a preset value, the similarity between the grayscale value information of area A6 and the grayscale value information of area A4 is greater than a preset value, and the similarity between the grayscale value information of area A7 and the grayscale value information of area A4 is less than a preset value. In this way, the at least one second area finally obtained includes the sequentially adjacent areas A3, A4, A5 and A6 (regardless of whether the similarity between the grayscale value information of area A1 and the grayscale value information of area A4 is less than the preset value).
[0080] In the above implementation, the sequentially adjacent regions A3, A4, A5, and A6 can be merged, and the merged region can be displayed as a key region. For the merging of regions A3, A4, A5, and A6, the adjacent regions can be merged first. For example, after determining that region A4 is the target second region, regions A3 and A5 adjacent to region A4 are first merged into region A3 to obtain a merged region, and then region A6 adjacent to region A5 is merged into the above merged region to obtain a merged region of regions A3, A4, A5, and A6. Alternatively, it can be determined first which regions can be merged. For example, based on the similarity between the grayscale value distribution information of each region and the grayscale value distribution information of region A4, as well as the adjacent relationship of each region, it is determined that regions A3, A4, A5, and A6 need to be merged, and then regions A3, A4, A5, and A6 are directly merged to obtain a merged region.
[0081] In this implementation, intelligent area selection can be performed on the captured first image to obtain a target image, thereby reducing the user's operation steps and improving the screenshot experience.
[0082] Optionally, after taking a screenshot of the target area to obtain a target image in step 103, the method further includes:
[0083] displaying the target image;
[0084] receiving a region selection instruction input by a user for the target image;
[0085] Based on the target image and the region selection instruction, a second image is generated.
[0086] In this implementation, the target image may be resized or resized according to the area selection instruction of the user to obtain the second image required by the user, thereby improving the flexibility of the screenshot.
[0087] The method provided in this application is illustrated below by way of example.
[0088] Figure 2 FIG. 1 is a flow chart of a method for taking screenshots on a mobile phone provided in an embodiment of the present application. Figure 2 As shown, the specific steps implemented in the embodiment of the present application are as follows:
[0089] Step 201: When a user needs to take a screenshot while using a mobile phone, the mobile phone receives an operation instruction from the user to trigger the screenshot.
[0090] Among them, after the mobile phone receives the user's operation instruction to trigger the screenshot, the mobile phone's intelligent screenshot processing engine takes over the mobile phone screenshot operation.
[0091] Among them, users can choose whether to use the intelligent screenshot processing engine, and choose whether to turn on "block the status bar and virtual buttons when taking screenshots", "block notifications when taking screenshots" and "automatically select key areas when taking screenshots".
[0092] Step 202: Determine whether the user has enabled the "block notifications when taking screenshots" option. If enabled, any of the following methods can be used to disable notification pop-ups to take screenshots. The specific implementation methods are as follows:
[0093] Method 1: Area zoom screenshot. The specific process is as follows.
[0094] Step 1a, scale the screen content to the lower left in a proportional manner, leaving a pop-up window area (i.e., notification content area) with a height of x pixels at the top (x is the normal pop-up window height of the mobile phone, which can be determined according to the model of the mobile phone and the size of the mobile phone screen, etc.), and then the screen content is reduced and displayed in the screen content area, such as Figure 3 As shown;
[0095] Step 1b: When capturing the screen, only the zoomed screen area is captured ( Figure 3 The content in the notification content area is not included.
[0096] Step 1c: The notification message during screenshot can be displayed as a normal pop-up window in the pop-up window area and will not be captured;
[0097] Step 1d: After the screen area content is captured, the zooming operation in step 1a is restored. During the whole process, the user is basically unaware of the screen zooming, and the notification content of the terminal to the user is not affected.
[0098] Method 2: Intelligently determine whether to add a pop-up area. The specific process is as follows.
[0099] Step 2a: When the user triggers the screenshot, the mobile phone automatically captures the notification content area and the screen content area respectively, so that two pictures can be obtained, one is the screen content area picture without the notification bar, and the other is the notification content area picture of the separate notification bar, such as Figure 4 .
[0100] Step 2b. Determine whether the image in the notification content area needs to be displayed based on certain rules. The specific rules can be based on the current user scenario. For example, when there is a pop-up notification of takeaway, logistics, or IoT device messages, a screenshot is triggered. At this time, it is generally necessary to capture the corresponding pop-up message; some push notifications related to games, information, and live videos are easy to be shared by users and also need to be captured; and some consumption, transfer, recruitment and other information involving user privacy are generally not shared by users, and this part needs to be hidden in the notification pop-up.
[0101] Step 2c: After determining whether the notification area image needs to be displayed according to step 2b, if it does not need to be displayed, the screen content area content only needs to be used directly; if it needs to be displayed, the notification area image and the screen content area image are spliced, such as Figure 4 shown.
[0102] Method 3: Block pop-ups when taking screenshots, that is, temporarily block pop-ups when taking screenshots to avoid capturing the message content in the notification bar. In addition, you can delay displaying the message content in the notification bar after taking screenshots to prevent users from not being able to obtain the message content in the notification bar.
[0103] Step 203: Capture the screenshot area determined in step 202 to generate a screenshot image.
[0104] Step 204: Determine whether the user has enabled "shield status bar and virtual keys when taking screenshots". If enabled, the status bar area and virtual key area are cropped. The cropping range of the status bar area is the top 40px height area and the bottom 20px height area of the image (the cropping range can be flexibly determined according to the position and size of the mobile phone status bar and virtual keys). Figure 5 As shown, the cropped image is Figure 6 shown.
[0105] Step 205: Determine whether the user has turned on "automatically select key areas". If turned on, crop the screenshot image according to specific cropping rules to select key areas.
[0106] The specific clipping rule can be a region growing method based on regional grayscale difference. The clipping process is as follows:
[0107] Step a, dividing the screenshot image into non-overlapping rectangular small areas, the width of the small area being the width of the image;
[0108] Step b, find the central area of the image, and then determine the small rectangular area containing the central area, and compare the grayscale histogram of the small rectangular area with the grayscale histogram of the adjacent small rectangular area, and merge the areas according to the similarity of grayscale distribution;
[0109] Step c: set a termination criterion, and merge the small rectangular areas in sequence by repeating step b until the termination criterion is met.
[0110] by Figure 7 For example: Figure 7 Each arrow in the figure represents a small rectangular area divided according to step a. Area 701 is the center area of the screenshot, which is first called the first key area. Area 702 is the area that meets the rules for the first time and is merged into the first key area, which is called the second key area. Area 703 is the area that meets the rules for the second time and is merged into the second key area, which is called the third key area. The area outside area 703 meets the termination criteria after calculation, so the key area will no longer expand outward, and the third key area is the final key area.
[0111] Step 206: After obtaining the key area, a gray mask is applied to the area outside the key area. The user can open the corresponding picture on the mobile phone. The key area has been framed in the picture. The user can flexibly adjust the range of the key area. After confirming that it is correct, the user clicks OK to complete the smart screenshot and obtain the desired picture.
[0112] The screenshot method provided in the embodiment of the present application can be executed by a screenshot device or a control module in the screenshot device for executing the screenshot method. In the embodiment of the present application, the screenshot device provided in the embodiment of the present application is described by taking the screenshot method executed by the screenshot device as an example.
[0113] Please refer to Figure 8 , Figure 8 This is a schematic diagram of the structure of the screenshot device provided in the embodiment of the present application. Figure 8 As shown, another aspect of the present application further provides a screen capture device, the screen capture device 800 comprising:
[0114] The acquisition module 801 is used to acquire a screenshot instruction;
[0115] A determination module 802, configured to determine a target area in a display area of a terminal based on the screenshot instruction and pre-acquired screenshot indication information;
[0116] The screenshot module 803 is used to take a screenshot of the target area to obtain a target image.
[0117] Optionally, the screenshot instruction information includes instruction information for instructing to shield a target object;
[0118] The determining module 802 includes:
[0119] A shielding unit is used to shield the area corresponding to the target object in the display area based on the screenshot instruction and pre-acquired screenshot indication information, so as to obtain the target area when the display area includes the target object.
[0120] Optionally, the display area includes a first area and a second area, and the first area is a pop-up window display area of the terminal;
[0121] The determining module 802 includes:
[0122] A first acquisition unit, configured to acquire content information of the first area based on the screenshot instruction and pre-acquired screenshot indication information;
[0123] A selection unit is configured to select the second area or the display area as the target area based on a preset rule and content information of the first area.
[0124] Optionally, the screen capture device 800 further includes:
[0125] A zoom module, used to zoom the background page content of the display area to the target area, where the target area is smaller than the display area;
[0126] The area outside the target area in the display area is used to display a pop-up message, and the screenshot indication information includes indication information on whether to indicate to shield the pop-up message.
[0127] Optionally, the screenshot module 803 further includes:
[0128] A second acquisition unit, used to take a screenshot of the target area to obtain a first image;
[0129] A segmentation unit, configured to segment the first image into a plurality of second regions;
[0130] A second determining unit, configured to determine at least one second region from the plurality of second regions based on the central region of the first image, wherein the at least one second region includes the second region where the central region is located;
[0131] A third acquisition unit is used to obtain the target image based on the at least one second area.
[0132] Optionally, the second determining unit includes:
[0133] A first determining subunit is configured to determine a target second area among the plurality of second areas based on the central area, wherein the central area is located within the target second area;
[0134] A second determination subunit is used to determine the at least one second area based on the target second area, the at least one second area includes the target second area, the similarity between the grayscale value information of each area in the at least one second area and the grayscale value information of the target second area is greater than or equal to a preset value, and when the at least one second area is at least two second areas, among the multiple second areas, the at least two second areas are adjacent to each other in sequence.
[0135] Optionally, the screen capture device further includes:
[0136] A display module, used for displaying the target image;
[0137] A receiving module, used for receiving a region selection instruction inputted by a user based on the target image;
[0138] A generating module is used to generate a second image based on the target image and the region selection instruction.
[0139] In an embodiment of the present application, based on the screenshot instruction and the pre-acquired screenshot indication information, the target area in the display area of the terminal is determined, and a screenshot is taken in the target area to obtain a target image. The currently displayed page of the terminal can be captured according to the screenshot indication information to obtain a target image that conforms to the screenshot indication information, thereby improving the screenshot experience.
[0140] The screenshot device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or a device other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a personal computer (personal computer, PC), etc., which is not specifically limited in the embodiment of the present application.
[0141] The screenshot device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0142] The screenshot device provided in the embodiment of the present application can achieve Figure 1 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0143] Alternatively, if Fig. 9 As shown, an embodiment of the present application also provides a terminal 900, including a processor 901 and a memory 902, and the memory 902 stores a program or instruction that can be executed on the processor 901. When the program or instruction is executed by the processor 901, the various steps of the above-mentioned screenshot method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0144] It should be noted that the terminal in the embodiment of the present application includes the mobile electronic device and the non-mobile electronic device mentioned above.
[0145] Fig.10 A schematic diagram of the hardware structure of a terminal for implementing an embodiment of the present application.
[0146] The terminal 1000 includes but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010 and other components.
[0147] Those skilled in the art will appreciate that the terminal 1000 may also include a power source (such as a battery) for supplying power to various components, and the power source may be logically connected to the processor 1010 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig.10 The terminal structure shown in the figure does not constitute a limitation on the terminal. The terminal may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0148] The processor 1010 is configured to:
[0149] Get screenshot instructions;
[0150] Based on the screenshot instruction and the pre-acquired screenshot indication information, intercept and determine a first image of a target area in a current display area of the terminal;
[0151] A screenshot is taken of the target area to obtain a target image.
[0152] In an embodiment of the present application, based on the screenshot instruction and the pre-acquired screenshot indication information, the target area in the display area of the terminal is determined, and a screenshot is taken in the target area to obtain a target image. The currently displayed page of the terminal can be captured according to the screenshot indication information to obtain a target image that conforms to the screenshot indication information, thereby improving the screenshot experience.
[0153] Optionally, the screenshot instruction information includes instruction information for instructing to shield a target object;
[0154] The determining, based on the screenshot instruction and the pre-acquired screenshot indication information, a target area in a display area of the terminal includes:
[0155] Based on the screenshot instruction and pre-acquired screenshot indication information, when the display area includes the target object, the area corresponding to the target object in the display area is shielded to obtain the target area.
[0156] Optionally, the display area includes a first area and a second area, and the first area is a pop-up window display area of the terminal;
[0157] The determining, based on the screenshot instruction and the pre-acquired screenshot indication information, a target area in a display area of the terminal includes:
[0158] Based on the screenshot instruction and pre-acquired screenshot indication information, acquiring content information of the first area;
[0159] Based on a preset rule and content information of the first area, the second area or the display area is selected as the target area.
[0160] Optionally, the processor 1010 is further configured to implement:
[0161] Scaling the background page content of the display area to the target area, where the target area is smaller than the display area;
[0162] The area outside the target area in the display area is used to display a pop-up message, and the screenshot indication information includes indication information indicating to shield the pop-up message.
[0163] Optionally, taking a screenshot of the target area to obtain a target image includes:
[0164] Taking a screenshot of the target area to obtain a first image;
[0165] dividing the first image into a plurality of second regions;
[0166] Based on the central area in the first image, determine at least one second area from the plurality of second areas, the at least one second area including the second area where the central area is located;
[0167] Based on the at least one second area, the target image is obtained.
[0168] Optionally, the determining at least one second area from the plurality of second areas based on the central area of the first image includes:
[0169] Based on the central area, determining a target second area among the plurality of second areas, wherein the central area is located within the target second area;
[0170] Based on the target second area, at least one second area is determined, the at least one second area includes the target second area, the similarity between the grayscale value information of each area in the at least one second area and the grayscale value information of the target second area is greater than or equal to a preset value, and when the at least one second area is at least two second areas, among the multiple second areas, the at least two second areas are adjacent to each other in sequence.
[0171] Optionally, the processor 1010 is further configured to implement:
[0172] displaying the target image;
[0173] receiving a region selection instruction input by a user for the target image;
[0174] Based on the target image and the region selection instruction, a second image is generated.
[0175] It should be understood that in the embodiment of the present application, the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042, and the graphics processor 10041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1007 includes a touch panel 10071 and at least one of other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include two parts: a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0176] The memory 1009 can be used to store software programs or instructions and various data. The memory 1009 can mainly include a program or instruction storage area and a data storage area, wherein the program or instruction storage area can store an operating system, an application program or instruction required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 1009 can include a high-speed random access memory, and can also include a non-volatile memory, wherein the non-volatile memory can be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically erasable programmable read-only memory (Electrically EPROM, EEPROM) or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 1009 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0177] The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 1010.
[0178] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned screenshot method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0179] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0180] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned screenshot method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0181] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0182] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned screenshot method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0183] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0184] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling an electronic device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0185] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A screenshot method, characterized in that: include: Get the screenshot command; Determining a target area in a display area of a terminal based on the screenshot instruction and pre-acquired screenshot indication information; Taking a screenshot of the target area to obtain a target image; After determining the target area in the display area of the terminal based on the screenshot instruction and the pre-acquired screenshot indication information, the method further includes: Scaling the background page content of the display area to the target area, where the target area is smaller than the display area; The area outside the target area in the display area is used to display a pop-up message, and the screenshot indication information includes indication information indicating to shield the pop-up message.
2. The method according to claim 1, characterized in that The screenshot instruction information includes instruction information for instructing to shield a target object; The determining, based on the screenshot instruction and the pre-acquired screenshot indication information, a target area in a display area of the terminal includes: Based on the screenshot instruction and pre-acquired screenshot indication information, when the display area includes the target object, the area corresponding to the target object in the display area is shielded to obtain the target area.
3. The method according to claim 1, characterized in that The display area includes a first area and a second area, the first area being a pop-up window display area of the terminal; The determining, based on the screenshot instruction and the pre-acquired screenshot indication information, a target area in a display area of the terminal includes: Based on the screenshot instruction and pre-acquired screenshot indication information, acquiring content information of the first area; Based on a preset rule and content information of the first area, the second area or the display area is selected as the target area.
4. The method according to claim 1, characterized in that The step of taking a screenshot of the target area to obtain a target image includes: Taking a screenshot of the target area to obtain a first image; dividing the first image into a plurality of second regions; Based on the central area of the first image, determine at least one second area from the plurality of second areas, the at least one second area including the second area where the central area is located; Based on the at least one second area, the target image is obtained.
5. The method according to claim 4, characterized in that The determining, based on the central area of the first image, at least one second area from the plurality of second areas comprises: Based on the central area, determining a target second area among the plurality of second areas, wherein the central area is located within the target second area; Based on the target second area, at least one second area is determined, the at least one second area includes the target second area, the similarity between the grayscale value information of each area in the at least one second area and the grayscale value information of the target second area is greater than or equal to a preset value, and when the at least one second area is at least two second areas, among the multiple second areas, the at least two second areas are adjacent to each other in sequence.
6. The method according to any one of claims 1 to 5, characterized in that After taking a screenshot of the target area to obtain a target image, the method further includes: displaying the target image; receiving a region selection instruction input by a user for the target image; Based on the target image and the region selection instruction, a second image is generated.
7. A screen capture device, characterized in that: include: Acquisition module, used to obtain screenshot instructions; A determination module, configured to determine a target area in a display area of a terminal based on the screenshot instruction and pre-acquired screenshot indication information; A screenshot module, used to take a screenshot of the target area to obtain a target image; The screen capture device further includes: A scaling unit, used to scale the background page content of the display area to the target area, where the target area is smaller than the display area; The area outside the target area in the display area is used to display a pop-up message, and the screenshot indication information includes indication information on whether to shield the pop-up message.
8. The screen capture device according to claim 7, characterized in that: The screenshot instruction information includes instruction information for instructing to shield a target object; The determining module comprises: A shielding unit is used to shield the area corresponding to the target object in the display area based on the screenshot instruction and pre-acquired screenshot indication information, so as to obtain the target area when the display area includes the target object.
9. The screen capture device according to claim 7, characterized in that: The display area includes a first area and a second area, the first area being a pop-up window display area of the terminal; The determining module comprises: A first acquisition unit, configured to acquire content information of the first area based on the screenshot instruction and pre-acquired screenshot indication information; A selection unit is configured to select the second area or the display area as the target area based on a preset rule and content information of the first area.
10. The screen capture device according to claim 7, characterized in that: The screenshot module includes: A second acquisition unit, used to take a screenshot of the target area to obtain a first image; A segmentation unit, configured to segment the first image into a plurality of second regions; A second determining unit, configured to determine at least one second region from the plurality of second regions based on the central region of the first image, wherein the at least one second region includes the second region where the central region is located; A third acquisition unit is configured to obtain the target image based on the at least one second area.
11. The screen capture device according to claim 10, characterized in that: The second determining unit includes: A first determining subunit is configured to determine a target second area among the plurality of second areas based on the central area, wherein the central area is located within the target second area; A second determination subunit is used to determine the at least one second area based on the target second area, the at least one second area includes the target second area, the similarity between the grayscale value information of each area in the at least one second area and the grayscale value information of the target second area is greater than or equal to a preset value, and when the at least one second area is at least two second areas, among the multiple second areas, the at least two second areas are adjacent to each other in sequence.
12. The screen capture device according to any one of claims 7 to 11, characterized in that: The screen capture device also includes: A display module, used for displaying the target image; A receiving module, used for receiving a region selection instruction inputted by a user based on the target image; A generating module is used to generate a second image based on the target image and the region selection instruction.
13. A terminal, characterized in that: The method comprises a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the screenshot method according to any one of claims 1 to 6 are implemented.
14. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the screenshot method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Screen capturing method and device
CN106502533A
Screen-shooting method and device
CN106775333A
Image processing method and device and electronic equipment
CN112363787A