달력

06

« 2017/06 »

  •  
  •  
  •  
  •  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  •  

'Zxing'에 해당되는 글 1

  1. 2011.07.19 ZXing Junit Test 예제
2011.07.19 19:46

ZXing Junit Test 예제 Tips2011.07.19 19:46

1) maven

         <repository>
            <id>mvn-adamgent</id>
            <url>http://mvn-adamgent.googlecode.com/svn/maven/release</url>
            <name>Adam Gent Maven Repository</name>
        </repository>


<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>javase</artifactId>
<version>1.6</version>
</dependency>


 
2) code 
 

public class QRCodeWriterTest{

@Test
public void web_Test(){
QRCodeWriter q = new QRCodeWriter();
 try {
  String text = "한글 테스트";
  text = new String(text.getBytes("UTF-8"), "ISO-8859-1");
  BitMatrix bitMatrix = q.encode(text, BarcodeFormat.QR_CODE, 100, 100);
  MatrixToImageWriter.writeToStream(bitMatrix, "png", new FileOutputStream(new File("d:\\qrcode.png")));
 } catch (Exception e) {
  e.printStackTrace();
 }
}
}


신고
TAG
Posted by summerwars


티스토리 툴바