public class ImageTool
extends java.lang.Object
Constructor and Description |
---|
ImageTool() |
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args) |
static java.io.File |
resizeImage(java.io.File imagePath,
int maxsize,
java.lang.String format,
java.lang.String outDir)
Resize an image:
The generated file's name: resized_[name]_[maxsize].[format]
|
static byte[] |
resizeToJPG(byte[] orig,
int width) |
static byte[] |
resizeToPNG(byte[] orig,
int width) |
static byte[] |
text2image(java.lang.String text,
java.lang.String fontName,
int fontSize,
int width,
int height,
int posX,
int posY,
java.lang.String format) |
static byte[] |
text2jpg(java.lang.String text,
int textSize,
int width,
int height,
int posX,
int posY) |
static byte[] |
text2png(java.lang.String text,
int textSize,
int width,
int height,
int posX,
int posY) |
public static java.io.File resizeImage(java.io.File imagePath, int maxsize, java.lang.String format, java.lang.String outDir)
Resize an image: The generated file's name: resized_[name]_[maxsize].[format]
imagePath
- Source imagemaxsize
- Output width/height size (fit/scale the image)format
- Output image format "JPG" "PNG"...outDir
- Output directory to save the filepublic static byte[] resizeToPNG(byte[] orig, int width) throws java.lang.Exception
java.lang.Exception
public static byte[] resizeToJPG(byte[] orig, int width) throws java.lang.Exception
java.lang.Exception
public static byte[] text2image(java.lang.String text, java.lang.String fontName, int fontSize, int width, int height, int posX, int posY, java.lang.String format)
public static byte[] text2png(java.lang.String text, int textSize, int width, int height, int posX, int posY)
public static byte[] text2jpg(java.lang.String text, int textSize, int width, int height, int posX, int posY)
public static void main(java.lang.String[] args)
Copyright (c)2006-2014 Simplicite Software. All Rights Reserved.