當前位置:首頁 » 軟體設計 » android生成帶logo的二維碼

android生成帶logo的二維碼

發布時間: 2020-12-29 20:46:19

Ⅰ 如何生成帶logo的參數二維碼生成器

經過測試好用的一個生成二維碼圖片的方法:
/**
* 生成二維碼(QRCode)圖片
* @param content 二維碼圖片的內容
* @param imgPath 生成二維碼圖片完整的路徑
* @param ccbpath 二維碼圖片中間的logo路徑
*/
public static int createQRCode(String content, String imgPath,String ccbPath) {
try {
Qrcode qrcodeHandler = new Qrcode();
qrcodeHandler.setQrcodeErrorCorrect('M');
qrcodeHandler.setQrcodeEncodeMode('B');
qrcodeHandler.setQrcodeVersion(7);

// System.out.println(content);
byte[] contentBytes = content.getBytes("gb2312");
BufferedImage bufImg = new BufferedImage(140, 140,
BufferedImage.TYPE_INT_RGB);
Graphics2D gs = bufImg.createGraphics();

gs.setBackground(Color.WHITE);
gs.clearRect(0, 0, 140, 140);

2
// 設定圖像顏色 > BLACK
gs.setColor(Color.BLACK);
// 設置偏移量 不設置可能導致解析出錯
int pixoff = 2;
// 輸出內容 > 二維碼
if (contentBytes.length > 0 && contentBytes.length < 120) {
boolean[][] www.gzlij.com codeOut =
qrcodeHandler.calQrcode(contentBytes);
for (int i = 0; i < codeOut.length; i++) {
for (int j = 0; j < codeOut.length; j++) {
if (codeOut[j][i]) {
gs.fillRect(j * 3 + pixoff, i * 3 + pixoff, 3, 3);
}
}
}
} else {
System.err.println("QRCode content bytes length = "
+ contentBytes.length + " not in [ 0,120 ]. ");
return -1;
}
Image img = ImageIO.read(new File(ccbPath));
//實例化一個Image對象。
gs.drawImage(img, 55, 55, null);
gs.dispose();
bufImg.flush();

3
//實例化一個Image對象。
gs.drawImage(img, 55, 55, null);
gs.dispose();
bufImg.flush();
// 生成二維碼QRCode圖片
File imgFile = new File(imgPath);
ImageIO.write(bufImg, "png", imgFile);
} catch (Exception e)
{
e.printStackTrace();
return -100;
}
return 0;
}

Ⅱ 怎樣製作帶logo的二維碼名片

蘋果手機可以直接使用二維碼工房Pro,這個應用生成二維碼的功能很強大,支持文本、網內址、名片容等格式,輸入想要生成的內容,一鍵即可創建二維碼,支持嵌入Logo,還有彩碼、各種精美模板、融合二維碼等美化功能。(想了解更多二維碼相關內容,可以關注公眾號二維碼工房,我也可以幫你)

Ⅲ 如何生成帶logo圖片的二維碼用二維碼生成器嗎還是ps

親測可用,望親給好評哦,還有,祝你家小店越做越大

Ⅳ java怎麼生成帶logo二維碼

1、下載生成二維碼所需要的jar包qrcode.jar;
2、直接上生成二維碼的java代碼

//需要導入的包
importjava.awt.Color;
importjava.awt.Graphics2D;
importjava.awt.Image;
importjava.awt.image.BufferedImage;
importjava.io.File;
importjavax.imageio.ImageIO;
importcom.swetake.util.Qrcode;

/**
*生成二維碼(QRCode)圖片
*@paramcontent二維碼圖片的內容
*@paramimgPath生成二維碼圖片完整的路徑
*@paramccbpath二維碼圖片中間的logo路徑
*/
publicstaticintcreateQRCode(Stringcontent,StringimgPath,StringccbPath){
try{
QrcodeqrcodeHandler=newQrcode();
qrcodeHandler.setQrcodeErrorCorrect('M');
qrcodeHandler.setQrcodeEncodeMode('B');
qrcodeHandler.setQrcodeVersion(7);

//System.out.println(content);
byte[]contentBytes=content.getBytes("gb2312");
//構造一個BufferedImage對象設置寬、高
BufferedImagebufImg=newBufferedImage(140,140,BufferedImage.TYPE_INT_RGB);
Graphics2Dgs=bufImg.createGraphics();

gs.setBackground(Color.WHITE);
gs.clearRect(0,0,140,140);

//設定圖像顏色>BLACK
gs.setColor(Color.BLACK);

//設置偏移量不設置可能導致解析出錯
intpixoff=2;
//輸出內容>二維碼
if(contentBytes.length>0&&contentBytes.length<120){
boolean[][]codeOut=qrcodeHandler.calQrcode(contentBytes);
for(inti=0;i<codeOut.length;i++){
for(intj=0;j<codeOut.length;j++){
if(codeOut[j][i]){
gs.fillRect(j*3+pixoff,i*3+pixoff,3,3);
}
}
}
}else{
System.err.println("QRCodecontentbyteslength="
+contentBytes.length+"notin[0,120].");
return-1;
}
Imageimg=ImageIO.read(newFile(ccbPath));//實例化一個Image對象。
gs.drawImage(img,55,55,30,30,null);
gs.dispose();
bufImg.flush();

//生成二維碼QRCode圖片
FileimgFile=newFile(imgPath);
ImageIO.write(bufImg,"png",imgFile);

}catch(Exceptione){
e.printStackTrace();
return-100;
}
return0;
}

來自網友孤獨青鳥的博客

Ⅳ 求一個 二維碼生成器帶logo的

http://sz.ganji.com/fuwu_dian/392699/ 這里有一個,你看一下回 能不能用答

Ⅵ 生成二維碼 並且在二維碼上面加logo 求助

蘋果手機可以直接使用二維碼工房Pro生成帶logo的二維碼名片,這個應用生成內二維碼的功能容很強大,支持文本、網址、名片等格式,輸入想要生成的內容,一鍵即可創建二維碼,支持嵌入Logo,還有彩碼、各種精美模板、融合二維碼等美化功能。不是蘋果手機的話,直接關注它的公眾號也行。

Ⅶ java中生成中間帶logo的二維碼

下載 QRCode ,設置 CLASSPATH、編譯源碼,可以運行的。。。。。。。。。。

2維碼就是有容錯,所以,中間「挖」空一小片不影響識別 。。。。。

Ⅷ 請問哪款Android APP能生成帶自定義logo的二維碼

生成自帶logo的二維碼,倒是可以在網站上進行生成,app沒有見過

Ⅸ 如何生成帶中間LOGO的二維碼

先生成一個二維碼,然後再PS一個LOGO在中間就可以了

Ⅹ 有哪些二維碼生成工具能把 logo 生成到二維碼里

蘋果手機可以下載二維碼工房,它生成二維碼的功能非常強大,可以生成彩碼、加邊框、嵌入Logo等。

熱點內容
美發店認證 發布:2021-03-16 21:43:38 瀏覽:443
物業糾紛原因 發布:2021-03-16 21:42:46 瀏覽:474
全國著名不孕不育醫院 發布:2021-03-16 21:42:24 瀏覽:679
知名明星確診 發布:2021-03-16 21:42:04 瀏覽:14
ipad大專有用嗎 發布:2021-03-16 21:40:58 瀏覽:670
公務員協議班值得嗎 發布:2021-03-16 21:40:00 瀏覽:21
知名書店品牌 發布:2021-03-16 21:39:09 瀏覽:949
q雷授權碼在哪裡買 發布:2021-03-16 21:38:44 瀏覽:852
圖書天貓轉讓 發布:2021-03-16 21:38:26 瀏覽:707
寶寶水杯品牌 發布:2021-03-16 21:35:56 瀏覽:837