|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
java.lang.Object grapes.image.Images
public class Images
图片操作(GIF、JPEG[PNG、BMP] 水印、缩放、裁切)
嵌套类摘要 | |
---|---|
static class |
Images.ImagesDatum
成正比缩放基数 |
static class |
Images.ImagesNameGenre
命名保存类型 |
字段摘要 | |
---|---|
static java.lang.String |
IMAGES
|
static int |
QUALITY
|
构造方法摘要 | |
---|---|
Images()
|
方法摘要 | |
---|---|
boolean |
crop(java.lang.String srcFile,
java.lang.String background,
int cutX,
int cutY,
int cropWidth,
int cropHeight)
|
boolean |
crop(java.lang.String srcFile,
java.lang.String background,
int posX,
int posY,
int destWidth,
int destHeight,
int degree,
int cutX,
int cutY,
int cropWidth,
int cropHeight)
|
boolean |
crop(java.lang.String srcFile,
java.lang.String destFile,
java.lang.String background,
int cutX,
int cutY,
int cropWidth,
int cropHeight)
|
boolean |
crop(java.lang.String srcFile,
java.lang.String destFile,
java.lang.String background,
int posX,
int posY,
int destWidth,
int destHeight,
int degree,
int cutX,
int cutY,
int cropWidth,
int cropHeight)
|
boolean |
crop(java.lang.String srcFile,
java.lang.String destFile,
java.lang.String background,
int quality,
int posX,
int posY,
int destWidth,
int destHeight,
int degree,
int cutX,
int cutY,
int cropWidth,
int cropHeight)
|
boolean |
crop(java.lang.String srcFile,
java.lang.String destFile,
java.lang.String background,
int quality,
int posX,
int posY,
int destWidth,
int destHeight,
int degree,
int cutX,
int cutY,
int cropWidth,
int cropHeight,
boolean isGMK)
图片裁切(构建顺序:先GMK 再Gif 最后JPEG) 前端JS组件建议采用: CropZoom插件(原图可移动,可旋转,可缩放) |
static java.lang.String |
getFormatName(java.lang.Object obj)
获取图片格式 |
grapes.image.ImagesData |
getImagesData()
|
static Images.ImagesDatum |
getImagesDatum(java.lang.String str)
|
static Images.ImagesNameGenre |
getImagesNameGenre(java.lang.String str)
|
static boolean |
isImage(java.io.File file)
判断文件类型是否为图片(编码+固定范围) |
static boolean |
isSame(java.lang.Object obj1,
java.lang.Object obj2)
判断是否为同一张图片 |
static boolean |
isShow(java.awt.image.BufferedImage bufferedImage)
判断是否能正常显示(JPEG[PNG、BMP]) |
static boolean |
isShow(com.gif4j.GifImage gifImage)
判断是否能正常显示(GIF) |
static boolean |
isShow(java.lang.Object obj)
判断是否能正常显示(GIF、JPEG[PNG、BMP]) |
static com.gif4j.GifImage |
readGIFImage(java.lang.Object obj)
读取图片(GIF) |
static java.awt.image.BufferedImage |
readJPEGImage(java.lang.Object obj)
读取图片(JPEG[PNG、BMP]) |
static boolean |
readURLGIFImage(java.lang.Object obj,
java.lang.Object destObj,
Images.ImagesNameGenre genre)
读取网络图片(GIF)并保存输出[仅支持HTTP协议] |
static com.gif4j.GifImage |
readURLGIFImage(java.lang.String urlFile)
读取网络图片(GIF)[仅支持HTTP协议] |
static boolean |
readURLImage(java.lang.String urlFile,
java.lang.String destPath,
Images.ImagesNameGenre genre)
读取网络图片(GIF、JPEG[PNG、BMP])并保存输出[仅支持HTTP协议] |
static boolean |
readURLJPEGImage(java.lang.Object obj,
java.lang.Object destObj,
Images.ImagesNameGenre genre)
读取网络图片(JPEG[PNG、BMP])并保存输出[仅支持HTTP协议] |
static java.awt.image.BufferedImage |
readURLJPEGImage(java.lang.String urlFile)
读取网络图片(JPEG[PNG、BMP])[仅支持HTTP协议] |
void |
setImagesData(grapes.image.ImagesData imagesData)
|
boolean |
watermark(java.lang.String srcFile,
java.lang.String background,
int position,
int posX,
int posY,
int alpha,
boolean isflag)
|
boolean |
watermark(java.lang.String srcFile,
java.lang.String destFile,
java.lang.String background,
int position,
int posX,
int posY,
int alpha,
boolean isflag)
|
boolean |
watermark(java.lang.String srcFile,
java.lang.String destFile,
java.lang.String background,
int quality,
int position,
int posX,
int posY,
int degree,
int alpha,
boolean isflag)
|
boolean |
watermark(java.lang.String srcFile,
java.lang.String destFile,
java.lang.String background,
int quality,
int position,
int posX,
int posY,
int degree,
int alpha,
boolean isflag,
boolean isGMK)
添加水印(构建顺序:先Gif 再GMK 最后JPEG) |
static boolean |
writeImage(java.awt.image.BufferedImage bufferedImage,
java.lang.Object destObj)
|
static boolean |
writeImage(java.awt.image.BufferedImage bfi,
java.lang.Object destObj,
int quality)
输出图片(JPEG[PNG、BMP]) |
static boolean |
writeImage(com.gif4j.GifImage gifImage,
java.lang.Object destObj)
输出图片(GIF) |
boolean |
zoom(java.lang.String srcFile,
java.lang.String background,
int destWidth,
int destHeight,
int degree,
boolean isamp,
boolean isratio,
Images.ImagesDatum datum)
|
boolean |
zoom(java.lang.String srcFile,
java.lang.String destFile,
java.lang.String background,
int destWidth,
int destHeight,
int degree,
boolean isamp,
boolean isratio,
Images.ImagesDatum datum)
|
boolean |
zoom(java.lang.String srcFile,
java.lang.String destFile,
java.lang.String background,
int quality,
int destWidth,
int destHeight,
int degree,
boolean isamp,
boolean isratio,
Images.ImagesDatum datum)
|
boolean |
zoom(java.lang.String srcFile,
java.lang.String destFile,
java.lang.String background,
int quality,
int destWidth,
int destHeight,
int degree,
boolean isamp,
boolean isratio,
Images.ImagesDatum datum,
boolean isGMK)
图片缩放(构建顺序:先GMK 再Gif 最后JPEG) |
从类 java.lang.Object 继承的方法 |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
字段详细信息 |
---|
public static final java.lang.String IMAGES
public static final int QUALITY
构造方法详细信息 |
---|
public Images()
方法详细信息 |
---|
public grapes.image.ImagesData getImagesData()
public void setImagesData(grapes.image.ImagesData imagesData)
public static Images.ImagesDatum getImagesDatum(java.lang.String str)
public static Images.ImagesNameGenre getImagesNameGenre(java.lang.String str)
public static java.lang.String getFormatName(java.lang.Object obj)
obj
- 文件对象(地址)
public static boolean isImage(java.io.File file)
file
- 当前文件
public static boolean isSame(java.lang.Object obj1, java.lang.Object obj2)
obj1
- 原图对象1(地址)obj2
- 原图对象2(地址)
public static boolean isShow(java.lang.Object obj)
obj
- 文件对象(地址)
public static boolean isShow(com.gif4j.GifImage gifImage)
gifImage
- 图片对象
public static boolean isShow(java.awt.image.BufferedImage bufferedImage)
bufferedImage
- 图片对象
public static boolean writeImage(com.gif4j.GifImage gifImage, java.lang.Object destObj)
gifImage
- 图片对象destObj
- 保存对象(路径、文件、输出流:response.getOutputStream())
public static boolean writeImage(java.awt.image.BufferedImage bfi, java.lang.Object destObj, int quality)
bfi
- 图片对象destObj
- 保存对象(路径、文件、输出流:response.getOutputStream())quality
- 图片质量(0-100 默认85)
public static boolean writeImage(java.awt.image.BufferedImage bufferedImage, java.lang.Object destObj)
public static com.gif4j.GifImage readGIFImage(java.lang.Object obj)
obj
- 图片对象(地址、File、InputStream)
public static java.awt.image.BufferedImage readJPEGImage(java.lang.Object obj)
obj
- 图片对象(地址、File、InputStream)
public static com.gif4j.GifImage readURLGIFImage(java.lang.String urlFile)
urlFile
- 网络地址
public static java.awt.image.BufferedImage readURLJPEGImage(java.lang.String urlFile)
urlFile
- 网络地址
public static boolean readURLGIFImage(java.lang.Object obj, java.lang.Object destObj, Images.ImagesNameGenre genre)
obj
- 原图对象(网络地址)destObj
- 保存对象(地址、输出流:response.getOutputStream())genre
- 名称保存类型
public static boolean readURLJPEGImage(java.lang.Object obj, java.lang.Object destObj, Images.ImagesNameGenre genre)
obj
- 原图对象(网络地址)destObj
- 保存对象(地址、输出流:response.getOutputStream())genre
- 名称保存类型
public static boolean readURLImage(java.lang.String urlFile, java.lang.String destPath, Images.ImagesNameGenre genre)
urlFile
- 网络地址destPath
- 保存目录genre
- 保存名称类型
public boolean watermark(java.lang.String srcFile, java.lang.String destFile, java.lang.String background, int quality, int position, int posX, int posY, int degree, int alpha, boolean isflag, boolean isGMK)
srcFile
- 原图地址destFile
- 保存地址background
- 空白背景色quality
- 图片质量(0-100 默认85)position
- 定位方式(-1-10,-1为自定义、0为随机、10为平铺)posX
- 水印X轴坐标(定位方式为-1时启用)posY
- 水印Y轴坐标(定位方式为-1时启用)degree
- 旋转角度alpha
- 透明度isflag
- 文字水印isGMK
- 启用GraphicsMagick(默认启用)
public boolean watermark(java.lang.String srcFile, java.lang.String destFile, java.lang.String background, int quality, int position, int posX, int posY, int degree, int alpha, boolean isflag)
public boolean watermark(java.lang.String srcFile, java.lang.String destFile, java.lang.String background, int position, int posX, int posY, int alpha, boolean isflag)
public boolean watermark(java.lang.String srcFile, java.lang.String background, int position, int posX, int posY, int alpha, boolean isflag)
public boolean zoom(java.lang.String srcFile, java.lang.String destFile, java.lang.String background, int quality, int destWidth, int destHeight, int degree, boolean isamp, boolean isratio, Images.ImagesDatum datum, boolean isGMK)
srcFile
- 原图地址destFile
- 保存地址background
- 空白背景色quality
- 图片质量(0-100 默认85)destWidth
- 缩放后图片宽度destHeight
- 缩放后图像高度degree
- 旋转角度isamp
- 是否放大处理(小于指定宽高则进行放大)isratio
- 是否成正比缩放datum
- 成正比缩放基数(auto:自动, width、height:以宽度还是高度为准成正比缩放)isGMK
- 启用GraphicsMagick(默认启用)
public boolean zoom(java.lang.String srcFile, java.lang.String destFile, java.lang.String background, int quality, int destWidth, int destHeight, int degree, boolean isamp, boolean isratio, Images.ImagesDatum datum)
public boolean zoom(java.lang.String srcFile, java.lang.String destFile, java.lang.String background, int destWidth, int destHeight, int degree, boolean isamp, boolean isratio, Images.ImagesDatum datum)
public boolean zoom(java.lang.String srcFile, java.lang.String background, int destWidth, int destHeight, int degree, boolean isamp, boolean isratio, Images.ImagesDatum datum)
public boolean crop(java.lang.String srcFile, java.lang.String destFile, java.lang.String background, int quality, int posX, int posY, int destWidth, int destHeight, int degree, int cutX, int cutY, int cropWidth, int cropHeight, boolean isGMK)
srcFile
- 原图地址destFile
- 保存地址background
- 空白背景色quality
- 图片质量(0-100 默认85)posX
- 原图X轴坐标(默认0,相对于编辑区,为计算起始点在原图上的坐标服务)posY
- 原图Y轴坐标(默认0,相对于编辑区,为计算起始点在原图上的坐标服务)destWidth
- 原图缩放宽度(大于0时管用)destHeight
- 原图缩放高度(大于0时管用)degree
- 原图旋转角度cutX
- 裁切X轴坐标(起始点,相对于编辑区)cutY
- 裁切Y轴坐标(起始点,相对于编辑区)cropWidth
- 裁切宽度(终止点)cropHeight
- 裁切高度(终止点)isGMK
- 启用GraphicsMagick(默认启用)
public boolean crop(java.lang.String srcFile, java.lang.String destFile, java.lang.String background, int quality, int posX, int posY, int destWidth, int destHeight, int degree, int cutX, int cutY, int cropWidth, int cropHeight)
public boolean crop(java.lang.String srcFile, java.lang.String destFile, java.lang.String background, int posX, int posY, int destWidth, int destHeight, int degree, int cutX, int cutY, int cropWidth, int cropHeight)
public boolean crop(java.lang.String srcFile, java.lang.String destFile, java.lang.String background, int cutX, int cutY, int cropWidth, int cropHeight)
public boolean crop(java.lang.String srcFile, java.lang.String background, int posX, int posY, int destWidth, int destHeight, int degree, int cutX, int cutY, int cropWidth, int cropHeight)
public boolean crop(java.lang.String srcFile, java.lang.String background, int cutX, int cutY, int cropWidth, int cropHeight)
|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |