public.javadoc.org.spincast.plugins.watermarker.SpincastImageWatermarkerBuilder.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spincast-website Show documentation
Show all versions of spincast-website Show documentation
Source code for the https://www.spincast.org website.
SpincastImageWatermarkerBuilder (org.spincast:spincast-framework 1.0.0 API)
org.spincast.plugins.watermarker
Interface SpincastImageWatermarkerBuilder
-
- All Known Implementing Classes:
- SpincastImageWatermarkerBuilderDefault
public interface SpincastImageWatermarkerBuilder
-
-
Method Summary
-
-
Method Detail
-
text
SpincastImageWatermarkerBuilder text(String text)
The text to use as the watermark. Calling this will
remove any image set using #image(File)
.
By default, this text is the root URL of the
application (for example: "https://www.example.com").
-
text
SpincastImageWatermarkerBuilder text(String text,
Font font)
-
text
SpincastImageWatermarkerBuilder text(String text,
Color color)
-
text
SpincastImageWatermarkerBuilder text(String text,
Color color,
Font font)
-
text
SpincastImageWatermarkerBuilder text(Color color)
-
text
SpincastImageWatermarkerBuilder text(Color color,
Font font)
-
text
SpincastImageWatermarkerBuilder text(Font font)
-
backgroundColor
SpincastImageWatermarkerBuilder backgroundColor(Color color)
The background color to use for the watermark. This
is only useful when using a text
watermark.
Default to white.
You can set this to null
to get a
transparent background!
-
image
SpincastImageWatermarkerBuilder image(String imageFilePath)
The image on the file system to use as the watermark.
Calling this will remove any text set using {@link #text(String).
Empty by default.
- Throws:
an
- exception if the specified file doesn't exist
or is not a valid image.
-
image
SpincastImageWatermarkerBuilder image(String imageFilePath,
boolean onClasspath)
The image to use as the watermark.
Calling this will remove any text set using {@link #text(String).
Empty by default.
- Parameters:
onClasspath
- if true
, the imageFilePath
will be considered as a classpath path. Otherwise, the image will
be taken from the file system.
- Throws:
an
- exception if the specified file doesn't exist
or is not a valid image.
-
position
SpincastImageWatermarkerBuilder position(SpincastWatermarkPosition position)
The position where the watermark will be created
on the image. No margin.
Defaults to .
-
position
SpincastImageWatermarkerBuilder position(SpincastWatermarkPosition position,
int margin)
The position where the watermark will be created
on the image.
Defaults to .
- Parameters:
The
- margin (in pixels) between the watermark and the edge of the
image.
-
opacity
SpincastImageWatermarkerBuilder opacity(float opacity)
The opacity of the watermark.
Between 0.0 and 1.0.
Defaults to 1.0, no transparency.
-
widthPercent
SpincastImageWatermarkerBuilder widthPercent(int percentageWidth)
The width of the watermark. Must be an
integer between 1 and 100.
Defaults to 50.
-
border
SpincastImageWatermarkerBuilder border(int widthInPixels,
Color color)
The border to add around the watermark.
Set the widthInPixels
to 0 to prevent any border
to be added.
Default to a 5 pixels black border.
- Parameters:
color
- Can be null
: will be black then.
-
build
SpincastImageWatermarker build()
Creates the actual SpincastImageWatermarker
.
Copyright © 2019. All rights reserved.