import com.aos.zxing4processingdiewald_bardcode.*;
import diewald_bardcode.CONSTANTS.*;
ZXING4Pint zxingcode_size = new ZXING4P(this);
PImage QRCode500;
String content = "http://iad.zhdk.ch";
void setup()
{
size(code_size, code_size);
StringEncodingResult webLink = "http://iad.zhdk.ch";
QRCode = zxing.generateQRCode(webLink, 200, 200);
QRCode.save(dataPath("")+"/"+"qrcodes.jpg");
QRCode = null;
webLink = null;
}
result = Barcode.encode(content, ENCODE.QR_CODE, code_size, code_size, CHARACTER_SET.DEFAULT, ERROR_CORRECTION.DEFAULT);
if( result.encodingFailed() )
{
println( result.getEncodingException() );
} else
{
result.setBgColor(255, 255, 255, 255);
result.setCodeColor(0, 0, 0, 255);
PImage barcode = result.asImage(this);
if ( barcode != null)
image(barcode, 0, 0);
barcode.save("qrcode.jpg");
}
}
void draw()
{
} |