|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.groupdocs.viewer.handlers.ImageHandler
public class ImageHandler
Provides some image manipulation functionality
Field Summary | |
---|---|
static int |
BOTTOM
|
static int |
BOTTOM_CENTER
|
static int |
CENTER
|
static int |
MIDDLE
|
static int |
MIDDLE_CENTER
|
Constructor Summary | |
---|---|
ImageHandler()
|
Method Summary | |
---|---|
static void |
addCaption(InputStream inputStream,
OutputStream outputStream,
String text,
String color,
Integer fontSize,
int position)
Add caption Adds caption message to the specified position of each page |
static void |
addCaption(String imagePath,
String text,
String color,
Integer fontSize,
int position)
Add caption Adds caption message to the specified position of each page |
static void |
addEvaluationMessage(InputStream inputStream,
OutputStream outputStream)
Add evaluation message Adds evaluation message to the top of each page |
static void |
addEvaluationMessage(String imagePath)
Add evaluation message Adds evaluation message to the top of each page |
static void |
addWatermark(InputStream inputStream,
OutputStream outputStream,
String text,
String color,
Integer fontSize,
String position)
Add watermark |
static void |
addWatermark(String imagePath,
String text,
String color,
Integer fontSize,
String position)
Add watermark |
static Color |
parseColor(String color)
Parse color |
static void |
resize(String imagePath,
int width)
Resize image with desired width On resize image ration is kept |
static void |
resize(String originalImagePath,
String newImagePath,
int width)
Resize image with desired width and store it in new location |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int CENTER
public static final int MIDDLE
public static final int MIDDLE_CENTER
public static final int BOTTOM
public static final int BOTTOM_CENTER
Constructor Detail |
---|
public ImageHandler()
Method Detail |
---|
public static void resize(String imagePath, int width) throws Exception
imagePath
- Path to image filewidth
- New width
Exception
public static void resize(String originalImagePath, String newImagePath, int width) throws Exception
originalImagePath
- Path to original imagenewImagePath
- Path to new image locationwidth
- New width
Exception
public static void addWatermark(String imagePath, String text, String color, Integer fontSize, String position)
imagePath
- absolute path to image filetext
- watermark textcolor
- watermark colorfontSize
- watermark font sizeposition
- watermark positionpublic static void addWatermark(InputStream inputStream, OutputStream outputStream, String text, String color, Integer fontSize, String position)
inputStream
- file to readoutputStream
- file to writetext
- watermark textcolor
- watermark colorfontSize
- watermark font sizeposition
- watermark positionpublic static void addEvaluationMessage(String imagePath)
imagePath
- absolute path to image filepublic static void addEvaluationMessage(InputStream inputStream, OutputStream outputStream)
inputStream
- file to readoutputStream
- file to writepublic static void addCaption(String imagePath, String text, String color, Integer fontSize, int position)
imagePath
- absolute path to image filetext
- messagecolor
- color (null for default)fontSize
- font size (null for default)position
- position on page where message will be addedpublic static void addCaption(InputStream inputStream, OutputStream outputStream, String text, String color, Integer fontSize, int position)
inputStream
- file to readoutputStream
- file to writetext
- messagecolor
- color (null for default)fontSize
- font size (null for default)position
- position on page where message will be addedpublic static Color parseColor(String color)
color
- string color
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |