Package com.idrsolutions.image.process
Class Watermark
java.lang.Object
com.idrsolutions.image.process.Watermark
- All Implemented Interfaces:
ImageOperation
ImageOperation implementation to add text watermark to an image
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic enum -
Constructor Summary
ConstructorsConstructorDescriptionWatermark(BufferedImage watermarkImage, Watermark.WatermarkPosition pos, AlphaComposite alphaComposite) Watermark(Shape shape, Color color, Watermark.WatermarkPosition pos, AlphaComposite alphaComposite, Watermark.WatermarkShapeProperties properties) Watermark(String text, Color color, Font font, Watermark.WatermarkPosition pos) -
Method Summary
Modifier and TypeMethodDescriptionapply(BufferedImage image) Apply the text representaton of the watermark to the image and return a new BufferedImage instance containing the watermark content
-
Constructor Details
-
Watermark
- Parameters:
text- String text to be displayed as watermark, '\n' will divide watermark across multiple linescolor- Color to be used to represent text watermarkfont- font style to represent text watermarkpos- Enum WatermarkPosition which represents the position of the Watermark for centre or fit to image position
-
Watermark
public Watermark(String text, Color color, Font font, Watermark.WatermarkPosition pos, Rectangle rect) - Parameters:
text- String text to be displayed as watermark, '\n' will divide watermark across multiple linescolor- Color to be used to represent text watermarkfont- font style to represent text watermarkpos- Enum WatermarkPosition which represents the position of the Watermark for centre or fit to image position
-
Watermark
public Watermark(Shape shape, Color color, Watermark.WatermarkPosition pos, AlphaComposite alphaComposite, Watermark.WatermarkShapeProperties properties) -
Watermark
public Watermark(BufferedImage watermarkImage, Watermark.WatermarkPosition pos, AlphaComposite alphaComposite)
-
-
Method Details
-
apply
Apply the text representaton of the watermark to the image and return a new BufferedImage instance containing the watermark content- Specified by:
applyin interfaceImageOperation- Parameters:
image- source image to use- Returns:
- new Bufferedimage containing the watermark content
-