Interaction method, device, equipment, medium and product of screen capture
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI LONGCHEER INTELLIGENCE TECHNOLOGY CO LTD
- Filing Date
- 2026-04-10
- Publication Date
- 2026-07-14
Smart Images

Figure CN122387348A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to an interactive method, apparatus, device, medium and product for taking screenshots. Background Technology
[0002] With the widespread adoption of digital office work and instant messaging, screenshots have become an important interactive method for users to record information, share content, and preserve evidence. In scenarios involving privacy protection, sensitive information blocking, or where only a portion of the screen content needs to be retained, users have higher demands for screenshot editing capabilities.
[0003] Existing screenshot tools typically employ a process of capturing first and then editing. After a user triggers a screenshot, the system generates a preview image containing the entire screen content. The user can then perform basic editing operations on the image in the preview interface, such as cropping, annotation, and adding mosaics. After editing, the user can save or share the final image.
[0004] However, when the aforementioned existing technology requires the deletion of multiple discontinuous regions or the recombination and splicing of the remaining regions, users need to use external image editing software and go through multiple cropping and manual splicing steps to obtain the desired image. The operation process is cumbersome, lengthy, and inefficient. Summary of the Invention
[0005] This application provides interactive methods, devices, equipment, media, and products for taking screenshots, in order to improve screenshot efficiency and content security.
[0006] In a first aspect, embodiments of this application provide an interactive method for taking screenshots, including:
[0007] In response to a screenshot trigger, the screen display content is captured and a preview bitmap is generated;
[0008] Identify at least one deletion region in the preview bitmap and record the geometric information of each deletion region;
[0009] Determine the target retention area in the preview bitmap, process the target retention area based on geometric information, generate the target image, and output it.
[0010] Optionally, at least one deletion region is determined in the preview bitmap, and the geometric information of each deletion region is recorded, specifically including:
[0011] In response to the operation of continuously dragging the selection box on the preview bitmap, multiple deletion areas are defined;
[0012] Determine the coordinates and dimensions of each deleted region in the preview bitmap, with the top-left corner of the preview bitmap as the origin.
[0013] Optionally, the target reserved area in the preview bitmap is determined, specifically including:
[0014] Obtain the deletion strategy selected by the user. The deletion strategies include background color fill strategy, horizontal compression strategy, vertical compression strategy, and inverted selection retention strategy.
[0015] The target retention area is determined based on the deletion strategy. When the deletion strategy is a background color filling strategy, a horizontal compression strategy, or a vertical compression strategy, the remaining area outside the deletion area is taken as the target retention area. When the deletion strategy is an inverse selection retention strategy, the deletion area is taken as the target retention area.
[0016] Optionally, the target preservation region is processed based on geometric information to generate a target image, specifically including:
[0017] When the deletion strategy is a background color fill strategy, the relative position of the deletion area in the preview bitmap is determined based on geometric information;
[0018] Based on relative position, pixels within the deleted area are replaced with background color pixels to generate the target image.
[0019] Optionally, when the deletion strategy is a horizontal compression strategy or a vertical compression strategy, the retention area located to the right or below the deletion area in the target retention area is determined based on geometric information;
[0020] Move the retained area located to the right or below the deleted area to the left or above, so that the retained area is connected to the retained area to the left or above the deleted area;
[0021] The target image is generated by filling the invalid areas created after the movement with background color pixels.
[0022] Optionally, when the deletion strategy is the inverse selection retention strategy, the target retention regions are stitched together based on the coordinates of the upper left corner of the first target retention region in the target retention region to generate the target image.
[0023] Optionally, after generating the target image, the memory resources occupied by the preview bitmap are released.
[0024] Secondly, embodiments of this application provide an interactive device for taking screenshots, comprising:
[0025] The acquisition module is used to respond to screenshot triggering operations, acquire the screen display content and generate a preview bitmap;
[0026] The processing module is used to determine at least one deletion region in the preview bitmap and record the geometric information of each deletion region;
[0027] The processing module is also used to determine the target retention area in the preview bitmap, process the target retention area according to geometric information, generate the target image and output it.
[0028] Optionally, the processing module is also configured to determine multiple deletion areas in response to the operation of continuously dragging the selection box on the preview bitmap;
[0029] Determine the coordinates and dimensions of each deleted region in the preview bitmap, with the top-left corner of the preview bitmap as the origin.
[0030] Optionally, the acquisition module is also used to acquire the deletion strategy selected by the user, including background color filling strategy, horizontal compression strategy, vertical compression strategy and inverse selection retention strategy;
[0031] The target retention area is determined based on the deletion strategy. When the deletion strategy is a background color filling strategy, a horizontal compression strategy, or a vertical compression strategy, the remaining area outside the deletion area is taken as the target retention area. When the deletion strategy is an inverse selection retention strategy, the deletion area is taken as the target retention area.
[0032] Optionally, the processing module is also used to determine the relative position of the deletion area in the preview bitmap based on geometric information when the deletion strategy is a background color fill strategy;
[0033] Based on relative position, pixels within the deleted area are replaced with background color pixels to generate the target image.
[0034] Optionally, the processing module is also used to determine, based on geometric information, the retention area located to the right or below the deletion area in the target retention area when the deletion strategy is a horizontal compression strategy or a vertical compression strategy;
[0035] Move the retained area located to the right or below the deleted area to the left or above, so that the retained area is connected to the retained area to the left or above the deleted area;
[0036] The target image is generated by filling the invalid areas created after the movement with background color pixels.
[0037] Optionally, the processing module is also used to stitch together each target retention region to generate a target image when the deletion strategy is an inverse selection retention strategy, using the upper left corner coordinates of the first target retention region in the target retention region as a reference.
[0038] Optionally, the processing module is also used to release the memory resources occupied by the preview bitmap after the target image is generated.
[0039] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;
[0040] The memory stores the instructions that the computer executes;
[0041] The processor executes computer execution instructions stored in memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0042] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.
[0043] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.
[0044] The screenshot interaction method, apparatus, device, medium, and product provided in this application, in response to a screenshot trigger operation, acquires the screen display content and generates a preview bitmap. At least one deletion region is determined in the preview bitmap, and the geometric information of each deletion region is recorded. A target retention region is determined in the preview bitmap, and the target retention region is processed according to the geometric information to generate and output a target image. In this process, the user does not need to switch between a screenshot tool and external image editing software, nor does the user need to perform multiple screenshots and manual stitching operations on the same screenshot content. Deletion region marking and image synthesis are completed in one step within the screenshot preview interface, simplifying the operation steps. Furthermore, by directly removing the deletion region instead of using mosaic or image removal methods, the risk of information leakage due to image restoration is avoided. This effectively solves the problems of cumbersome, inefficient, and insufficient privacy protection in the prior art regarding multi-region deletion and image reconstruction after screenshot processing, thereby improving the efficiency and content security of screenshot operations. Attached Figure Description
[0045] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0046] Figure 1 A flowchart illustrating the interactive method for taking screenshots provided in this application;
[0047] Figure 2 Screenshots provided for this application Figure 1 ;
[0048] Figure 3 Screenshots provided for this application Figure 2 ;
[0049] Figure 4 Screenshots provided for this application Figure 3 ;
[0050] Figure 5 Screenshots provided for this application Figure 4 ;
[0051] Figure 6 Screenshots provided for this application Figure 5 ;
[0052] Figure 7 Screenshots provided for this application Figure 6 ;
[0053] Figure 8 Screenshots provided for this application Figure 7 ;
[0054] Figure 9 A schematic diagram of the interactive device used for the screenshots provided in this application;
[0055] Figure 10 A schematic diagram of the structure of the electronic device provided in this application.
[0056] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0057] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0058] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of the relevant data all comply with the relevant laws, regulations, and standards of the relevant regions, have taken necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation portals for users to choose to authorize or refuse.
[0059] With the widespread adoption of digital office work and mobile internet, users are increasingly demanding higher efficiency and greater information security from screenshots. For example, in scenarios such as chat applications, document editing, and web browsing on mobile phones or computers, users often need to capture screen content to record or share information, but screenshots may contain private data that they do not want to be retained (such as passwords, verification codes, sensitive conversations, etc.).
[0060] Traditional screenshotting methods require users to first capture the entire image, then manually crop, stitch, or add mosaics using third-party image processing software to cover sensitive content or other unwanted information, and finally reassemble the valid area. This process requires users to have certain image processing skills and is cumbersome, significantly reducing work efficiency, especially in office scenarios where frequent screenshot processing is necessary. Additionally, users can cover or replace sensitive areas by adding mosaics or using image removal algorithms. However, mosaic-processed images are difficult to restore to their original information and may suffer from reduced image clarity due to pixelation; while image removal techniques rely on complex algorithm models, consume significant computational resources, and may struggle to accurately identify sensitive content in some scenarios, potentially leading to the risk of privacy data leakage.
[0061] Furthermore, when processing multiple screenshots, users need to perform multiple operations and switch applications, causing process interruptions and consuming system resources. For example, when capturing an image containing multiple private areas, users need to capture the valid areas separately and save them multiple times, finally combining them using external tools, or take a screenshot first, then open the clipboard or image editing tool to delete content, and then take another screenshot or save it. Finally, redundant files need to be manually cleaned up, making the entire process cumbersome. The inefficient screenshot interaction methods of existing technology not only increase the user's time cost, but may also lead to the leakage of privacy information due to operational errors.
[0062] The interactive screenshot method provided in this application, in response to a screenshot trigger operation, acquires the screen display content and generates a preview bitmap. At least one deletion region is identified in the preview bitmap, and the geometric information of each deletion region is recorded. A target retention region is determined in the preview bitmap, and the target retention region is processed according to the geometric information to generate and output the target image. In this process, the user does not need to switch between a screenshot tool and external image editing software, nor does the user need to perform multiple screenshots and manual stitching operations on the same screenshot content. Deletion region marking and image synthesis are both completed in one step within the screenshot preview interface, simplifying the operation steps. Furthermore, by directly removing the deletion region instead of using mosaic or image removal methods, the risk of information leakage due to image restoration is avoided. This effectively solves the problems of cumbersome, inefficient, and insufficient privacy protection in existing post-screenshot processing methods for multi-region deletion and image reconstruction, thereby improving the efficiency and security of screenshot operations.
[0063] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0064] Figure 1 A flowchart illustrating the interactive method for taking screenshots provided in this application is shown below. Figure 1 As shown, the method includes:
[0065] S101. In response to the screenshot trigger operation, obtain the screen display content and generate a preview bitmap.
[0066] More specifically, in response to the user pressing the screenshot shortcut key or clicking the screenshot button, the screenshot application calls the screen capture interface provided by the operating system to obtain the pixel data corresponding to the current screen display content, and loads and stores the pixel data into a data structure to generate a preview bitmap. This preview bitmap is used to present an editable screenshot preview interface on the user interface.
[0067] In one possible implementation, when a user is chatting on a mobile phone, it is necessary to capture the conversation content in the current chat interface. The user presses the power button and volume down button simultaneously. The mobile phone operating system captures this key combination event, calls the screen capture service to obtain the display buffer data of the current screen, converts the data into a bitmap format, and displays a floating screenshot preview bitmap window on the screen. This preview bitmap window presents a complete screenshot of the chat interface for the user to perform subsequent editing operations.
[0068] S102. Determine at least one deletion region in the preview bitmap and record the geometric information of each deletion region.
[0069] More specifically, at least one deletion region is determined in the preview bitmap, and the geometric information of each deletion region is recorded. Specifically, this includes: determining multiple deletion regions in response to the operation of continuously dragging a selection box on the preview bitmap; and determining the coordinate information and size information of each deletion region in the preview bitmap, wherein the coordinate information is based on the upper left corner of the preview bitmap as the origin.
[0070] Optionally, the size information includes the width and height values of the selection box.
[0071] In one possible embodiment, such as Figure 2 As shown, the user dragged out three rectangular selection boxes on the preview bitmap, selecting the profile picture area in the chat history (e.g., ...). Figure 2 Area A), verification code number area (such as Figure 2 Area B) and name (e.g. Figure 2(Region C). Each time the system detects that the user has completed a drag operation, it obtains the coordinates of the top-left corner of the selection box in the preview bitmap, as well as the width and height values of the selection box, and stores these four values as a set of geometric information in a pre-created data structure list. Specifically, the coordinates of the top-left corner of region A in the preview bitmap are (a1, b1), corresponding to a selection box width of x1 and a height of y1; the coordinates of the top-left corner of region B in the preview bitmap are (a2, b2), corresponding to a selection box width of x2 and a height of y2; and the coordinates of the top-left corner of region C in the preview bitmap are (a3, b3), corresponding to a selection box width of x3 and a height of y3.
[0072] This embodiment enables users to drag selection boxes continuously on the preview bitmap and record the geometric information of each selection box, thereby achieving rapid marking of multiple discontinuous deletion areas and providing a coordinate data foundation for subsequent image synthesis of multiple deletion areas.
[0073] S103. Determine the target retention area in the preview bitmap, process the target retention area according to geometric information, generate the target image and output it.
[0074] More specifically, determining the target retention area in the preview bitmap includes: obtaining the deletion policy selected by the user, including background color fill policy, horizontal compression policy, vertical compression policy, and inverse selection retention policy; determining the target retention area based on the deletion policy, wherein when the deletion policy is background color fill policy, horizontal compression policy, or vertical compression policy, the remaining area outside the deletion area is taken as the target retention area, and when the deletion policy is inverse selection retention policy, the deletion area is taken as the target retention area.
[0075] In one possible implementation, after selecting multiple areas to delete, the user clicks the "Delete Strategy" button in the toolbar of the preview interface and selects "Horizontal Compression Strategy" from the pop-up option list. The system determines the target retention area based on the strategy selected by the user: since this strategy is a horizontal compression strategy, the system determines all remaining areas in the preview bitmap other than the three marked deletion areas as the target retention areas, that is, the avatars, usernames, chat text, and other content in the chat history that are not selected are all considered as the parts that need to be retained.
[0076] This embodiment introduces a deletion strategy selection mechanism, enabling users to flexibly define the target retention area according to actual needs. It supports both the retention of content outside the regular deletion area and the retention of content within the deletion area in the inverse selection mode, thus enriching the application scenarios of screenshot editing.
[0077] Optionally, the target retention area is processed according to geometric information to generate a target image, specifically including: when the deletion strategy is a background color filling strategy, determining the relative position of the deletion area in the preview bitmap according to the geometric information; and replacing the pixels in the deletion area with background color pixels based on the relative position to generate a target image.
[0078] In one possible embodiment, such as Figure 3 As shown, the user selected a background color fill strategy. The system reads the stored geometric information of the three deleted regions: region A (coordinates (50, 100), width 80, height 30), region B (coordinates (200, 150), width 100, height 40), and region C (coordinates (300, 250), width 60, height 60). By traversing the pixel data of the preview bitmap, the system locates the pixel range corresponding to each deleted region and modifies the RGB values of all these pixels to the preset background color value. For example, the three deleted regions are the chat avatar, verification code number, and name. The system modifies the RGB values of all pixels in the three deleted regions to the preset background color value (i.e., black RGB(0, 0, 0)). After modification, the original chat avatar, verification code number, and name in the preview bitmap are covered by black blocks, while other areas remain unchanged. The system outputs the modified bitmap as the target image.
[0079] This embodiment achieves complete coverage of sensitive content by directly replacing the pixels in the deleted area with the background color. Since the replacement operation is irreversible, it avoids the risk of image restoration that may exist with mosaic or image removal methods, thus improving the privacy and security of the screenshot content.
[0080] Optionally, when the deletion strategy is a horizontal compression strategy or a vertical compression strategy, the retention area located to the right or below the deletion area in the target retention area is determined according to geometric information; the retention area located to the right or below the deletion area is moved to the left or above so that the retention area is connected to the retention area to the left or above the deletion area; the invalid area formed after the movement is filled with background color pixels to generate the target image.
[0081] In one possible embodiment, such as Figure 4As shown, the user selected a horizontal compression strategy and marked a deletion region located in the center of the preview bitmap. The system reads the geometric information of this deletion region, obtaining the horizontal coordinates of its left and right boundaries. The system determines all content to be retained to the right of the deletion region within the target retention region. Each pixel of this content is moved horizontally to the left by a distance equal to the width of the deletion region (i.e., the horizontal coordinate of the boundary minus the horizontal coordinate of the left boundary), aligning the left boundary of the right-side content with the left boundary of the deletion region. After the movement, the original pixels of the deletion region are covered by the content moved from the right, while the rightmost pixels of the original right-side content that have moved beyond the preview bitmap boundary are discarded. The original right-side content leaves a blank area in its original position, which the system fills with the background color black. In the final generated target image, the deletion region is removed, the right-side content fills the gap to the left, and the overall image width remains unchanged.
[0082] In another possible embodiment, such as Figure 5 As shown, the user selected a vertical compression strategy. The system reads the geometric information of the deletion region, obtaining the y-axis coordinates of the upper and lower boundaries. The system determines all content below the deletion region within the target retention region and moves each pixel of this content upwards vertically by a distance equal to the height of the deletion region (i.e., the y-axis coordinate of the lower boundary minus the y-axis coordinate of the upper boundary), aligning the upper boundary of the content with the upper boundary of the deletion region. After the movement, the content below fills the position of the deletion region. Pixels at the bottom of the original content that moved out of the preview bitmap boundary are discarded, leaving a blank area in their original position. The system can then fill this blank area with the background color black. In the final generated target image, the deletion region is removed, the content below fills the gap upwards, and the overall image height remains unchanged.
[0083] Optionally, such as Figure 2 , Figure 6 and Figure 7 As shown, after the pixels that are moved out of the preview bitmap boundary are discarded, the remaining content can be directly stitched together, keeping only the required target area to generate the target image.
[0084] In this embodiment, black is used as the background color to illustrate the blank area. In practical applications, the background color can be set according to the image to improve the coherence and aesthetics of the image layout.
[0085] This embodiment achieves seamless compression of image content after the deletion area is removed by moving the retained content on one side of the deletion area toward the deletion area and filling it with the background color. This avoids gaps in the deletion area and maintains the continuity and aesthetics of the image layout.
[0086] Optionally, when the deletion strategy is the inverse selection retention strategy, the target retention regions are stitched together based on the coordinates of the upper left corner of the first target retention region in the target retention region to generate the target image.
[0087] In one possible embodiment, such as Figure 8 As shown, the user selected the inverse selection retention strategy and selected three areas to be retained in the preview bitmap, for example, area 1 (containing the person's portrait), area 2 (containing key text information), and area 3 (containing the QR code). The system determines the selected areas as the target retention areas and the other areas in the preview bitmap as deletion areas. The system reads the geometric information of the three retention areas, using the top-left corner coordinates of the area in the upper left of the preview bitmap (e.g., area 1) as the reference point, and places the pixel data of area 1 at the top-left corner of the newly created target bitmap; then, the pixel data of areas 2 and 3 are translated so that the horizontal axis coordinates of the left boundaries of areas 2 and 3 are consistent with the horizontal axis coordinates of the left boundary of area 1, and the vertical axis coordinates of the lower boundary of area 2 are consistent with the vertical axis coordinates of the upper boundary of area 3. After stitching, the system outputs the newly generated bitmap as the final target image.
[0088] This embodiment uses an inverse selection retention strategy, allowing users to simply select the content they want to keep. The system automatically extracts this content and stitches it together according to the reference position of the first retained area. This achieves the function of quickly extracting multiple key areas from the original screenshot and combining them into a new image, simplifying the complex operation of multiple screenshots and manual stitching in the traditional method.
[0089] Optionally, after generating the target image, the memory resources occupied by the preview bitmap are released.
[0090] This embodiment actively releases the memory occupied by the original preview bitmap after the target image is generated, avoiding the long-term residence of redundant data in memory during the screenshot process, reducing the device's memory consumption. It is especially suitable for scenarios with multiple consecutive screenshots, effectively avoiding device lag or application crashes caused by memory accumulation.
[0091] Optionally, after processing the target retention area based on geometric information, in response to data added by the user to the current bitmap, the added data is combined with the processed image to generate the final target image and output it.
[0092] The screenshot interaction method provided in this application generates a preview bitmap after the screenshot is triggered. The user directly selects the deletion area in the preview bitmap and records its geometric information. Based on the deletion strategy, the target retention area is determined. The target retention area is then composited into a bitmap based on the geometric information, ultimately outputting the target image. Users do not need to switch between screenshot tools and external image editing software, nor do they need to perform multiple screenshots and manual stitching operations on the same content, simplifying the operation steps in complex screenshot scenarios. Simultaneously, by directly removing the deletion area instead of using mosaic or image removal methods, the risk of information leakage due to image restoration technology is avoided, enhancing the privacy and security of the screenshot content. Furthermore, by supporting multiple deletion strategies such as background color filling, horizontal compression, vertical compression, and inverse selection retention, the screenshot processing needs in different scenarios are met, improving the efficiency and user experience of screenshot operations.
[0093] Figure 9 A schematic diagram of the interactive device for the screenshots provided in this application, as shown below. Figure 9 As shown, the interactive device 90 for taking screenshots provided in this embodiment includes:
[0094] The acquisition module 901 is used to acquire the screen display content and generate a preview bitmap in response to the screenshot trigger operation;
[0095] Processing module 902 is used to determine at least one deletion region in the preview bitmap and record the geometric information of each deletion region;
[0096] The processing module 902 is also used to determine the target retention area in the preview bitmap, process the target retention area according to geometric information, generate the target image and output it.
[0097] Optionally, the processing module 902 is also configured to determine multiple deletion areas in response to the operation of continuously dragging the selection box on the preview bitmap;
[0098] Determine the coordinates and dimensions of each deleted region in the preview bitmap, with the top-left corner of the preview bitmap as the origin.
[0099] Optionally, the acquisition module 901 is also used to acquire the deletion strategy selected by the user, including background color filling strategy, horizontal compression strategy, vertical compression strategy and inverse selection retention strategy;
[0100] The target retention area is determined based on the deletion strategy. When the deletion strategy is a background color filling strategy, a horizontal compression strategy, or a vertical compression strategy, the remaining area outside the deletion area is taken as the target retention area. When the deletion strategy is an inverse selection retention strategy, the deletion area is taken as the target retention area.
[0101] Optionally, the processing module 902 is further configured to determine the relative position of the deletion area in the preview bitmap based on geometric information when the deletion strategy is a background color fill strategy;
[0102] Based on relative position, pixels within the deleted area are replaced with background color pixels to generate the target image.
[0103] Optionally, the processing module 902 is further configured to determine, based on geometric information, the retention area located to the right or below the deletion area in the target retention area when the deletion strategy is a horizontal compression strategy or a vertical compression strategy;
[0104] Move the retained area located to the right or below the deleted area to the left or above, so that the retained area is connected to the retained area to the left or above the deleted area;
[0105] The target image is generated by filling the invalid areas created after the movement with background color pixels.
[0106] Optionally, the processing module 902 is further configured to, when the deletion strategy is the inverse selection retention strategy, stitch together each target retention region based on the coordinates of the upper left corner of the first target retention region in the target retention region to generate a target image.
[0107] Optionally, the processing module 902 is also used to release the memory resources occupied by the preview bitmap after the target image is generated.
[0108] The interactive device for taking screenshots provided in this embodiment can execute the methods provided in the above method embodiments. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0109] Figure 10 A schematic diagram of the structure of the electronic device provided in this application. Figure 10 As shown, the electronic device 100 provided in this embodiment includes at least one processor 1001 and a memory 1002. Optionally, the device 100 further includes a communication component 1003. The processor 1001, memory 1002, and communication component 1003 are connected via a bus 1004.
[0110] In a specific implementation, at least one processor 1001 executes computer execution instructions stored in memory 1002, causing at least one processor 1001 to perform the above-described method.
[0111] The specific implementation process of processor 1001 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0112] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0113] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0114] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0115] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0116] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0117] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0118] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0119] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0120] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0121] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0122] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0123] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0124] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. An interactive method for taking screenshots, characterized in that, include: In response to a screenshot trigger, the screen display content is captured and a preview bitmap is generated; At least one deletion region is identified in the preview bitmap, and the geometric information of each deletion region is recorded; The target area to be preserved in the preview bitmap is determined, and the target area is processed according to the geometric information to generate and output the target image.
2. The method according to claim 1, characterized in that, At least one deletion region is determined in the preview bitmap, and the geometric information of each deletion region is recorded, specifically including: In response to the operation of continuously dragging a selection box on the preview bitmap, multiple deletion areas are determined; The coordinate information and size information of each deleted region in the preview bitmap are determined respectively, wherein the coordinate information is based on the upper left corner of the preview bitmap as the origin.
3. The method according to claim 1, characterized in that, Determining the target reserved area in the preview bitmap specifically includes: Obtain the deletion strategy selected by the user, which includes background color filling strategy, horizontal compression strategy, vertical compression strategy, and inverse selection retention strategy; The target retention area is determined according to the deletion strategy. When the deletion strategy is a background color filling strategy, a horizontal compression strategy, or a vertical compression strategy, the remaining area outside the deletion area is taken as the target retention area. When the deletion strategy is an inverse selection retention strategy, the deletion area is taken as the target retention area.
4. The method according to claim 1, characterized in that, The target preservation region is processed based on the geometric information to generate a target image, specifically including: When the deletion strategy is a background color fill strategy, the relative position of the deletion area in the preview bitmap is determined based on the geometric information; Based on the relative position, the pixels in the deleted area are replaced with background color pixels to generate the target image.
5. The method according to claim 4, characterized in that, Also includes: When the deletion strategy is a horizontal compression strategy or a vertical compression strategy, the retention area located to the right or below the deletion area in the target retention area is determined according to the geometric information; Move the reserved area located to the right or below the deleted area to the left or above, so that the reserved area is connected to the reserved area to the left or above the deleted area; The target image is generated by filling the invalid areas formed after the movement with background color pixels.
6. The method according to claim 4, characterized in that, Also includes: When the deletion strategy is the reverse selection retention strategy, the target image is generated by stitching together the target retention regions based on the coordinates of the upper left corner of the first target retention region in the target retention region.
7. The method according to claim 1, characterized in that, Also includes: After generating the target image, release the memory resources occupied by the preview bitmap.
8. An interactive device for taking screenshots, characterized in that, include: The acquisition module is used to respond to screenshot triggering operations, acquire the screen display content and generate a preview bitmap; A processing module is configured to determine at least one deletion region in the preview bitmap and record the geometric information of each deletion region; The processing module is further configured to determine the target retention area in the preview bitmap, process the target retention area according to the geometric information, generate a target image, and output it.
9. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-7.
11. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-7.