Image interception method and device based on interface window area and electronic equipment
Through API functions, the display content of the interface window is stored and spliced, and combined with the area identification box of the penetrating window, the problem of incomplete screenshots of the interface window is solved, achieving efficient complete screenshots.
Patent Information
- Application Number
- CN202510250298.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-04
- Publication Date
- 2025-06-20
AI Technical Summary
The prior art cannot completely intercept all display content in the interface window area, resulting in low image interception efficiency.
The display content of the target window is stored through API functions, and the area identification box is displayed in a penetrating window outside the screenshot area, allowing the user to adjust the screenshot area to contain all the content, and finally splice the screenshot picture into a complete screenshot.
It realizes a complete screenshot of the interface window area, improves image interception efficiency, and avoids the problem of not being able to save all display content due to too much window content.
Smart Images

Figure CN120179337A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of interface interaction, and in particular, to an image capture method, device, and electronic device based on an interface window area. Background Art
[0002] Currently, the graphical interfaces of the systems or applications of Windows and Mac computers generally display content to users through "windows". If there is a large amount of content to be displayed in a window and it cannot be fully displayed within the visible area of the window, users will be allowed to scroll up or down the scroll bar to display more content.
[0003] When it is necessary to capture the content displayed in the window and save it as an image, only the image content of the displayed area of the window can be obtained, and the complete content displayed by the window cannot be obtained. The current screen capture functions built into the Windows and Mac computer systems, or third-party screen capture software, cannot completely capture all the displayed content of the window including the invisible area, that is, cannot be completely saved as a picture. Therefore, the current image capture efficiency of the interface window area is relatively low. Summary of the Invention
[0004] The purpose of the present invention is to provide an image capture method, device, and electronic device based on an interface window area to solve the technical problem of relatively low image capture efficiency in the interface window area.
[0005] In a first aspect, the present application provides an image capture method based on an interface window area, and the method includes:
[0006] In response to an open operation on a target window, display the target window in the graphical user interface;
[0007] In response to a first selection operation on the corresponding display area of the target window, set the target display area selected corresponding to the first selection operation as a first screenshot area;
[0008] Store the display content within the first screenshot area as a first screenshot picture through an Application Programming Interface (API) function, and display a region identification frame in a penetrable window manner outside the first screenshot area with a specified transparency; wherein, the region identification frame is used to identify the first screenshot area;
[0009] In response to an update operation on the corresponding display content of the target window, display the newly updated display content corresponding to the update operation in the first screenshot area;
[0010] In response to a second selection operation on the corresponding display area of the target window, determine, according to the second selection operation, to use the first screenshot area or the newly changed second screenshot area as the target screenshot area;
[0011] Store the display content within the target screenshot area as a second screenshot image;
[0012] Sequentially splice all the screenshot images including the first screenshot image and the second screenshot image to obtain a first spliced result image, and store the first spliced result image as a complete screenshot image of the corresponding display content of the target window.
[0013] In a possible implementation, storing the display content within the first screenshot area as a first screenshot image through an API function, and displaying a region identification frame outside the first screenshot area in a penetrable window manner with a specified transparency includes:
[0014] Store the display content within the first screenshot area as a first screenshot image through an API function, and determine whether there is any other content to be screenshot in the target window other than the first screenshot image;
[0015] If there is any other content to be screenshot in the target window other than the first screenshot image, display a region identification frame outside the first screenshot area in a penetrable window manner with a specified transparency.
[0016] In a possible implementation, after determining whether there is any other content to be screenshot in the target window other than the first screenshot image, the method further includes:
[0017] If there is no other content to be screenshot in the target window other than the first screenshot image, sequentially splice all the screenshot images including the first screenshot image to obtain a second spliced result image, and store the second spliced result image as a complete screenshot image of the corresponding display content of the target window.
[0018] In a possible implementation, after storing the display content within the first screenshot area as a first screenshot image through the API function, repeatedly execute the following steps until all the display content corresponding to the target window is respectively stored as screenshot images:
[0019] Display a region identification frame outside the first screenshot area in a penetrable window manner with a specified transparency;
[0020] In response to an update operation on the corresponding display content of the target window, display the newly updated display content corresponding to the update operation in the first screenshot area;
[0021] In response to a second selection operation on the corresponding display area of the target window, determine, according to the second selection operation, to use the first screenshot area or the newly changed second screenshot area as the target screenshot area;
[0022] Store the display content within the target screenshot area as a second screenshot image.
[0023] In a possible implementation, the area identification frame is a semi-transparent rectangular frame that does not respond to any operations.
[0024] In a possible implementation, the graphical user interface is provided by a terminal device; if the terminal device corresponds to a Mac system, the area identification frame is implemented by setting the ignoresMouseEvents property to true; if the terminal device corresponds to a Windows system, the area identification frame is implemented by setting WS_EX_TRANSPARENT;
[0025] The background color of the area identification frame is set to a transparent color value defined in RGBA format with any Alpha channel being 0, and the Alpha channel value of the color value used when drawing the foreground color is set to be less than 128.
[0026] In a possible implementation, the graphical user interface is provided by a terminal device, and the API function is provided by the Mac system corresponding to the terminal device.
[0027] In a second aspect, the present application provides an image capture method device based on an interface window area, including:
[0028] A first display module, configured to display the target window in a graphical user interface in response to an open operation on the target window;
[0029] A setting module, configured to set the target display area selected by the first selection operation as the first screenshot area in response to a first selection operation on the corresponding display area of the target window;
[0030] A first storage module, configured to store the display content within the first screenshot area as a first screenshot image through an API function, and display an area identification frame in a penetrable window manner outside the first screenshot area with a specified transparency; wherein, the area identification frame is used to identify the first screenshot area;
[0031] A second display module, configured to display the newly updated display content corresponding to the update operation in the first screenshot area in response to an update operation on the corresponding display content of the target window;
[0032] A determination module, configured to, in response to a second selection operation on a corresponding display area of the target window, determine the first screenshot area or a new second screenshot area after change as the target screenshot area according to the second selection operation;
[0033] A second storage module, configured to store the display content within the target screenshot area as a second screenshot picture;
[0034] A splicing module, configured to splice all the screenshot pictures including the first screenshot picture and the second screenshot picture in sequence to obtain a first spliced result picture, and store the first spliced result picture as a complete screenshot picture of the corresponding display content of the target window.
[0035] In a third aspect, the present application further provides an electronic device, including a memory and a processor. A computer program that can run on the processor is stored in the memory. When the processor executes the computer program, the method described in the first aspect above is implemented.
[0036] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and run by the processor, the computer-executable instructions cause the processor to run the method described in the first aspect above.
[0037] The present application brings the following beneficial effects:
[0038] An image capture method, device, and electronic device based on an interface window area provided by the present application can respond to an open operation on a target window and display the target window in a graphical user interface; respond to a first selection operation on the corresponding display area of the target window, and set the target display area selected by the first selection operation as the first screenshot area; store the display content within the first screenshot area as a first screenshot image through an API function, and display a region identification frame in a way that can penetrate the window outside the first screenshot area with a specified transparency; wherein the region identification frame is used to identify the first screenshot area; respond to an update operation on the corresponding display content of the target window, and display the newly updated display content corresponding to the update operation in the first screenshot area; respond to a second selection operation on the corresponding display area of the target window, and determine the first screenshot area or the newly changed second screenshot area as the target screenshot area according to the second selection operation; store the display content within the target screenshot area as a second screenshot image; sequentially splice all the screenshot images including the first screenshot image and the second screenshot image to obtain a first spliced result image, and store the first spliced result image as a complete screenshot image of the corresponding display content of the target window. In this solution, for the situation where there are many display contents corresponding to the target window, resulting in a computer window that cannot be fully displayed (i.e., the window content cannot be directly and fully captured), the user can operate the content in the window display area by himself / herself and appropriately adjust the screenshot area, so as to completely save all the display contents of the window as one image, achieving a complete screenshot of the interface window area, thereby improving the image capture efficiency of the interface window area, avoiding the problem that when there are many window contents and there are invisible contents, all the display contents of the window cannot be saved as a picture, and solving the technical problem of low image capture efficiency in the interface window area.
[0039] To make the above objects, features, and advantages of the present application more obvious and understandable, the following specifically enumerates preferred embodiments and, in conjunction with the accompanying drawings, makes a detailed description as follows. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] To more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the specific embodiments or the prior art. Obviously, the following drawings are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0041] Figure 1 It is a schematic flowchart of an image capture method based on an interface window area provided by an embodiment of the present application;
[0042] Figure 2 Another schematic flowchart of the image capture method based on the interface window area provided by the embodiment of the present application;
[0043] Figure 3 Schematic structural diagram of an image capture device based on the interface window area provided by the embodiment of the present application;
[0044] Figure 4 Schematic structural diagram of an electronic device provided by the embodiment of the present application is shown. Detailed implementation manners
[0045] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the present application will be clearly and completely described below with reference to the accompanying drawings. Apparently, the described embodiments are some but not all of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the protection scope of the present application.
[0046] As used in the embodiments of the present application, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes other steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products or devices.
[0047] Currently, if there is a large amount of content to be displayed in an interface window and it cannot be fully displayed within the visible area of the window, the user has to scroll up or down the scroll bar to display more content, resulting in low efficiency of image capture in the current interface window area.
[0048] Based on this, the embodiments of the present application provide an image capture method, device and electronic device based on the interface window area, and through this method, the technical problem of low efficiency of image capture in the current interface window area can be solved.
[0049] The embodiments of the present invention will be further introduced below with reference to the accompanying drawings.
[0050] Figure 1 Schematic flowchart of an image capture method based on the interface window area provided by the embodiment of the present application. As Figure 1 shown, the method includes:
[0051] Step S110, in response to an open operation on a target window, display the target window in the graphical user interface.
[0052] In a possible implementation manner, as Figure 2As shown, the user opens the target window and places the display area of the target window within the display range of the computer screen.
[0053] Step S120: In response to a first selection operation on the display area corresponding to the target window, set the target display area selected by the first selection operation as the first screenshot area.
[0054] As a possible implementation, as Figure 2 shown, the user selects the display area of the target window. For example, a rectangular area is set as the screenshot area.
[0055] Step S130: Store the display content within the first screenshot area as a first screenshot image through an API function, and display a region identification frame in a non - blocking window manner with a specified transparency outside the first screenshot area.
[0056] Among them, the region identification frame is used to identify the first screenshot area. As an alternative implementation, the region identification frame is a semi - transparent rectangular frame that does not respond to any operations. Exemplarily, the above - mentioned graphical user interface is provided by a terminal device. If the terminal device corresponds to a Mac system, the region identification frame is implemented by setting the ignoresMouseEvents property to true; if the terminal device corresponds to a Windows system, the region identification frame is implemented by setting WS_EX_TRANSPARENT; the background color of the region identification frame is set to a transparent color value defined in RGBA format with any Alpha channel being 0, and the Alpha channel value of the color value used when drawing the foreground color is set to be less than 128.
[0057] In an alternative implementation, a semi - transparent rectangular frame that does not respond to mouse and keyboard operations and basically does not affect the user's view of the screen content is displayed in a non - blocking window manner outside the screenshot area to identify the current screenshot area and prevent deviation in the captured content due to user operation errors. The ways to implement this feature of the rectangular frame can include: setting the extended type of the window to have WS_EX_TRANSPARENT; setting the background color of the window to a transparent color value (a color value defined in RGBA format with any Alpha channel being 0), and when drawing the foreground color, setting the Alpha channel value of the used color value (in RGBA format) to be less than 128.
[0058] It should be noted that API (Application Programming Interface) functions are some predefined functions. In addition to coordinating the execution of applications, memory allocation, and system resource management, the operating system is also a large service center. Invoking various services of this service center (each service is a function) can help applications achieve the purpose of opening windows, drawing graphics, and using peripheral devices.
[0059] In the embodiment of the present application, the graphical user interface in the above step S110 is provided by the terminal device. As an example, the API functions in this step are provided by the Mac system corresponding to the terminal device. In this step, the API functions provided by the computer system, such as Figure 2 shown, save the display content in this area as the first picture.
[0060] In some embodiments, storing the display content in the first screenshot area as the first screenshot picture through the API function and displaying a region identification frame with a specified transparency in a penetrable window manner outside the first screenshot area may include the following steps:
[0061] Store the display content in the first screenshot area as the first screenshot picture through the API function, and determine whether the target window corresponds to other content to be screenshot except the first screenshot picture; if the target window corresponds to other content to be screenshot except the first screenshot picture, then display a region identification frame with a specified transparency in a penetrable window manner outside the first screenshot area.
[0062] Such as Figure 2 shown, if there is more content, that is, the target window corresponds to other content to be screenshot except the first screenshot picture, then update the content of the screenshot area and save the new content as pictures respectively. By determining whether there is more content, that is, determining whether the target window corresponds to other content to be screenshot except the first screenshot picture, the screenshot operation efficiency can be improved.
[0063] After determining whether the target window corresponds to other content to be screenshot except the first screenshot picture, the method may further include the following steps: if the target window does not correspond to other content to be screenshot except the first screenshot picture, then splice all the screenshot pictures including the first screenshot picture in sequence to obtain a second spliced result picture, and store the second spliced result picture as the complete screenshot picture for the display content corresponding to the target window.
[0064] Such as Figure 2As shown, if there is no more content, that is, the target window does not correspond to other content to be captured except the first screenshot image, then all the images are directly merged into a large image in sequence. By this processing method, unnecessary operation steps can be saved.
[0065] Step S140, in response to an update operation for the display content corresponding to the target window, display the updated new display content corresponding to the update operation in the first screenshot area.
[0066] As an optional implementation manner, the user uses operation methods such as scrolling the scroll bar to update the display content of the target window, as Figure 2 shown, and display the new content in the screenshot area.
[0067] Step S150, in response to a second selection operation for the display area corresponding to the target window, determine the first screenshot area or the new second screenshot area after change as the target screenshot area according to the second selection operation.
[0068] As Figure 2 shown, the user selects the screenshot area again, and by default, the currently set screenshot area is used, or the screenshot area can be changed as needed.
[0069] Step S160, store the display content in the target screenshot area as a second screenshot image.
[0070] In an optional implementation manner, as Figure 2 shown, save the display content in the screenshot area as a new image.
[0071] Step S170, splice all the screenshot images including the first screenshot image and the second screenshot image in sequence to obtain a first spliced result image, and store the first spliced result image as a complete screenshot image for the display content corresponding to the target window.
[0072] In practical applications, as Figure 2 shown, splice and save all the images in sequence as a new image, that is, complete the complete screenshot of the display content in the window.
[0073] In the embodiments of the present application, in the case where there is a computer window with a large amount of display content corresponding to the target window, resulting in incomplete display (i.e., the window content cannot be directly and completely captured), the user can operate the content in the window display area by himself / herself and appropriately adjust the capture area, so as to completely save all the display content of the window as a single picture, realizing the complete capture of the interface window area, solving the problem that when there is a large amount of window content and there is invisible content, all the display content of the window cannot be saved as a picture. Moreover, by appropriately adjusting the capture area, the accuracy of the picture content can also be ensured, ensuring that the final result meets the user's requirements. This function can be applied to the screenshot software of the computer to realize the screenshot function for such windows.
[0074] The above steps will be introduced in detail below.
[0075] In some embodiments, after storing the display content in the first capture area as the first capture picture through the API function, the following steps are repeatedly executed until all the display content corresponding to the target window is respectively stored as capture pictures:
[0076] Outside the first capture area, a region identification frame is displayed through a penetrable window in a specified transparency; in response to an update operation for the display content corresponding to the target window, the updated new display content corresponding to the update operation is displayed in the first capture area; in response to a second selection operation for the display area corresponding to the target window, the first capture area or the newly changed second capture area is determined as the target capture area according to the second selection operation; the display content in the target capture area is stored as the second capture picture.
[0077] As an optional implementation manner, as Figure 2 shown, before sequentially splicing all the capture pictures, the above steps from displaying a region identification frame through a penetrable window in a specified transparency outside the first capture area in step S130 to the above step S160 are repeated until all the display content of the window is respectively saved as pictures. Through this processing method, the omission of the content to be displayed in the target window can be avoided, ensuring that all the content to be displayed included in the target window can be saved to the picture to ensure the integrity of the final capture picture.
[0078] Figure 3 A schematic structural diagram of an image capture device based on an interface window area is provided. As Figure 3 shown, the image capture device 300 based on the interface window area includes:
[0079] A first display module 301, configured to display the target window in the graphical user interface in response to an open operation for the target window;
[0080] A setting module 302, configured to set the target display area selected corresponding to the first selection operation as the first screenshot area in response to the first selection operation for the corresponding display area of the target window;
[0081] A first storage module 303, configured to store the display content within the first screenshot area as a first screenshot image through an API function, and display a region identification frame in a penetrable window manner outside the first screenshot area with a specified transparency; wherein, the region identification frame is used to identify the first screenshot area;
[0082] A second display module 304, configured to display the newly updated display content corresponding to the update operation in the first screenshot area in response to the update operation for the corresponding display content of the target window;
[0083] A determination module 305, configured to determine, in response to the second selection operation for the corresponding display area of the target window, to use the first screenshot area or the newly changed second screenshot area as the target screenshot area according to the second selection operation;
[0084] A second storage module 306, configured to store the display content within the target screenshot area as a second screenshot image;
[0085] A splicing module 307, configured to splice all the screenshot images including the first screenshot image and the second screenshot image in sequence to obtain a first spliced result image, and store the first spliced result image as a complete screenshot image for the corresponding display content of the target window.
[0086] The image capture device based on the interface window area provided by the embodiments of the present application has the same technical features as the image capture method based on the interface window area provided by the above embodiments, so it can also solve the same technical problems and achieve the same technical effects.
[0087] An electronic device provided by an embodiment of the present application, such as Figure 4 shown, the electronic device 400 includes a processor 402 and a memory 401. A computer program that can run on the processor is stored in the memory. When the processor executes the computer program, the steps of the method provided by the above embodiments are implemented.
[0088] See Figure 4 , the electronic device further includes: a bus 403 and a communication interface 404. The processor 402, the communication interface 404, and the memory 401 are connected through the bus 403; the processor 402 is configured to execute an executable module stored in the memory 401, such as a computer program.
[0089] Among them, the memory 401 may include high-speed random access memory (RAM), and may also include non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 404 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used.
[0090] The bus 403 can be an ISA bus, a PCI bus, an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 4 only a bidirectional arrow is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0091] Among them, the memory 401 is used to store programs. After receiving the execution instruction, the processor 402 executes the programs. The methods executed by the devices defined by the processes disclosed in any embodiment of the present application can be applied to or implemented by the processor 402.
[0092] The processor 402 may be an integrated circuit chip with the ability to process signals. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in the processor 402 or the instructions in the form of software. The above-mentioned processor 402 may be a general-purpose processor, including a central processing unit (CPU for short), a network processor (NP for short), etc.; it may also be a digital signal processor (DSP for short), an application specific integrated circuit (ASIC for short), a field-programmable gate array (FPGA for short), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of the hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory 401, and the processor 402 reads the information in the memory 401 and combines its hardware to complete the steps of the above method.
[0093] Corresponding to the above image capture method based on the interface window area, an embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and run by a processor, the computer-executable instructions cause the processor to run the steps of the above image capture method based on the interface window area.
[0094] The image capture device based on the interface window area provided by the embodiments of the present application may be specific hardware on the device or software or firmware installed on the device, etc. For the device provided by the embodiments of the present application, the implementation principle and the technical effects generated are the same as those of the foregoing method embodiments. For the sake of brief description, for the parts not mentioned in the device embodiments, reference may be made to the corresponding content in the foregoing method embodiments. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can all refer to the corresponding processes in the above method embodiments, and will not be repeated here.
[0095] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For another example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the couplings or direct couplings or communication connections shown or discussed with each other can be through some communication interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical or other forms.
[0096] For another example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each block in the flowchart or block diagram can represent a module, a program segment or a part of code, and the module, program segment or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order from that marked in the accompanying drawings. For example, two consecutive blocks can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, as well as the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0097] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place, or can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0098] In addition, the functional units in the embodiments provided in the present application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.
[0099] When the above-mentioned function is implemented in the form of 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 application, in essence, or the part that contributes to the prior art, or a part of this 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 for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the image capture method based on the interface window area described in various embodiments of this application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM for short), random access memories (RAM for short), magnetic disks, or optical discs that can store program codes.
[0100] It should be noted that: similar reference numerals and letters represent similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. In addition, the terms "first", "second", "third", etc. are only used for descriptive distinction and cannot be understood as indicating or implying relative importance.
[0101] Finally, it should be noted that: the above-mentioned embodiments are only specific implementation manners of this application, used to illustrate the technical solution of this application, rather than limiting it. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: any person skilled in the art within the technical scope disclosed in this application can still modify the technical solutions recorded in the foregoing embodiments or can easily think of changes, or make equivalent replacements for some of the technical features; and these modifications, changes, or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of this application. All should be covered within the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
Claims
1. A method for capturing an image based on an interface window area, characterized in that: The method comprises: In response to an opening operation on a target window, displaying the target window in a graphical user interface; In response to a first selection operation on a display area corresponding to the target window, setting the target display area selected corresponding to the first selection operation as a first screenshot area; The displayed content in the first screenshot area is stored as a first screenshot image through an API function, and an area identification frame is displayed outside the first screenshot area with a specified transparency through a transparent window; wherein the area identification frame is used to identify the first screenshot area; In response to an update operation on the display content corresponding to the target window, displaying the corresponding updated new display content in the first screenshot area; In response to a second selection operation on the display area corresponding to the target window, determining, according to the second selection operation, to use the first screenshot area or the modified new second screenshot area as a target screenshot area; storing the displayed content in the target screenshot area as a second screenshot image; All screenshot images including the first screenshot image and the second screenshot image are stitched together in sequence to obtain a first stitching result image, and the first stitching result image is stored as a complete screenshot image for the display content corresponding to the target window.
2. The image capture method based on the interface window area according to claim 1, characterized in that: The method of storing the display content in the first screenshot area as a first screenshot image through an API function, and displaying an area identification frame with a specified transparency outside the first screenshot area through a transparent window, includes: The displayed content in the first screenshot area is stored as a first screenshot image through an API function, and it is determined whether the target window corresponds to other contents to be screenshotted except the first screenshot image; If the target window corresponds to other to-be-screenshot contents except the first screenshot image, an area identification frame is displayed with a specified transparency outside the first screenshot area in a transparent window manner.
3. The image capture method based on the interface window area according to claim 2, characterized in that: After determining whether the target window corresponds to other content to be screenshotted except the first screenshot picture, the method further includes: If the target window does not correspond to any other content to be screenshotted except the first screenshot image, all screenshot images including the first screenshot image are stitched together in sequence to obtain a second stitching result image, and the second stitching result image is stored as a complete screenshot image for the display content corresponding to the target window.
4. The image capture method based on the interface window area according to claim 1, characterized in that: After the display content in the first screenshot area is stored as a first screenshot image through the API function, the following steps are repeatedly performed until all display contents corresponding to the target window are stored as screenshot images respectively: Displaying the area identification frame at a specified transparency outside the first screenshot area through a transparent window; In response to an update operation on the display content corresponding to the target window, displaying the corresponding updated new display content in the first screenshot area; In response to a second selection operation on the display area corresponding to the target window, determining, according to the second selection operation, to use the first screenshot area or the modified new second screenshot area as a target screenshot area; The displayed content in the target screenshot area is stored as a second screenshot image.
5. The image capture method based on the interface window area according to claim 1, characterized in that: The area identification frame is a semi-transparent rectangular frame that does not respond to any operation.
6. The image capture method based on the interface window area according to claim 5, characterized in that: The graphical user interface is provided by a terminal device; if the terminal device corresponds to a Mac system, the area identification frame is implemented by setting the ignoresMouseEvents property to true; if the terminal device corresponds to a Windows system, the area identification frame is implemented by setting WS_EX_TRANSPARENT; The background color of the area identification frame is set to a transparent color value defined in RGBA format with any Alpha channel being 0, and the value of the Alpha channel of the color value used when drawing the foreground color is set to be less than 128.
7. The image capture method based on the interface window area according to claim 1, characterized in that: The graphical user interface is provided by a terminal device, and the API function is provided by a Mac system corresponding to the terminal device.
8. A method and device for capturing an image based on an interface window area, characterized in that: include: A first display module, configured to display the target window in a graphical user interface in response to an opening operation on the target window; A setting module, configured to, in response to a first selection operation on a display area corresponding to the target window, set the target display area selected corresponding to the first selection operation as a first screenshot area; A first storage module, used to store the display content in the first screenshot area as a first screenshot image through an API function, and to display an area identification frame with a specified transparency outside the first screenshot area through a transparent window; wherein the area identification frame is used to identify the first screenshot area; A second display module, in response to an update operation on the display content corresponding to the target window, displays the updated new display content corresponding to the update operation in the first screenshot area; a determination module, configured to respond to a second selection operation on a display area corresponding to the target window and determine, according to the second selection operation, to use the first screenshot area or the modified new second screenshot area as a target screenshot area; A second storage module, used to store the display content in the target screenshot area as a second screenshot image; The splicing module is used to sequentially splice all the screenshot images including the first screenshot image and the second screenshot image to obtain a first splicing result image, and store the first splicing result image as a complete screenshot image corresponding to the display content of the target window.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to execute the method according to any one of claims 1 to 7.