public class Thumbnail extends Object
Title: Thumbnail
Description: Picture Thumbnail
Copyright: Copyright (c) 54powerman@163.com 2005
Company: http://blog.sina.com.cn/u1055000490
| 限定符和类型 | 方法和说明 |
|---|---|
String |
getDestFile()
获取目标文件名 getDestFile.
|
int |
getSrcHeight()
获取图片原始高度 getSrcHeight.
|
int |
getSrcWidth()
获取图片原始宽度 getSrcWidth.
|
static void |
main(String[] args)
The main method.
|
void |
resize(double t)
按照固定的比例缩放图片.
|
void |
resize(int w,
int h)
强制压缩/放大图片到固定的大小.
|
void |
resizeByHeight(int h)
以高度为基准,等比例缩放图片.
|
void |
resizeByWidth(int w)
以宽度为基准,等比例放缩图片.
|
void |
resizeFix(int w,
int h)
按照最大高度限制,生成最大的等比例缩略图.
|
void |
setDestFile(String fileName)
设置目标文件名 setDestFile.
|
public Thumbnail(String fileName, String dest) throws IOException
fileName - Stringdest - the destIOException - Signals that an I/O exception has occurred.public static void main(String[] args) throws Exception
args - the argumentsException - the exceptionpublic void resize(int w,
int h)
throws IOException
w - int 新宽度h - int 新高度IOException - Signals that an I/O exception has occurred.public void resize(double t)
throws IOException
t - double 比例IOException - Signals that an I/O exception has occurred.public void resizeByWidth(int w)
throws IOException
w - int 新宽度IOException - Signals that an I/O exception has occurred.public void resizeByHeight(int h)
throws IOException
h - int 新高度IOException - Signals that an I/O exception has occurred.public void resizeFix(int w,
int h)
throws IOException
w - int 最大宽度h - int 最大高度IOException - Signals that an I/O exception has occurred.public void setDestFile(String fileName) throws Exception
fileName - String 文件名字符串Exception - the exceptionpublic String getDestFile()
public int getSrcWidth()
public int getSrcHeight()
Copyright © 2017. All rights reserved.