Watermark adding method, device, terminal equipment and computer storage medium

By adding a watermark display component in the window manager and setting the cascading priority, a method of adding a watermark to the window content is realized, which solves the complex and intrusive problems of adding watermarks in the existing technology and improves the convenience of use.

CN111813466BActive Publication Date: 2024-10-01ALIBABA GROUP HOLDING LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910283063.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-04-10
Publication Date
2024-10-01
Estimated Expiration
2039-04-10

AI Technical Summary

Technical Problem

The existing watermark adding method is complex and cumbersome, requiring intrusion into the mobile terminal source program corresponding to the image, and users need to make cumbersome server requests when distributing the image, causing inconvenience.

Method used

Add the watermark display component to the target window through the window manager and set its cascading priority to render the watermark on the window content to achieve watermark addition without reading the specific code of the window content to avoid intrusion into the source program.

Benefits of technology

The watermark adding process is simplified, allowing users to directly take screenshots of screen content and spread images, which is easy to use and avoids intrusion into the source program.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111813466B_ABST
    Figure CN111813466B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a watermark adding method, device, terminal device and computer storage medium, wherein the watermark adding method comprises: adding a watermark display component to a target window through a window manager, and setting the stacking priority of the watermark display component relative to the window content in the target window; rendering the window content and the watermark content corresponding to the watermark display component in the target window according to the set stacking priority, so as to add a watermark on the window content. The solution provided by the embodiment of the present invention can add a watermark to the window content without invading the source program of the window content, and is simple to implement. If the user wants to spread the image corresponding to the window content, he can directly take a screenshot of the content displayed on the screen, which is convenient to use.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of data processing technology, and in particular to a watermark adding method, device, terminal equipment and computer storage medium. Background Art

[0002] With the promotion of photography and video technology and the development of Internet technology, more and more users are disseminating images through the Internet. However, when images are disseminated through the Internet, they are easily copied, stolen, used maliciously, etc., resulting in infringement of the interests of the original author of the image. In order to reduce the occurrence of such situations, watermarks are usually added to the images.

[0003] However, the existing methods of adding watermarks are relatively complicated and cumbersome, and there are many inconveniences in use. For example, before adding a watermark, the user needs to send a request to the server to request permission to spread the image. The server adds a watermark to the image that the user wants to spread according to the received request, and sends the watermarked content to the client for the user to use, which makes the watermark adding process cumbersome; and, since most people now use mobile terminals to display pictures, adding a watermark often requires invading the source program of the mobile terminal corresponding to the picture, which makes the watermark adding process more complicated. Summary of the invention

[0004] In view of this, embodiments of the present invention provide a watermark adding method, apparatus, terminal device and computer storage medium to solve any one of the above problems.

[0005] According to a first aspect of an embodiment of the present invention, a watermark adding method is provided, which comprises: adding a watermark display component to a target window through a window manager, and setting the stacking priority of the watermark display component relative to the window content in the target window; rendering the window content and the watermark content corresponding to the watermark display component in the target window according to the set stacking priority, so as to add a watermark on the window content.

[0006] According to a second aspect of an embodiment of the present invention, a watermark adding device is provided, which includes: an adding module, used to add a watermark display component to a target window through a window manager, and set the stacking priority of the watermark display component relative to the window content in the target window; a rendering module, used to render the window content and the watermark content corresponding to the watermark display component in the target window according to the set stacking priority, so as to add a watermark on the window content.

[0007] According to a third aspect of an embodiment of the present invention, there is provided a terminal device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the watermark adding method as described above.

[0008] According to a fourth aspect of the embodiments of the present invention, there is provided a computer storage medium on which a computer program is stored. When the program is executed by a processor, the watermark adding method described above is implemented.

[0009] According to the solution provided by an embodiment of the present invention, a watermark display component is added to a target window through a window manager, and a stacking priority of the watermark display component relative to the window content in the target window is set; the window content and the watermark content corresponding to the watermark display component are rendered in the target window according to the set stacking priority to add a watermark on the window content. The entire process of adding the watermark does not require reading the specific code of the window content, thereby adding a watermark to the window content without invading the source program of the window content. The implementation is simple, and if the user wants to spread the image corresponding to the window content, the user can directly take a screenshot of the content displayed on the screen, which is convenient to use. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0011] Figure 1 This is a flow chart of the steps of a watermark adding method according to the first embodiment of the present invention;

[0012] Figure 2 This is a flow chart of the steps of a watermark adding method according to the second embodiment of the present invention;

[0013] Figure 3 This is an interface diagram of the second embodiment of the present invention;

[0014] Figure 4 This is a structural block diagram of a watermark adding device according to Embodiment 3 of the present invention;

[0015] Figure 5 This is a schematic diagram of the structure of a terminal device according to Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0016] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in the field based on the embodiments in the embodiments of the present invention should fall within the scope of protection of the embodiments of the present invention.

[0017] The specific implementation of the embodiment of the present invention is further described below in conjunction with the accompanying drawings of the embodiment of the present invention.

[0018] Embodiment 1

[0019] Reference Figure 1 , shows a step flow chart of a watermark adding method according to embodiment 1 of the present invention.

[0020] The watermark adding method of this embodiment includes the following steps:

[0021] S102: Add a watermark display component to a target window through a window manager, and set a stacking priority of the watermark display component relative to window content in the target window.

[0022] In this embodiment, the window manager is used to control the display of the target window. All contents displayed in the target window can be managed by the window manager, such as adding display contents, deleting display contents, modifying the properties of display contents, etc.

[0023] The window manager is explained using the Android system as an example. Most of the UI interfaces in the Android system are hosted by the interactive component activity. Each activity includes a window, which is used to display the content hosted by the activity. The window manager can manage the window to control the display of the window.

[0024] In this embodiment, the watermark display component is used to carry the watermark content. The watermark content can be first added to the watermark display component, and then the watermark display component can be added to the target window through the window manager; or the watermark display component can be first added to the target window, and then the watermark content can be added to the watermark display component. This embodiment does not limit this.

[0025] In this embodiment, it is also necessary to set the stacking priority of the watermark display component and the window content in the target window, so as to ensure that part or all of the watermark content can be displayed above the window content of the target window instead of being blocked by the window content.

[0026] S104: Rendering the window content and the watermark content corresponding to the watermark display component in the target window according to the set stacking priority, so as to add a watermark on the window content.

[0027] In this embodiment, the target window may include multiple components for carrying different window contents respectively. When rendering, the rendering is performed according to the stacking relationship of the multiple components, so that when the rendering results are displayed, only part of the content in a component may be displayed, or even the entire component may not be displayed. After the watermark display component is added to the target window, it will also be rendered according to the above method.

[0028] Therefore, in this embodiment, when rendering, the window content and the watermark content can be drawn according to the set stacking priority, so that the stacking priority is used to ensure that the watermark content is displayed and not blocked by the window content, so as to achieve the purpose of adding a watermark on the window content.

[0029] The solution provided in this embodiment is to add a watermark display component to a target window through a window manager, and set a stacking priority of the watermark display component relative to the window content in the target window; render the window content and the watermark content corresponding to the watermark display component in the target window according to the set stacking priority to add a watermark on the window content. The entire process of adding the watermark does not require reading the specific code of the window content, so that the watermark is added without invading the source program of the window content. The implementation is simple, and if the user wants to spread the image corresponding to the window content, the user can directly take a screenshot of the content displayed on the screen, which is convenient to use.

[0030] Embodiment 2

[0031] Reference Figure 2 , shows a step flow chart of a watermark adding method according to embodiment 2 of the present invention.

[0032] The watermark adding method of this embodiment includes the following steps:

[0033] S202: Determine whether the window content in the target window needs to be watermarked.

[0034] In this embodiment, it can be determined in any way that a watermark is needed in the target window. For example, when designing a page, a technician can add a copyright mark to the page that needs copyright protection, and when the front end displays it, the front end can directly determine that the window content in the target window needs to be watermarked based on the copyright mark.

[0035] Of course, in other implementations of this embodiment, it may also be assumed that the window contents in all target windows need to be watermarked. In this case, no further determination is required and step S204 may be directly executed.

[0036] S204: Obtain a window manager corresponding to the target window, add a watermark display component to the target window through the window manager, and set a stacking priority of the watermark display component relative to the window content in the target window.

[0037] In this embodiment, the watermark display component can be a preset display component. For example, the watermark display component can be specifically implemented by the frame layout component framelayout. The background, border and other parameter data of framelayout can be defined by technicians in this field according to watermark requirements, and this embodiment will not be repeated here.

[0038] Usually, the screen coordinate system is used when displaying window content on the screen. The coordinates of the upper left corner of the screen in the screen coordinate system are (0,0). When defining the coordinates of the watermark display component, assuming that the coordinates of the upper left corner of the framelayout are defined as (100,100), the distance between the upper left corner of the framelayout component and the left and upper sides of the screen are both 100. After setting the coordinates of the upper left corner, you can also set the length and width of the framelayout through params = new ViewGroup.LayoutParams (WRAP_COTNENT, WRAP_COTNENT), where the two values ​​in (WRAP_COTNENT, WRAP_COTNENT) correspond to the length and width respectively. WRAP_COTNENT means adaptive, that is, the length and width of the framelayout are adaptively modified according to the watermark content therein; after setting, update it through frameLayout.setLayoutParams (params), so as to update the set parameter data to the framelayout.

[0039] After the watermark display component is set, it can be pre-stored in the terminal and can be directly called through the system in the terminal when in use.

[0040] Taking the Android system in the terminal as an example, when it is determined that a watermark needs to be added to the window content, the window manager corresponding to the target window can be obtained. For example, the window manager corresponding to the target window can be obtained through WindowManager wm=(WindowManager), and the service provided by the Android system can be obtained through getSystemService provided by the system, so that the pre-stored watermark display component can be added to the target window through the obtained service.

[0041] Specifically, the watermark display component can be added to the target window through the wm.addView function. When adding, the method of adding the watermark display component can be declared through globalParams.

[0042] After adding, the stacking priority of the watermark display component relative to the window content in the target window can also be determined by the window manager. For example, the stacking priority of the newly added watermark display component in the window can be declared to be higher than all the window content through windowmanager.layoutparams.TYPE_APPLICATION, so as to ensure that all watermark content in the watermark display component is displayed in the target window, thereby ensuring the effect of adding watermark.

[0043] In addition, after adding the watermark display component, it can also include: setting parameter data of the watermark display component in the target window through the window manager, and the parameter data includes at least one of the following: position parameters of the watermark display component, interaction parameters of the watermark display component, and transparency of the watermark display component.

[0044] Specifically, the parameter data in the watermark display component can be synchronized to the window through the window manager. For example, the width and height of the watermark display component can be determined to be adaptive through WindowManager.LayoutParams.WRAP_CONTENT.

[0045] Specifically, you can also set the interactive parameters and transparency of the watermark display component through WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE|WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE,PixelFormat.TRANSLUCENT. Among them, FLAG_NOT_FOCUSABLE|WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE means that the watermark display component will never get the focus in the windows window and will not get click events; PixelFormat.TRANSLUCENT means that the watermark display component is translucent.

[0046] S206: Update the watermark display component.

[0047] In this embodiment, after the watermark display component framelayout is added to the target window, the watermark display component can be updated through wm.updateViewLayout(frameLayout,globalParams). By updating the display component, the parameter data of the set watermark display component can be updated according to the window content, so that the watermark displayed in the watermark display component is not affected by the window content.

[0048] In addition, after modifying the watermark display component, such as modifying the watermark content in the watermark display component, modifying the location information of the watermark display component, and modifying the transparency, the watermark display component also needs to be updated. When the watermark is no longer needed, the watermark display component frameLayout can be removed from the target window through wm.removeViewImmediate(frameLayout).

[0049] S208: Render the window content and the watermark content corresponding to the watermark display component in the target window according to the set stacking priority, so as to add a watermark on the window content.

[0050] The specific implementation of this step refers to the above step S104, and this embodiment will not be repeated here. The interface for display obtained after rendering can be as follows Figure 3 As shown, the watermark content in the interface is directly displayed at the top layer of the screen.

[0051] It should also be noted that when the watermark display component is a preset display component, the watermark content can be defined by defining a sub-display component in the watermark display component. The watermark display component can specifically be a view component or a layout component, and the sub-display component can also be a view component or a layout component. Those skilled in the art can define it as needed.

[0052] Further, in order to make the definition of watermark content simpler and more convenient, in this embodiment, the watermark display component includes a frame layout component. Correspondingly, defining the watermark content by defining a sub-display component in the watermark display component may include: defining the watermark content by defining a sub-display component added to the frame layout component.

[0053] Specifically, since in the frame layout component, the sub-display component adopts a stacked layout, which is a layout method that comes later, that is, the sub-display component added later is directly stacked and displayed on the previously existing sub-display component. Therefore, by defining the sub-display component added to the frame layout component, the content displayed at the top of the frame layout component can be defined, thereby defining the watermark content.

[0054] The solution provided in this embodiment can directly define the watermark content by defining the sub-display component of the watermark display component, thereby realizing the customization of the watermark.

[0055] The watermark adding method of this embodiment can be executed by any appropriate terminal device with data processing capabilities, including but not limited to: mobile terminals (such as tablets, mobile phones, etc.) and PCs. The watermark adding solution provided in this embodiment can be directly implemented by the native system in the terminal device.

[0056] Embodiment 3

[0057] Reference Figure 4 , shows a structural block diagram of a watermark adding device according to embodiment 3 of the present invention.

[0058] Figure 4 The watermark adding device shown includes: an adding module 302 and a rendering module 304 .

[0059] The adding module 302 is used to add the watermark display component to the target window through the window manager, and set the stacking priority of the watermark display component relative to the window content in the target window.

[0060] The rendering module 304 is used to render the window content and the watermark content corresponding to the watermark display component in the target window according to the set stacking priority, so as to add a watermark on the window content.

[0061] In an optional implementation, the stacking priority of the watermark display component is higher than the stacking priority of all the window contents.

[0062] In an optional implementation, the device further includes: a definition module, configured to define the watermark content by defining a sub-display component in the watermark display component.

[0063] In an optional implementation, if the watermark display component includes a frame layout component, the definition module is specifically configured to define the watermark content by defining a sub-display component added to the frame layout component.

[0064] In an optional implementation, the device further includes: an updating module, configured to update the watermark display component.

[0065] The solution provided by the embodiment of the present invention is to add a watermark display component to the target window through the window manager, and set the stacking priority of the watermark display component relative to the window content in the target window; render the window content and the watermark content corresponding to the watermark display component in the target window according to the set stacking priority to add a watermark on the window content. The whole process of adding the watermark does not require reading the specific code of the window content, so that the watermark is added to the source program of the window content without invading the source program of the window content. The implementation is simple, and if the user wants to spread the image corresponding to the window content, the user can directly take a screenshot of the content displayed on the screen, which is convenient to use.

[0066] Embodiment 4

[0067] A terminal device comprises: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the data updating method described above.

[0068] Specifically, refer to Figure 5 , shows a schematic diagram of the structure of a terminal device according to Embodiment 5 of the present invention. The specific embodiment of the present invention does not limit the specific implementation of the terminal device.

[0069] like Figure 5 As shown, the terminal device may include: a processor (processor) 402 , a communication interface (Communications Interface) 404 , a memory (memory) 406 , and a communication bus 408 .

[0070] in:

[0071] The processor 402 , the communication interface 404 , and the memory 406 communicate with each other via a communication bus 408 .

[0072] The communication interface 404 is used to communicate with other terminal devices or servers.

[0073] The processor 402 is used to execute the program 410, and specifically can execute the relevant steps in the above data updating method embodiment.

[0074] Specifically, the program 410 may include program codes, which include computer operation instructions.

[0075] The processor 402 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiment of the present invention. The one or more processors included in the terminal device may be processors of the same type, such as one or more CPUs; or may be processors of different types, such as one or more CPUs and one or more ASICs.

[0076] The memory 406 is used to store the program 410. The memory 406 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0077] Program 410 can be specifically used to enable processor 402 to perform the following operations: add a watermark display component to a target window through a window manager, and set the stacking priority of the watermark display component relative to the window content in the target window; render the window content and the watermark content corresponding to the watermark display component in the target window according to the set stacking priority, so as to add a watermark on the window content.

[0078] In an optional implementation, the stacking priority of the watermark display component is higher than the stacking priority of all the window contents.

[0079] In an optional implementation, the method further includes: defining the watermark content by defining a sub-display component in the watermark display component.

[0080] In an optional embodiment, if the watermark display component includes a frame layout component, then defining the watermark content by defining a sub-display component in the watermark display component includes: defining the watermark content by defining a sub-display component added to the frame layout component.

[0081] In an optional implementation, it also includes: setting parameter data of the watermark display component in the target window through the window manager, and the parameter data includes at least one of the following: position parameters of the watermark display component, interaction parameters of the watermark display component, and transparency of the watermark display component.

[0082] In an optional implementation, the method further includes: updating the watermark display component.

[0083] In an optional implementation, the method further includes: determining that a watermark needs to be added to the window content in the target window; and obtaining a window manager corresponding to the target window, so as to add a watermark display component to the target window through the window manager.

[0084] The specific implementation of each step in program 410 can refer to the corresponding description of the corresponding steps and units in the above data update method embodiment, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above method embodiment, which will not be repeated here.

[0085] The terminal device of this embodiment adds a watermark display component to the target window through the window manager, and sets the stacking priority of the watermark display component relative to the window content in the target window; the window content and the watermark content corresponding to the watermark display component are rendered in the target window according to the set stacking priority to add a watermark on the window content. The entire process of adding the watermark does not require reading the specific code of the window content, so that the watermark is added to the window content without invading the source program of the window content. The implementation is simple, and if the user wants to spread the image corresponding to the window content, he can directly take a screenshot of the content displayed on the screen, which is convenient to use.

[0086] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present invention can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present invention.

[0087] The method according to the embodiment of the present invention described above may be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as a CD ROM, RAM, floppy disk, hard disk or magneto-optical disk), or as computer code that is originally stored in a remote recording medium or a non-transitory machine-readable medium downloaded through a network and will be stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor or programmable or dedicated hardware (such as an ASIC or FPGA). It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by the computer, processor or hardware, the watermark adding method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the watermark adding method shown herein, the execution of the code converts the general-purpose computer into a dedicated computer for executing the watermark adding method shown herein.

[0088] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present invention.

[0089] The above implementation methods are only used to illustrate the embodiments of the present invention, and are not limitations of the embodiments of the present invention. Ordinary technicians in the relevant technical field may make various changes and modifications without departing from the spirit and scope of the embodiments of the present invention. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present invention. The patent protection scope of the embodiments of the present invention should be defined by the claims.

Claims

1. A watermark adding method, the watermark adding method being executed by a terminal device having data processing capability, characterized in that: include: Adding a watermark display component to a target window through a window manager, and setting a stacking priority of the watermark display component relative to window content in the target window, wherein the window manager is used to control the display of the target window, and all content displayed in the target window can be managed by the window manager; Defining watermark content by defining a sub-display component in the watermark display component; The window content and the watermark content corresponding to the watermark display component are rendered in the target window according to the set stacking priority, so as to add a watermark on the window content.

2. The method according to claim 1, characterized in that The stacking priority of the watermark display component is higher than the stacking priority of all the window contents.

3. The method according to claim 1, characterized in that If the watermark display component includes a frame layout component, then defining the watermark content by defining a sub-display component in the watermark display component includes: The watermark content is defined by defining a sub-display component added to the frame layout component.

4. The method according to claim 1, characterized in that: Also includes: The parameter data of the watermark display component in the target window is set by the window manager, and the parameter data includes at least one of the following: position parameters of the watermark display component, interaction parameters of the watermark display component, and transparency of the watermark display component.

5. The method according to claim 1, characterized in that Also includes: Update the watermark display component.

6. The method according to claim 1, characterized in that Also includes: Determining that window content in the target window needs to be watermarked; The window manager corresponding to the target window is obtained, so as to add the watermark display component to the target window through the window manager.

7. A watermark adding device, the watermark adding device is applied to a terminal device with data processing capability, characterized in that: include: An adding module, used to add a watermark display component to a target window through a window manager, and set a stacking priority of the watermark display component relative to the window content in the target window, wherein the window manager is used to control the display of the target window, and all the content displayed in the target window can be managed by the window manager; A definition module, used for defining watermark content by defining a sub-display component in the watermark display component; The rendering module is used to render the window content and the watermark content corresponding to the watermark display component in the target window according to the set stacking priority, so as to add a watermark on the window content.

8. The device according to claim 7, characterized in that The stacking priority of the watermark display component is higher than the stacking priority of all the window contents.

9. The device according to claim 7, characterized in that If the watermark display component includes a frame layout component, the definition module is specifically used to define the watermark content by defining a sub-display component added to the frame layout component.

10. The device according to claim 7, characterized in that Also includes: An updating module is used to update the watermark display component.

11. A terminal device, comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute an operation corresponding to the watermark adding method according to any one of claims 1-6.

12. A computer storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the watermark adding method according to any one of claims 1 to 6 is implemented.