A screen capturing method and device
By configuring the interaction attribute of the input box view to be hidden to an interaction-disabled state, and utilizing the operating system's recognition capabilities to hide the content, the problem of leakage of sensitive and private data in screen capture is solved, and efficient data protection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI ZHONG YUAN NETWORK CO LTD
- Filing Date
- 2026-03-17
- Publication Date
- 2026-06-19
AI Technical Summary
In existing technologies, screen capture methods cannot effectively hide sensitive and private data, resulting in a high risk of data leakage.
By identifying the input box view to be hidden and configuring its interaction attributes to an interaction-disabled state, the operating system's recognition capabilities are utilized to wrap the input box view into a content display box, perform content hiding processing, and generate screen capture results.
It effectively hides sensitive and private data during screen capture, improving data security and collection efficiency, and preventing data leakage.
Smart Images

Figure CN122241782A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data security technology, and in particular to a screen capture method and apparatus. Background Technology
[0002] With the development of smart terminals, more and more data is being displayed and collected through them. During data interaction via smart terminals, users often capture the screen—that is, the content displayed on the screen—to improve the convenience of subsequent data access and avoid repeated application access; for example, by taking screenshots or recording the screen. However, after capturing the screen content, users may share it, leading to the leakage of sensitive or private data, thus affecting data security.
[0003] Currently, some smart terminals can set up a secure text input area, which allows the operating system to hide the content displayed in the secure text input area when it detects screen capture, thus preventing the collection and dissemination of the content displayed in the secure text input area and the spread of privacy data. However, the above-mentioned setting of a secure text input area can only hide the content entered by the user. It still cannot effectively hide sensitive data and privacy data that are not entered by the user. Summary of the Invention
[0004] The purpose of this invention is to provide a screen capture method and apparatus to solve the problem of privacy data leakage caused by screen capture.
[0005] In a first aspect of this invention, a screen capture method is provided, comprising: Obtain screen capture instructions; Based on the screen capture command, the view hierarchy information of the current screen display view is traversed to obtain the input box view to be hidden in the current screen display view; the interaction attribute of the input box view to be hidden is configured to an interaction-disabled state; The content displayed within the display area corresponding to the input box view to be hidden is hidden to obtain the target display content; Based on the target display content, screen capture results are generated.
[0006] In a second aspect of the invention, a screen capture device is also provided, comprising: The acquisition unit is used to acquire screen capture commands; The processing unit is configured to traverse the view hierarchy information of the current screen display view based on the screen capture instruction, and obtain the input box view to be hidden in the current screen display view; the interaction attribute of the input box view to be hidden is configured to an interaction-disabled state; The processing unit is also used to perform content hiding processing on the display content in the display area corresponding to the input box view to be hidden, so as to obtain the target display content; The processing unit is also used to generate screen capture results based on the target display content.
[0007] In another aspect of the present invention, an electronic device is also provided, comprising: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory is used to store computer programs; and the processor is used to implement any of the screen capture methods described above when executing the programs stored in the memory.
[0008] In another aspect of the present invention, a computer-readable storage medium is also provided, wherein instructions are stored therein, which, when executed on a computer, cause the computer to perform any of the screen capture methods described above.
[0009] In another aspect of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the screen capture methods described above.
[0010] In practical applications, during screen capture, the operating system can identify secure text input areas (i.e., secure text input boxes) where isSecureTextEntry(is secure text input) = true and hide the input content therein. The screen capture method provided in this invention sets secure text input boxes that the operating system recognizes as requiring content hiding to an interactive disabled state. This encapsulates the secure text input box as a "content display box" that the operating system recognizes as requiring content hiding during screen capture. This allows the content displayed in this "content display box" to be hidden during screen capture. Thus, the input content hiding function of the secure text input box is applied to the display content hiding function. During screen capture, the operating system can recognize the custom content as the same secure view as the secure text input box, thereby achieving the hiding of sensitive and / or private data displayed therein. In the specific execution process, during screen capture, the view hierarchy information of the current screen display view is traversed based on the screen capture command to obtain the input box views to be hidden whose interaction attributes are configured to be disabled. Then, the display content corresponding to the input box views to be hidden is hidden to obtain the target display content. Finally, the screen capture result is generated based on the target display content. In this way, during the screen capture process, the display content in the input box views to be hidden, which are packaged as "content display boxes", is hidden. By packaging the secure text input box as a content display box that does not require interaction, the content display box can both display custom privacy data and / or sensitive data, and can also be recognized by the operating system as a secure text input box that needs to be hidden during screen capture. This achieves the hiding of custom privacy data and / or sensitive data during screen capture without modifying the operating system's recognition capabilities, and also improves the efficiency and convenience of hiding custom privacy data and / or sensitive data during screen capture. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0012] Figure 1 This is a flowchart of the screen capture method steps provided in an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the process of generating a view template for an input box to be hidden, as provided in an embodiment of the present invention. Figure 3 This is a schematic diagram illustrating the process of generating the input box view to be hidden, as provided in an embodiment of the present invention. Figure 4 This is a schematic diagram of a screen capture process applied to a screenshot scenario, provided as an embodiment of the present invention. Figure 5 This is a schematic diagram of a screen capture process applied in a screen recording scenario, provided by an embodiment of the present invention. Figure 6 This is a schematic diagram of the screen capture device provided in an embodiment of the present invention; Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0013] The technical solutions of the embodiments of the present invention will now be described with reference to the accompanying drawings. It should be noted that, unless otherwise specified, the embodiments and features of the present invention can be combined with each other.
[0014] Numerous specific details are set forth in the following description in order to provide a full understanding of the invention, but the invention may also be practiced in other ways different from those described herein. Obviously, the embodiments in the specification are only some, not all, of the embodiments of the invention.
[0015] In embodiments of the present invention, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" or "for example" in embodiments of the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner. Furthermore, in the description of embodiments of the present invention, unless otherwise stated, "a plurality of" means two or more.
[0016] Reference Figure 1 As shown, the screen capture method provided in this embodiment of the invention specifically includes the following steps S101 to S104.
[0017] Step S101: Obtain screen capture command.
[0018] In practice, the screen capture command is first obtained. In this embodiment, the screen capture command can be a screenshot command or a screen recording command; this embodiment does not limit the specific command.
[0019] Step S102: Based on the screen capture command, traverse the view hierarchy information of the current screen display view to obtain the input box view to be hidden in the current screen display view.
[0020] In practice, after receiving the screen capture command, the view hierarchy information of the current screen display view is traversed based on the screen capture command to obtain the input box view to be hidden in the current screen display view.
[0021] In this embodiment, the current screen display view includes the view corresponding to the currently displayed content on the screen. Specifically, the current screen display view can be the display view of the application currently running on the terminal; for example, if the current screen displays the video playback interface of a video playback application, the current screen display view is the view corresponding to the video playback interface of the video playback application; as another example, if the current screen displays the authentication interface of an authentication application, the current screen display view is the view corresponding to the authentication node of the authentication application. The view hierarchy information in this embodiment includes view hierarchy information between at least one currently displayed view. It should be noted that the view hierarchy information of the currently displayed view can be a view hierarchy tree of the currently displayed view.
[0022] In this embodiment, the input box view to be hidden includes the view corresponding to the input box whose hiding type is the type to be hidden. For example, if the isSecureTextEntry (whether it is secure text input) of the input box is set to true, it means that the hiding type of the input box view corresponding to the input box is the type to be hidden, that is, the input box view corresponding to the input box is the input box view to be hidden. That is, the process of traversing the view hierarchy information of the currently displayed view to obtain the input box view to be hidden in the currently displayed view can be to traverse the view hierarchy information of the currently displayed view to obtain the input box view of the type to be hidden in the currently displayed view as the input box view to be hidden.
[0023] It should be noted that the input box view to be hidden in this embodiment can be an input box view whose interaction attribute is configured to be in an interaction-admission state. When the interaction attribute of the input box view to be hidden is configured to be in an interaction-admission state, the user can see the cursor in the input box view to be hidden on the screen and can enter data based on the input box view to be hidden; optionally, when the interaction attribute of the input box view to be hidden is configured to be in an interaction-admission state, the hidden type of the interaction attribute of the input box view to be hidden is set to the hidden type, the cursor color is an opaque color, and the input interaction state is enabled.
[0024] In the specific execution process, in addition to sensitive and private data such as user-input passwords, the screen capture process may also include sensitive and / or private data displayed by the application provider. This type of data must also be hidden during the screen capture process to avoid leakage of such data based on the screen capture results. Among them, the sensitive and / or private data of the application provider includes, for example, the internal data of the video playback application, the proprietary videos and / or images of the video playback application, and content that requires paid resources to obtain access to in the video playback application.
[0025] Based on this, since the operating system has the ability to identify the input box view to be hidden during screen capture, in this embodiment, the interaction attribute of the input box view to be hidden can be configured to an interaction-disabled state. Based on the interaction-disabled state of the input box view to be hidden, private data and / or sensitive data that do not require input can be displayed. This allows the operating system to hide the displayed content in the input box view during screen capture. Thus, by leveraging the operating system's ability to hide the displayed content in the input box view to be hidden, the content of the input box view, which is packaged as a content display box, can be hidden, improving the convenience and efficiency of hiding private data and / or sensitive data that do not require input, i.e., improving the convenience and efficiency of hiding proprietary data provided by the application provider. Optionally, the interaction attribute of the input box view to be hidden can be configured to an interaction-disabled state.
[0026] It should be noted that the subsequent processing of the input box view to be hidden in the above-mentioned interactive admission state is similar to that of the input box view to be hidden in the interactive prohibition state. The following uses the input box view to be hidden in the interactive prohibition state as an example to explain the relevant processing process in detail.
[0027] In the specific execution process, when the interaction properties of the input box view to be hidden are configured to be disabled, optionally, the hiding type of the interaction properties of the input box view to be hidden is the type to be hidden, the cursor color is transparent, and the input interaction state is closed.
[0028] In this embodiment, a hidden marker can be set for the input box view to be hidden. During the process of traversing the view hierarchy information of the current screen display view to obtain the input box views to be hidden in the current screen display view, the view hierarchy information of the current screen display view can be traversed to obtain the input box views carrying the hidden marker in the current screen display view. Thus, by setting hidden markers for views displaying private data and / or sensitive data, the convenience and efficiency of determining the input box views to be hidden are improved. The hidden marker in this embodiment includes the type to be hidden, that is, the input box view carrying the hidden marker includes input box views whose hidden type is the type to be hidden; for example, if the hidden type of any input box view in at least one current screen display view is the type to be hidden, then it is determined that the input box view carries the hidden marker. In this embodiment, the method of traversing the view hierarchy information of the current screen display view based on the screen capture command to obtain the input box view to be hidden carrying the hidden mark in the current screen display view can be replaced by traversing the view hierarchy information of the current screen display view based on the screen capture command to obtain the input box view of the type to be hidden in the current screen display view as the input box view to be hidden, and forming a new implementation method with other processing procedures provided in this embodiment.
[0029] It should be noted that the hidden type can include not only the type to be hidden, but also the non-hidden type. The content displayed in the display area corresponding to the current screen display view of the non-hidden type does not need to be hidden during the screen capture process.
[0030] Specifically, in the process of traversing the view hierarchy information of the current screen display view based on the screen capture command to obtain the input box view to be hidden in the current screen display view, the view hierarchy information of the current screen display view can be traversed based on the screen capture command, and the hiding type of each input box view can be identified. The input box view whose hiding type is the type to be hidden can be obtained as the input box view to be hidden.
[0031] In specific implementation, to improve the efficiency of generating the input box view to be hidden, a template for the input box view to be hidden can be generated and stored. During the process of generating the input box view to be hidden, data is populated into the template to obtain the input box view to be hidden. The following is a detailed description of an optional process for generating the input box view to be hidden provided in this embodiment.
[0032] (1) Create an input box subclass.
[0033] In this embodiment, the input box subclass can be a text input box subclass; for example, in the process of creating an input box subclass, a subclass of UITextField (text input box) can be created as the input box subclass.
[0034] In addition, during the creation of input box subclasses, you can create input box subclasses with the hidden type being the type to be hidden.
[0035] (2) Configure the interaction property of the input box subclass to the interaction disabled state to obtain the view template of the input box to be hidden.
[0036] After creating the input box subclass, the input box subclass can be configured to obtain the view template of the input box to be hidden. In this embodiment, during the process of configuring the input box subclass to obtain the view template of the input box to be hidden, the interaction attribute of the input box subclass can be configured to an interaction-disabled state to obtain the view template of the input box to be hidden.
[0037] In one optional implementation of this embodiment, the interaction attribute of the input box subclass is configured to an interaction-disabled state, including at least one of the following: Configure the hidden type of the input box subclass to the type to be hidden; Configure the cursor color of the input box subclass to be transparent; Configure the input interaction state of the input box subclass to be off.
[0038] Specifically, when configuring the input box subclass, the hidden type of the input box subclass can be configured as the type to be hidden, so that the content of the input box view of the type to be hidden can be hidden during the screen capture process.
[0039] In practical applications, since the input box subclass needs to configure the cursor color and input interaction state, during the configuration process of the input box subclass, the cursor color of the input box subclass can be configured to be transparent and / or the input interaction state of the input box subclass can be configured to be closed. In this way, the obtained input box view template to be hidden will look like a container view rather than an input box view in terms of visual appearance and interaction.
[0040] Furthermore, for input box subclasses, the operating system can only recognize the view corresponding to the input box subclass after data input is entered into it. Therefore, when configuring the interaction attribute of the input box subclass to an interaction-disabled state, placeholders can be set for the input box subclass to ensure that data input already exists by default, preventing the operating system from failing to recognize the view corresponding to the input box subclass when traversing view hierarchy information. Accordingly, optionally, in this embodiment, the cursor color of the input box view to be hidden is transparent, the input interaction state is off, and / or a placeholder is set; in addition, the hiding type of the input box view to be hidden is set to the "to be hidden" type.
[0041] Furthermore, when configuring the interaction properties of the input box subclass to the disabled state, you can also set the view shape parameters and / or view size parameters corresponding to the input box subclass to adapt to the data displayed based on the input box subclass.
[0042] For example, such as Figure 2 As shown, first, a subclass of the text input field is created, that is, a subclass of UITextField (text input field). Then, the interaction property of the input field subclass is configured to be disabled. Specifically, the following operations are performed when configuring the interaction property of the input field subclass to be disabled: In configuring the hidden type of the input box subclass to be hidden, `isSecureTextEntry` (whether it is safe text input) is set to `true`. If `isSecureTextEntry` is `true`, the hidden type is determined to be hidden; if `isSecureTextEntry` is `false`, the hidden type is determined to be non-hidden. Additionally, in configuring the cursor color to transparent, `tintColor` (the highlight color of the control) is set to `clear`. In configuring the input interaction state to closed, `isUserInteractionEnabled` (whether user interaction is enabled) is set to `false`. Thus, by setting `tintColor=clear` and `isUserInteractionEnabled=false`, the input box subclass visually and interactively resembles a normal container view. Furthermore, a long placeholder can be set for this input box subclass.
[0043] It should be noted that after generating the input box view template to be hidden, the template can be stored so that it can be read when generating the input box view to be hidden, and the content can be filled into the template to obtain the input box view to be hidden.
[0044] (3) Obtain the preset display content, fill the content of the input box view template to be hidden based on the preset display content, and obtain the input box view to be hidden.
[0045] Based on the obtained input box view template, and after obtaining the preset display content, the input box view template can be populated with content based on the preset display content to obtain the input box view to be hidden. In this embodiment, the preset display content includes display content identified or marked as needing to be hidden during the content population process, such as sensitive data, privacy data, and / or proprietary data of the application provider.
[0046] Specifically, in the process of filling data into the input box view template to obtain the input box view to be hidden, you can first create a protected content view with preset display content, and then embed the protected content view as a subview into the display area corresponding to the input box view template to be hidden, thus obtaining the input box view to be hidden.
[0047] To improve the rationality of the embedded input box view during the display process, in this embodiment, when embedding the protected content view as a subview into the display area corresponding to the input box view template to be hidden, the protected content view can first be associated with the input box view template to be hidden by assigning attribute values. Then, the display area is adapted between the input box view template to be hidden and the protected content view through a pre-configured layout strategy to obtain the input box view to be hidden.
[0048] In this embodiment, as Figure 3 As shown, the process of filling the data of the input box view template to be hidden and obtaining the input box view to be hidden can be achieved by the following steps S301 to S303.
[0049] Step S301: Create a protected content view containing preset display content.
[0050] Step S302: Associate the protected content view with the input box view template to be hidden by assigning attribute values.
[0051] Step S303: Adapt the display area of the input box view template to be hidden and the protected content view using a pre-configured layout strategy to obtain the input box view to be hidden.
[0052] For example, first create a protected content view containing the content to be hidden, then associate the protected content view with the input box view template to be hidden by assigning property values, and then use layoutSubviews (view layout subview method) to adapt the display area of the input box view template to be hidden and the protected content view to obtain the input box view to be hidden.
[0053] Step S103: Hide the content displayed in the display area corresponding to the input box view to be hidden, and obtain the target display content.
[0054] In practice, after obtaining the input box view to be hidden in the current screen display view, the display content in the display area corresponding to the input box view to be hidden is hidden to obtain the target display content. In this way, by hiding the display content in the display area corresponding to the input box view to be hidden, the security of the display content corresponding to the input box view to be hidden is improved, and the display content leakage is avoided due to the acquisition of the display content corresponding to the input box view to be hidden during the screen acquisition process.
[0055] In this embodiment, the content displayed within the display area corresponding to the input box view to be hidden may include privacy data and / or sensitive data. Furthermore, it may include data with ownership rights, such as videos and / or images that only this application has permission to access, and user identity information. In this embodiment, by hiding the display content corresponding to the input box view to be hidden, the generated screen capture results do not include this display content, thus preventing its leakage and dissemination.
[0056] The screen capture method provided in this embodiment can be applied to an operating system. Specifically, in the process of hiding the content displayed in the display area corresponding to the input box view to be hidden and obtaining the target display content, the operating system can perform content hiding processing on the display content in the display area according to the view hiding strategy of the operating system to obtain the target display content.
[0057] In the specific execution process, when the operating system performs content hiding processing on the display content in the display area corresponding to the input box view to be hidden, and obtains the target display content, it can first obtain the pre-configured view hiding strategy, and then perform content hiding processing on the display content in the display area according to the view hiding strategy to obtain the target display content.
[0058] The view hiding strategy in this embodiment can be a content overlay strategy that covers the display content corresponding to the input box view to be hidden, or a content replacement strategy that replaces the display content corresponding to the input box view to be hidden with a preset hidden character, so that the display content corresponding to the input box view to be hidden cannot be collected.
[0059] In the first optional implementation of this embodiment, during the process of hiding the content within the display area corresponding to the input box view to be hidden, or during the process of hiding the content within the display area according to a view hiding strategy, a preset hidden character can be used to replace the display content within the display area corresponding to the input box view to be hidden, thereby obtaining target display content containing at least the preset hidden character. This improves the user's perception of the display area corresponding to the input box view by replacing the display content with the preset hidden character. The target display content is the display content after the content corresponding to the input box view to be hidden is hidden or replaced in the current screen display view.
[0060] For example, if the default hidden character is a black dot, the content displayed within the corresponding display area of the input box view to be hidden is replaced using this black dot, resulting in the target display content where the content within that area is the same as the black dot. It's important to note that, apart from the hidden or replaced content within the target display area, all other content remains the same as the currently displayed content.
[0061] In the second optional implementation provided in this embodiment, during the process of hiding the content displayed within the display area corresponding to the input box view to be hidden to obtain the target display content, or during the process of hiding the content displayed within the display area according to the view hiding strategy, the associated display view of the input box view to be hidden can first be obtained based on the display area and view hierarchy information corresponding to the input box view to be hidden; then, the display content corresponding to the associated display view can be obtained as the target display content. Optionally, the associated display view includes a first associated display view above the input box view to be hidden and / or a second associated display view below the input box view to be hidden, displayed in an associated display area outside the display area corresponding to the input box view to be hidden in the screen area.
[0062] In the specific execution process, the screen display view above the input box view to be hidden in the current screen display view can be used as the first associated display view. In addition, if the screen display view above the input box view to be hidden does not completely cover the associated display area outside the display area corresponding to the input box view to be hidden in the screen area, resulting in blank parts in the screen area when only the first associated display view is obtained, the second associated display view below the input box view to be hidden, which is displayed in the associated display area outside the display area in the screen area, can also be obtained.
[0063] For example, when hiding the content displayed within the display area corresponding to the input box view to be hidden, and obtaining the target display content, or when hiding the content displayed within the display area according to the view hiding strategy, the process first obtains the first associated display view above the input box view to be hidden in the current screen display view; it then checks whether the coverage area of the first associated display view completely covers the associated display area outside the display area corresponding to the input box view to be hidden in the screen area; if so, the first associated display view is determined as the associated display view; if not, based on the coverage area and the display area corresponding to the input box view to be hidden, the uncovered area in the screen area is determined, and the second associated display view corresponding to the uncovered area located below the input box view to be hidden is obtained, and the first associated display view and the second associated display view are used together as the associated display view.
[0064] Based on obtaining the associated display view of the input box view to be hidden, the target display content corresponding to the associated display view is obtained. Specifically, in the process of obtaining the target display content corresponding to the associated display view, the view display content of the first associated display view can be obtained first as the first view display content, and / or the view display content of the associated display area and / or the uncovered display area in the second associated display view can be obtained as the second view display content. Then, the first view display content and the second view display content are determined as the target display content.
[0065] Corresponding to the above, in the process of obtaining the target display content corresponding to the associated display view, the view display content of the first associated display view can be obtained first as the first view display content. Then, the content of the uncovered area corresponding to the second associated display view can be obtained as the second view display content. Finally, the first view display content and the second view display content can be laid out according to their respective display areas to obtain the target display content. Optionally, the target display content may include the first view display content and the second view display content and their display positions on the screen.
[0066] In addition, when hiding the content in the display area corresponding to the input box view to be hidden, or when hiding the content in the display area according to the operating system's view hiding strategy, the display content corresponding to the screen display view above the input box view to be hidden in the current screen display view can be determined as the target display content.
[0067] It should be noted that in this embodiment, during the process of traversing the view hierarchy information of the current screen display view based on the screen capture command to obtain the input box view to be hidden in the current screen display view, and performing content hiding processing on the display content within the display area corresponding to the input box view to be hidden, the content displayed on the current screen is not modified; only the screen content in the screen capture result is hidden. That is, after performing content hiding processing on the display content and obtaining the target display content, the target display content will not be displayed on the current screen; the content displayed on the current screen is still the content corresponding to the current screen display view.
[0068] Step S104: Generate screen capture results based on the target display content.
[0069] In practice, after obtaining the target display content after hiding the content within the display area corresponding to the input box view to be hidden, a screen capture result is generated based on the target display content. In this embodiment, the screen capture result contains the display content corresponding to the input box view to be hidden.
[0070] Specifically, in the process of generating screen capture results based on the target display content, the target display content can be determined as the screen capture result.
[0071] After obtaining the screen capture results, the results can be stored in the operating system's image storage area, and users can view the screen capture results through the image storage area.
[0072] The following description uses the application of a screen capture method provided in this embodiment in a screenshot scenario as an example to further illustrate the screen capture method provided in this embodiment. Figure 4 As shown, the screen capture method applied to screenshot scenarios includes the following steps.
[0073] Step S401: Obtain the screenshot command.
[0074] Step S402: Based on the screenshot command, traverse the view hierarchy information of the current screen display view to obtain the input box view to be hidden in the current screen display view.
[0075] Step S403: Replace the display content corresponding to the input box view to be hidden with the preset hidden characters to obtain the target display content containing the preset hidden characters.
[0076] Step S404: Generate a screenshot image containing the target display content.
[0077] It should be noted that any one or more steps from S401 to S404 can be combined with any one or more steps from S101 to S104 to form a new implementation method according to the needs of implementation and deployment. In addition, any one or more technical features can be selected in steps S401 to S404 and combined with any one or more technical features provided in steps S101 to S104 to form a new implementation method according to the actual deployment needs. Alternatively, any one or more technical features in steps S401 to S404 can be replaced with any one or more technical features provided in steps S101 to S104 to form a new implementation method according to the actual deployment needs. These will not be elaborated on here.
[0078] The following description uses the application of a screen capture method provided in this embodiment in a screen recording scenario as an example to further illustrate the screen capture method provided in this embodiment. Figure 5 As shown, the screen capture method applied to screen recording scenarios includes the following steps.
[0079] Step S501: Obtain the screen recording command.
[0080] Step S502: Based on the screen recording command, traverse the view hierarchy information of the current screen display view to obtain the hidden type of each current screen display view.
[0081] Step S503: Obtain the input box view with the hidden type to be hidden as the input box view to be hidden.
[0082] Step S504: Based on the display area and view hierarchy information of the input box view to be hidden on the screen, obtain the associated display view of the input box view to be hidden.
[0083] Step S505: Obtain the target display content corresponding to the associated display view, and generate screen recording data based on the target display content.
[0084] It should be noted that any one or more of steps S501 to S505 can be combined with any one or more of steps S101 to S104 to form a new implementation method according to the needs of implementation and deployment. In addition, according to the actual deployment needs, any one or more technical features in steps S501 to S505 can be selected and combined with any one or more technical features provided in steps S101 to S104 to form a new implementation method. Alternatively, any one or more technical features in steps S501 to S505 can be replaced with any one or more technical features provided in steps S101 to S104 to form a new implementation method according to the actual deployment needs. These will not be elaborated on here.
[0085] Based on the same inventive concept, as an implementation of the above method, this embodiment of the invention also provides a screen capture device. This embodiment corresponds to the aforementioned method embodiment. For ease of reading, this embodiment will not repeat the details of the aforementioned method embodiment one by one, but it should be clear that the screen capture device in this embodiment can implement all the contents of the aforementioned method embodiment.
[0086] This invention provides a screen capture device. Figure 6 This is a schematic diagram of the screen capture device, as shown below. Figure 6 As shown, the screen capture device includes: Acquisition unit 601 is used to acquire screen capture commands; The processing unit 602 is configured to traverse the view hierarchy information of the current screen display view based on the screen capture instruction, and obtain the input box view to be hidden in the current screen display view; the interaction attribute of the input box view to be hidden is configured to an interaction disabled state; The processing unit 602 is further configured to perform content hiding processing on the display content within the display area corresponding to the input box view to be hidden, so as to obtain the target display content; The processing unit 602 is also used to generate screen capture results based on the target display content.
[0087] As an optional implementation of this invention, in the interactive attributes of the input box view to be hidden, the hiding type is the type to be hidden, the cursor color is a transparent color, and the input interaction state is a closed state.
[0088] As an optional implementation of this invention, the input box view to be hidden is generated in the following manner: Create an input box subclass; Configure the interaction attribute of the input box subclass to the interaction disabled state to obtain the view template of the input box to be hidden; Obtain preset display content, and fill the input box view template to be hidden with content based on the preset display content to obtain the input box view to be hidden.
[0089] As an optional implementation of this invention, when the processing unit 602 configures the interaction attribute of the input box subclass to an interaction-disabled state, it includes at least one of the following: Configure the hidden type of the input box subclass as the type to be hidden; Configure the cursor color of the input box subclass to be transparent; Configure the input interaction state of the input box subclass to be off.
[0090] As an optional implementation of this invention, when the processing unit 602 configures the interaction attribute of the input box subclass to an interaction-disabled state, it is further configured to: Placeholders are set for the input box subclass.
[0091] As an optional implementation of this invention, the screen capture method runs on an operating system. When the processing unit 602 performs content hiding processing on the display content within the display area corresponding to the input box view to be hidden, and obtains the target display content, it specifically performs the following: Get the pre-configured view hiding strategy; According to the view hiding strategy, the content displayed within the display area is hidden to obtain the target display content.
[0092] As an optional implementation of this invention, when the processing unit 602 performs content hiding processing on the display content within the display area according to the view hiding strategy to obtain the target display content, it is specifically used for: The display content within the display area is replaced using preset hidden characters to obtain the target display content that contains at least the preset hidden characters.
[0093] As an optional implementation of this invention, when the processing unit 602 performs content hiding processing on the display content within the display area according to the view hiding strategy to obtain the target display content, it is specifically used for: Based on the display area corresponding to the input box view to be hidden and the view hierarchy information, obtain the associated display view of the input box view to be hidden; the associated display view includes a first associated display view above the input box view to be hidden and / or a second associated display view below the input box view to be hidden, displayed in an associated display area outside the display area in the screen area; The display content corresponding to the associated display view is obtained as the target display content.
[0094] The screen capture device provided in this embodiment of the invention can execute the screen capture method provided in any of the above embodiments. Its implementation principle and technical effect are similar, and will not be described again here.
[0095] This invention also provides an electronic device, such as... Figure 7 As shown, it includes a processor 701, a communication interface 702, a memory 703, and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704. Memory 703 is used to store computer programs; When processor 701 executes a program stored in memory 703, it performs the following steps: Obtain screen capture instructions; Based on the screen capture command, the view hierarchy information of the current screen display view is traversed to obtain the input box view to be hidden in the current screen display view; the interaction attribute of the input box view to be hidden is configured to an interaction-disabled state; The content displayed within the display area corresponding to the input box view to be hidden is hidden to obtain the target display content; Based on the target display content, screen capture results are generated.
[0096] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0097] The communication interface is used for communication between the aforementioned terminal and other devices.
[0098] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0099] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0100] The electronic device provided in this embodiment of the invention can execute the screen capture method provided in any of the above embodiments. Its implementation principle and technical effect are similar, and will not be described again here.
[0101] In another embodiment of the present invention, a computer-readable storage medium is also provided, which stores instructions that, when executed on a computer, cause the computer to perform any of the screen capture methods described in the above embodiments.
[0102] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the screen capture methods described in the above embodiments.
[0103] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0104] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0105] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0106] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A screen capture method, characterized in that, include: Obtain screen capture instructions; Based on the screen capture command, the view hierarchy information of the current screen display view is traversed to obtain the input box view to be hidden in the current screen display view; The interaction properties of the input box view to be hidden are configured to be in an interaction-disabled state; The content displayed within the display area corresponding to the input box view to be hidden is hidden to obtain the target display content; Based on the target display content, screen capture results are generated.
2. The method according to claim 1, characterized in that, In the interactive properties of the input box view to be hidden, the hiding type is the type to be hidden, the cursor color is a transparent color, and the input interaction state is the closed state.
3. The method according to claim 1, characterized in that, The input box view to be hidden is generated in the following way: Create an input box subclass; Configure the interaction attribute of the input box subclass to the interaction disabled state to obtain the view template of the input box to be hidden; Obtain preset display content, and fill the input box view template to be hidden with content based on the preset display content to obtain the input box view to be hidden.
4. The method according to claim 3, characterized in that, Configuring the interaction attribute of the input box subclass to an interaction-disabled state includes at least one of the following: Configure the hidden type of the input box subclass as the type to be hidden; Configure the cursor color of the input box subclass to be transparent; Configure the input interaction state of the input box subclass to be off.
5. The method according to claim 4, characterized in that, The step of configuring the interaction attribute of the input box subclass to an interaction-disabled state also includes: Placeholders are set for the input box subclass.
6. The method according to claim 1, characterized in that, The screen capture method is applied to an operating system; the step of hiding the displayed content within the display area corresponding to the input box view to obtain the target display content includes: Get the pre-configured view hiding strategy; According to the view hiding strategy, the content displayed within the display area is hidden to obtain the target display content.
7. The method according to claim 6, characterized in that, The step of hiding the displayed content within the display area according to the view hiding strategy to obtain the target display content includes: The display content within the display area is replaced using preset hidden characters to obtain the target display content that contains at least the preset hidden characters.
8. The method according to claim 6, characterized in that, The step of hiding the displayed content within the display area according to the view hiding strategy to obtain the target display content includes: Based on the display area corresponding to the input box view to be hidden and the view hierarchy information, obtain the associated display view of the input box view to be hidden; the associated display view includes a first associated display view above the input box view to be hidden and / or a second associated display view below the input box view to be hidden, displayed in an associated display area outside the display area in the screen area; The display content corresponding to the associated display view is obtained as the target display content.
9. A screen capture device, characterized in that, include: The acquisition unit is used to acquire screen capture commands; The processing unit is used to traverse the view hierarchy information of the current screen display view based on the screen capture instruction, and obtain the input box view to be hidden in the current screen display view; The interaction properties of the input box view to be hidden are configured to be in an interaction-disabled state; The processing unit is also used to perform content hiding processing on the display content in the display area corresponding to the input box view to be hidden, so as to obtain the target display content; The processing unit is also used to generate screen capture results based on the target display content.
10. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method described in any one of claims 1-8.