CN103839217A - Watermark image realization method - Google Patents
Watermark image realization method Download PDFInfo
- Publication number
- CN103839217A CN103839217A CN201210474682.0A CN201210474682A CN103839217A CN 103839217 A CN103839217 A CN 103839217A CN 201210474682 A CN201210474682 A CN 201210474682A CN 103839217 A CN103839217 A CN 103839217A
- Authority
- CN
- China
- Prior art keywords
- picture
- character string
- watermark
- height
- copyright information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Editing Of Facsimile Originals (AREA)
- Image Processing (AREA)
Abstract
The invention discloses a watermark image realization method which is simple and applicable. Without using image editing software to modify an image, a user can directly carry out image batch modifying through a website, and the watermark adding positions of all images are consistent. A lot of editing time is saved. The method does not need to use the third-party software, can complete production simply through GDI, and has the advantage of low production cost.
Description
Technical field
The present invention relates to a kind of implementation method of watermark picture, belong to computer graphic image processing technology field.
Background technology
On website, show while issuing picture, conventionally can on picture, stamp the situation of watermark or copyright information, such as providing some to belong to certain tissue or individual's copyright information about picture.On network, carrying out exhibiting product by this mode of picture+word, is a kind of common and effective mode.The exhibition method of most adopts following two kinds of modes: the one, word, picture are made to a secondary whole picture by picture editor; The 2nd, picture character is separately shown.The weak point of first kind of way is that user must open former picture, and manuscript map conventionally can expend a lot of time and can not make all pictures all be consistent; Although the weak point of the second way is not need to revise former figure, picture is probably copied use by others, and copyright is invaded.
Summary of the invention
The object of the invention is to overcome defect of the prior art, a kind of implementation method of watermark picture is provided, described method is simply applicable, user does not need to use photo-editing software to revise picture, directly can pass through website batch modification picture, thereby save a large amount of edit sessions, reduced cost of manufacture simultaneously.
The present invention is achieved by the following technical programs.
An implementation method for watermark picture, step is as follows:
The first step, first defines two character string Strworkingdirectory and Strcopyright, the folder path at the input and output place that Strworkingdirectory is picture, and Strcopyright is for storing the copyright information of preparing to be applied to watermark;
Second step, for the picture that need to establish watermark creates an Image object, and defines two variablees and is used for storing width and the height of this picture, then utilizes Graphics object of Bitmap Object Creation;
The 3rd step, adds original image in Graphics object to, and all features of original image are comprised to width, height and pixel are all loaded in Graphics object;
The 4th step, calculates the width of drawn copyright information character string, and the array of the font size that circular in definition is good, utilizes MeasureString to calculate the sizes values of qualified first font;
The 5th step, the upright position of character string is made as from height 5% place of picture bottom, set the coordinate on the y direction of principal axis at its place with the height of copyright information character string, by calculating picture center and defining a StringFormat object, StringAlignment is set and makes copyright information be positioned at the center of picture;
The 6th step, creating a black and be 60% is the SolidBrush object that the value of transparency is 153, draw copyright information character string, and make its coordinate position on calculated position, respectively be offset 1px to the right and downwards, in order to realize hatching effect, can create a color is white SolidBrush object again, repeats to draw copyright information character string one time, and to make its coordinate position be directly calculated coordinate position;
The 7th step, preserves the picture that has added watermark, the picture that has added watermark is added to the file of appointment, and discharging Graphic object memory image is file.
The implementation method of above-mentioned a kind of watermark picture, wherein, in described the 5th step, the upright position of character string is made as to height 5% place from picture bottom, refers to that the middle part of character string is positioned at from height 5% place of picture bottom, rather than bottom or top are positioned at from height 5% place of picture bottom.
The implementation method of a kind of watermark picture of the present invention, described method is simply applicable, and user does not need to use photo-editing software to revise picture, directly can pass through website batch modification picture, and can make the position of all picture interpolation watermarks be consistent, thereby save a large amount of edit sessions; This method need to be by third party software in addition, only needs GDI can complete making, and cost of manufacture is low.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of the implementation method of a kind of watermark picture of the present invention.
Embodiment
An implementation method for watermark picture, if Fig. 1 is a kind of schematic flow sheet of implementation method of watermark picture.The first step, first take out original image, read the copyright information that will add, define two character string Strworkingdirectory and Strcopyright, Strworkingdirectory is the folder path at the input and output place of picture, and Strcopyright is for storing the copyright information of preparing to be applied to watermark; Second step, create a secondary blank picture according to the size of original image, for the picture that need to establish watermark creates an Image object, and define two variablees and be used for storing width and the height of this picture, then utilize Graphics object of Bitmap Object Creation; The 3rd step, adds original image in the Graphics object of new establishment, and all features of original image are comprised to width, height and pixel are all loaded in Graphics object; The 4th step, calculates the width of drawn copyright information character string, and the array of the font size that circular in definition is good, utilizes MeasureString to calculate the sizes values of qualified first font; The 5th step, calculate the position of drawn copyright information character string, the upright position of character string is made as from height 5% place of picture bottom, set the coordinate on the y direction of principal axis at its place with the height of copyright information character string, by calculating picture center and defining a StringFormat object, StringAlignment is set and makes copyright information be positioned at the center of picture; The 6th step, draws copyright information twice by two kinds of paintbrush of black and white, realizes hatching effect.First the value that creates a black and be 60%(and be transparency is 153) SolidBrush object, draw copyright information character string, and make its coordinate position on calculated position, respectively be offset 1px to the right and downwards, in order to realize hatching effect, can create a color is white SolidBrush object again, repeat to draw copyright information character string one time, and to make its coordinate position be directly calculated coordinate position; The 7th step, preserves the picture that has added watermark, the picture that has added watermark is added to the file of appointment, and discharging Graphic object memory image is file.
Claims (2)
1. an implementation method for watermark picture, is characterized in that, step is as follows:
The first step, first defines two character string Strworkingdirectory and Strcopyright, the folder path at the input and output place that Strworkingdirectory is picture, and Strcopyright is for storing the copyright information of preparing to be applied to watermark;
Second step, for the picture that need to establish watermark creates an Image object, and defines two variablees and is used for storing width and the height of this picture, then utilizes Graphics object of Bitmap Object Creation;
The 3rd step, adds original image in Graphics object to, and all features of original image are comprised to width, height and pixel are all loaded in Graphics object;
The 4th step, calculates the width of drawn copyright information character string, and the array of the font size that circular in definition is good, utilizes MeasureString to calculate the sizes values of qualified first font;
The 5th step, the upright position of character string is made as from height 5% place of picture bottom, set the coordinate on the y direction of principal axis at its place with the height of copyright information character string, by calculating picture center and defining a StringFormat object, StringAlignment is set and makes copyright information be positioned at the center of picture;
The 6th step, creating a black and be 60% is the SolidBrush object that the value of transparency is 153, draw copyright information character string, and make its coordinate position on calculated position, respectively be offset 1px to the right and downwards, in order to realize hatching effect, can create a color is white SolidBrush object again, repeats to draw copyright information character string one time, and to make its coordinate position be directly calculated coordinate position;
The 7th step, preserves the picture that has added watermark, the picture that has added watermark is added to the file of appointment, and discharging Graphic object memory image is file.
2. the implementation method of a kind of watermark picture as claimed in claim 1, it is characterized in that, in described the 5th step, the upright position of character string is made as from height 5% place of picture bottom, the middle part that refers to character string is positioned at from height 5% place of picture bottom, rather than bottom or top are positioned at from height 5% place of picture bottom.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210474682.0A CN103839217A (en) | 2012-11-21 | 2012-11-21 | Watermark image realization method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210474682.0A CN103839217A (en) | 2012-11-21 | 2012-11-21 | Watermark image realization method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103839217A true CN103839217A (en) | 2014-06-04 |
Family
ID=50802688
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210474682.0A Pending CN103839217A (en) | 2012-11-21 | 2012-11-21 | Watermark image realization method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103839217A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107145770A (en) * | 2017-05-26 | 2017-09-08 | 芯联达信息科技(北京)股份有限公司 | It is a kind of by watermark applications in the method and system of the patient data page of making the rounds of the wards |
CN107909631A (en) * | 2017-11-29 | 2018-04-13 | 商派软件有限公司 | A kind of picture synthetic method |
CN108763880A (en) * | 2018-06-06 | 2018-11-06 | 广西英腾教育科技股份有限公司 | Generation, detection method and the device of file watermark |
-
2012
- 2012-11-21 CN CN201210474682.0A patent/CN103839217A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107145770A (en) * | 2017-05-26 | 2017-09-08 | 芯联达信息科技(北京)股份有限公司 | It is a kind of by watermark applications in the method and system of the patient data page of making the rounds of the wards |
CN107909631A (en) * | 2017-11-29 | 2018-04-13 | 商派软件有限公司 | A kind of picture synthetic method |
CN108763880A (en) * | 2018-06-06 | 2018-11-06 | 广西英腾教育科技股份有限公司 | Generation, detection method and the device of file watermark |
CN108763880B (en) * | 2018-06-06 | 2022-02-11 | 广西英腾教育科技股份有限公司 | Method and device for generating and detecting file watermark |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5307761B2 (en) | Method and system for real-time personalization of electronic images | |
CN110377285B (en) | Method and device for generating page skeleton screen and computer equipment | |
US7688317B2 (en) | Texture mapping 2-D text properties to 3-D text | |
CN107092684A (en) | Image processing method and device, storage medium | |
JP2009525535A5 (en) | ||
CN101071508A (en) | Image processing apparatus, image processing method, and image processing program | |
CN109636885B (en) | Sequential frame animation production method and system for H5 page | |
CN103093437A (en) | Method and device for generating pencil drawing style image | |
CN103729190B (en) | The method that various kinds of media analytic uniform shows on mobile terminals | |
WO2017219643A1 (en) | 3d effect generation method and system for input text, and 3d display method and system for input text | |
JP2011188291A (en) | Image processor and image processing program | |
CN113222874A (en) | Data enhancement method, device and equipment applied to target detection and storage medium | |
JP4419876B2 (en) | Image processing device | |
CN104424174B (en) | Document processing system and document processing method | |
CN115988170A (en) | Method and device for clearly displaying Chinese and English characters in real-time video screen combination in cloud conference | |
CN103839217A (en) | Watermark image realization method | |
WO2022160914A1 (en) | Effect processing method and apparatus, and device and storage medium | |
US20130083071A1 (en) | Image display apparatus, image display method and computer readable recording medium | |
JP2010515131A (en) | Method and system for generating boundaries in the process of rasterizing vector graphics, and method for manufacturing the system | |
JP2010028429A (en) | Image processing apparatus, image processing method, and program | |
US11017505B2 (en) | System and method for applying antialiasing to images | |
TWI309396B (en) | Method for rendering a visible portion of an image | |
CN102592261A (en) | Vector diagram showing method and system | |
CN103337089A (en) | Method for achieving marquee effect of text in 3D (three-dimensional) space | |
JP2005235205A (en) | Compositing with clip-to-self functionality without using shape channel |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20140604 |