第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

請(qǐng)問為什么系統(tǒng)提示path有問題?有大神能幫忙解決一下嗎

package irainbow.zxing;


import java.io.File;

import java.util.HashMap;

import com.google.zxing.BarcodeFormat;

import com.google.zxing.EncodeHintType;

import com.google.zxing.MultiFormatWriter;

import com.google.zxing.client.j2se.MatrixToImageWriter;

import com.google.zxing.common.BitMatrix;

import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;

//生成二維碼

public class creatQRcode {

??

public static ?void main(String[] args){

//定義二維碼的寬度和高度

int width=300;

int height=300;

String format="png";//指定圖片的格式為"png"

String content="rainbow,you must be happy evey day";//定義二維碼的內(nèi)容

//定義二維碼的參數(shù)

HashMap hints=new HashMap();

hints.put(EncodeHintType.CHARACTER_SET,"utf-8");

hints.put(EncodeHintType.ERROR_CORRECTION,ErrorCorrectionLevel.H);

? ? ? ? //設(shè)置容錯(cuò)等級(jí),二維碼糾錯(cuò)等級(jí)為H級(jí),容錯(cuò)等級(jí)越高,容量約小

hints.put(EncodeHintType.MARGIN,5);

? ? ? ? //邊框距離為5

//生成二維碼

try{

? BitMatrix bitMatrix = new MultiFormatWriter().encode(content,BarcodeFormat.QR_CODE,width,height,hints);

? Path file = new File("D:/code/1.png").toPath();//設(shè)置保存路徑

? MatrixToImageWriter.writeToPath(bitMatrix, format,file);//輸出圖像

}?

catch (Exception e) {e.printStackTrace();

}

}

}


正在回答

6 回答

導(dǎo)入path包就行

0 回復(fù) 有任何疑惑可以回復(fù)我~

你path 在報(bào)錯(cuò)看不到嗎 導(dǎo)入io包進(jìn)去就有了

0 回復(fù) 有任何疑惑可以回復(fù)我~

你可能jdk版本過低

0 回復(fù) 有任何疑惑可以回復(fù)我~

你D盤下有沒有目錄code啊,一定要有

0 回復(fù) 有任何疑惑可以回復(fù)我~

想知道你解決了嗎


0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

阿阿阿果阿 提問者

沒有呢
2018-08-08 回復(fù) 有任何疑惑可以回復(fù)我~

https://img1.sycdn.imooc.com//5b604e6c0001fe0408170318.jpg程序是這樣的

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

請(qǐng)問為什么系統(tǒng)提示path有問題?有大神能幫忙解決一下嗎

我要回答 關(guān)注問題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)