「迅捷java」迅捷路由器初始密码

博主:adminadmin 2022-12-15 01:39:05 73

本篇文章给大家谈谈迅捷java,以及迅捷路由器初始密码对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。

本文目录一览:

java压缩png图片

您转换的是图片的后缀名吧?您这样的方式已经把图片的信息删除了!

您去下载一个java图片压缩器吧

或者直接在Java下编辑代码来实习转换

package com.sun.util.cyw;

import java.awt.Image;

import java.awt.image.BufferedImage;

import java.io.File;

import java.io.FileNotFoundException;

import java.io.FileOutputStream;

import java.io.IOException;

import javax.imageio.ImageIO;

import com.sun.image.codec.jpeg.JPEGCodec;

import com.sun.image.codec.jpeg.JPEGImageEncoder;

/**

* 图片工具类

* 压缩图片大小

* @author Cyw

* @version 1.0

*/

public class ZIPImage {

private File file = null;

private String outPutFilePath;

private String inPutFilePath;

private String inPutFileName;

private boolean autoBuildFileName;

private String outPutFileName;

private int outPutFileWidth = 100; // 默认输出图片宽

private int outPutFileHeight = 100; // 默认输出图片高

private static boolean isScaleZoom = true; // 是否按比例缩放

public ZIPImage() {

outPutFilePath = "";

inPutFilePath = "";

inPutFileName = "";

autoBuildFileName = true;

outPutFileName = "";

}

/**

*

* @param ipfp

* 源文件夹路径

* @param ipfn

* 源文件名

* @param opfp

* 目标文件路径

* @param opfn

* 目标文件名

*/

public ZIPImage(String ipfp, String ipfn, String opfp, String opfn) {

outPutFilePath = opfp;

inPutFilePath = ipfp;

inPutFileName = ipfn;

autoBuildFileName = true;

outPutFileName = opfn;

}

/**

*

* @param ipfp

* 源文件夹路径

* @param ipfn

* 源文件名

* @param opfp

* 目标文件路径

* @param opfn

* 目标文件名

* @param aBFN

* 是否自动生成目标文件名

*/

public ZIPImage(String ipfp, String ipfn, String opfp, String opfn,

boolean aBFN) {

outPutFilePath = opfp;

inPutFilePath = ipfp;

inPutFileName = ipfn;

autoBuildFileName = aBFN;

outPutFileName = opfn;

}

public boolean isAutoBuildFileName() {

return autoBuildFileName;

}

public void setAutoBuildFileName(boolean autoBuildFileName) {

this.autoBuildFileName = autoBuildFileName;

}

public String getInPutFilePath() {

return inPutFilePath;

}

public void setInPutFilePath(String inPutFilePath) {

this.inPutFilePath = inPutFilePath;

}

public String getOutPutFileName() {

return outPutFileName;

}

public void setOutPutFileName(String outPutFileName) {

this.outPutFileName = outPutFileName;

}

public String getOutPutFilePath() {

return outPutFilePath;

}

public void setOutPutFilePath(String outPutFilePath) {

this.outPutFilePath = outPutFilePath;

}

public int getOutPutFileHeight() {

return outPutFileHeight;

}

public void setOutPutFileHeight(int outPutFileHeight) {

this.outPutFileHeight = outPutFileHeight;

}

public int getOutPutFileWidth() {

return outPutFileWidth;

}

public void setOutPutFileWidth(int outPutFileWidth) {

this.outPutFileWidth = outPutFileWidth;

}

public boolean isScaleZoom() {

return isScaleZoom;

}

public void setScaleZoom(boolean isScaleZoom) {

this.isScaleZoom = isScaleZoom;

}

public String getInPutFileName() {

return inPutFileName;

}

public void setInPutFileName(String inPutFileName) {

this.inPutFileName = inPutFileName;

}

/**

* 压缩图片大小

*

* @return boolean

*/

public boolean compressImage() {

boolean flag = false;

try {

if (inPutFilePath.trim().equals("")) {

throw new NullPointerException("源文件夹路径不存在。");

}

if (inPutFileName.trim().equals("")) {

throw new NullPointerException("图片文件路径不存在。");

}

if (outPutFilePath.trim().equals("")) {

throw new NullPointerException("目标文件夹路径地址为空。");

} else {

if (!ZIPImage.mddir(outPutFilePath)) {

throw new FileNotFoundException(outPutFilePath

+ " 文件夹创建失败!");

}

}

if (this.autoBuildFileName) { // 自动生成文件名

String tempFile[] = getFileNameAndExtName(inPutFileName);

outPutFileName = tempFile[0] + "_cyw." + tempFile[1];

compressPic();

} else {

if (outPutFileName.trim().equals("")) {

throw new NullPointerException("目标文件名为空。");

}

compressPic();

}

} catch (Exception e) {

flag = false;

e.printStackTrace();

return flag;

}

return flag;

}

// 图片处理

private void compressPic() throws Exception {

try {

// 获得源文件

file = new File(inPutFilePath + inPutFileName);

if (!file.exists()) {

throw new FileNotFoundException(inPutFilePath + inPutFileName

+ " 文件不存在!");

}

Image img = ImageIO.read(file);

// 判断图片格式是否正确

if (img.getWidth(null) == -1) {

throw new Exception("文件不可读!");

} else {

int newWidth;

int newHeight;

// 判断是否是等比缩放

if (ZIPImage.isScaleZoom == true) {

// 为等比缩放计算输出的图片宽度及高度

double rate1 = ((double) img.getWidth(null))

/ (double) outPutFileWidth + 0.1;

double rate2 = ((double) img.getHeight(null))

/ (double) outPutFileHeight + 0.1;

// 根据缩放比率大的进行缩放控制

double rate = rate1 rate2 ? rate1 : rate2;

newWidth = (int) (((double) img.getWidth(null)) / rate);

newHeight = (int) (((double) img.getHeight(null)) / rate);

} else {

newWidth = outPutFileWidth; // 输出的图片宽度

newHeight = outPutFileHeight; // 输出的图片高度

}

BufferedImage tag = new BufferedImage((int) newWidth,

(int) newHeight, BufferedImage.TYPE_INT_RGB);

/*

* Image.SCALE_SMOOTH 的缩略算法 生成缩略图片的平滑度的 优先级比速度高 生成的图片质量比较好 但速度慢

*/

tag.getGraphics().drawImage(

img.getScaledInstance(newWidth, newHeight,

Image.SCALE_SMOOTH), 0, 0, null);

FileOutputStream out = new FileOutputStream(outPutFilePath

+ outPutFileName);

JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);

encoder.encode(tag);

out.close();

}

} catch (IOException ex) {

ex.printStackTrace();

}

}

/**

* 创建文件夹目录

*

* @param filePath

* @return

* @throws Exception

*/

@SuppressWarnings("unused")

private static boolean mddir(String filePath) throws Exception {

boolean flag = false;

File f = new File(filePath);

if (!f.exists()) {

flag = f.mkdirs();

} else {

flag = true;

}

return flag;

}

/**

* 获得文件名和扩展名

*

* @param fullFileName

* @return

* @throws Exception

*/

private String[] getFileNameAndExtName(String fullFileName)

throws Exception {

String[] fileNames = new String[2];

if (fullFileName.indexOf(".") == -1) {

throw new Exception("源文件名不正确!");

} else {

fileNames[0] = fullFileName.substring(0, fullFileName

.lastIndexOf("."));

fileNames[1] = fullFileName

.substring(fullFileName.lastIndexOf(".") + 1);

}

return fileNames;

}

public Image getSourceImage() throws IOException{

//获得源文件

file = new File(inPutFilePath + inPutFileName);

if (!file.exists()) {

throw new FileNotFoundException(inPutFilePath + inPutFileName

+ " 文件不存在!");

}

Image img = ImageIO.read(file);

return img;

}

/*

* 获得图片大小

* @path :图片路径

*/

public long getPicSize(String path) {

File file = new File(path);

return file.length();

}

}

//下面是测试程序

package com.sun.util.cyw;

import java.awt.Image;

import java.io.IOException;

public class ImageTest {

public static void main(String[] args) throws IOException {

ZIPImage zip=new ZIPImage("d:\\","1.jpg","d:\\test\\","处理后的图片.jpg",false);

zip.setOutPutFileWidth(1000);

zip.setOutPutFileHeight(1000);

Image image=zip.getSourceImage();

long size=zip.getPicSize("d:\\1.jpg");

System.out.println("处理前的图片大小 width:"+image.getWidth(null));

System.out.println("处理前的图片大小 height:"+image.getHeight(null));

System.out.println("处理前的图片容量:"+ size +" bit");

zip.compressImage();

}

}

java实现excel转换prn

电脑上安装一款软件迅捷PDF转换器。

1、首先大家需要在操作的电脑上安装一款软件迅捷PDF转换器。

2、在软件页面中我们可以选择到栏目“PDF转成其它文件”,接下来需要打开这个栏目,这个栏目下就包括了文件转换Excel,也就是我们所需要操作的PDF转换Excel功能。

3、鼠标移动到“添加文件”这里,就可以点击它进入到跳转出来的文件框中找到PDF文件然后将它添加到PDF转换器中,当然添加文件的方法有很多种。

4、文件添加成功后,可以在添加文件后面点击到“全部字样”,在这可以选择输入它的页码范围和勾选到转换的页面。

5、以上步骤都完成之后,点击状态栏中的三角形即可完成PDF文件格式的转换。看到状态栏完成100%了就说明PDF文件转换Excel格式成功了。这时候可以点击后面的打开按钮就可以查看到转换后的Excel文件。

Java怎么把PDF转化成图片

表示不会使用Java将pdf转换成图片,但是要将pdf转换成图片可以使用专业的pdf转换工具啊。

大致的转换方法如下:

打开并运行迅捷pdf转换器,选择PDF转成其他文件中的“转成图片”选项;

点击上方或者是下方的“添加文件”选项,将要转换的pdf添加进来;

文件被添加完成点击“开始转换”按钮,等待一会之后文件就会被转换完成,进行打开查看即可

关于迅捷java和迅捷路由器初始密码的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。

The End

发布于:2022-12-15,除非注明,否则均为首码项目网原创文章,转载请注明出处。