图片压缩与功能实现.pdfVIP

  • 0
  • 0
  • 约4.9千字
  • 约 12页
  • 2026-06-01 发布于北京
  • 举报

本标

文件上传实现的压缩、水印添加等功能

本标

文件上传实现的压缩、水印添加等功能

具体实现

1.裁剪

Imageimg;ImageFiltercropFilter;BufferedImagebi=ImageIO.read(srcImageFile);//源图像intsrcWidth=

bi.getWidth();//源图宽度intsrcHeight=bi.getHeight();//源图高度if(srcWidth=destWidthsrcHeight=

_

destHeight){Imageimage=bi.getScaledInstance(srcWidth,srcHeight,Image.SCALEDEFAULT);cropFilter=

newCropImageFilter(x,y,destWidth,destHeight);img=Toolkit.getDefaultToolkit().createImage(new

FilteredImageSource(image.getSource(),cropF

文档评论(0)

1亿VIP精品文档

相关文档