Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

http://reactivision.sourceforge.net

QR-Codes

Library: http://thomasdiewald.at/processing/libraries/diewald_barcode/

QR-Code generieren

Code Block
languagejava
titleBeispiel QR-Code Generieren
collapsetrue
import diewald_bardcode.*;
import diewald_bardcode.CONSTANTS.*;

int code_size = 500;
String content = "http://iad.zhdk.ch";

void setup() 
{
  size(code_size, code_size);

  EncodingResult 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() 
{
}

...