public class CodeWriter
extends java.lang.Object
修飾子とタイプ | フィールドと説明 |
---|---|
static java.lang.String |
VERSION |
コンストラクタと説明 |
---|
CodeWriter(processing.core.PApplet applet)
コンストラクタ
クラスを初期化し、バーコードの書き込み準備を行います。 |
修飾子とタイプ | メソッドと説明 |
---|---|
processing.core.PImage |
encode(java.lang.String src,
com.google.zxing.BarcodeFormat format,
int width,
int height,
boolean appFont,
boolean... appDegit)
バーコード生成
指定された文字列を、指定された大きさでバーコード画像化します。 |
processing.core.PImage |
encode128(java.lang.String src,
int width,
int height,
boolean appFont)
Code128 バーコード生成
指定された文字列を、指定された大きさでCode128として画像化します。 |
processing.core.PImage |
encode39(java.lang.String src,
int width,
int height,
boolean appFont,
boolean... appDegit)
Code39 バーコード生成
指定された文字列を、指定された大きさでCode39として画像化します。 |
processing.core.PImage |
getImage()
バーコード画像取得
画像化されたイメージを取得します。 |
static java.lang.String |
getVersion()
バージョン取得
本ライブラリのバーションを取得します。 |
processing.core.PImage |
resize(int width,
int height)
バーコード拡大縮小
画像化したバーコードを拡大縮小します。 |
public static final java.lang.String VERSION
public CodeWriter(processing.core.PApplet applet)
applet
- PROCESSINGアプレット
import ZxingP5.*;
CodeWriter codeWriter; //Code39_128 Writer
void setup(){
size(400,400);
//インスタンス作成
codeWriter = new CodeWriter(this);
}
void draw(){
background(255);
}
public processing.core.PImage resize(int width, int height)
width
- 画像の横幅height
- 画像の高さ
import ZxingP5.*;
CodeWriter codeWriter; //Code39_128 Writer
PImage pImage; //画像
void setup(){
size(400,400);
//インスタンス作成
codeWriter = new CodeWriter(this);
//画像化
String code = "AB123XY";
if( codeWriter.encode39( code, 150, 50, false ) != null ){
pImage = codeWriter.resize(350, 50);
}
}
void draw(){
background(255);
if( pImage != null ){
image( pImage, 0, 0 );
}
}
public processing.core.PImage encode(java.lang.String src, com.google.zxing.BarcodeFormat format, int width, int height, boolean appFont, boolean... appDegit)
src
- 画像化したい文字列format
- バーコード指定(BarcodeFormat.CODE_39、CODE_128)width
- 画像の横幅(0以上の値)height
- 画像の高さ(0以上の値)appFont
- バーコード文字付加指定(True:付加する False:付加しない)appDegit
- Code39チェックデジット付加除外指示(True:付加する False:除外する)
import ZxingP5.*;
CodeWriter codeWriter; //Code39_128 Writer
PImage pImage; //画像
void setup(){
size(400,400);
//インスタンス作成
codeWriter = new CodeWriter(this);
//画像化
pImage = codeWriter.encode( "AB123XY", BarcodeFormat.CODE_39, 350, 50, true, false );
}
void draw(){
background(255);
if( pImage != null ){
image( pImage, 0, 0 );
}
}
public processing.core.PImage encode128(java.lang.String src, int width, int height, boolean appFont)
src
- 画像化したい文字列width
- 画像の横幅height
- 画像の高さappFont
- バーコード文字付加指定(True:付加する False:付加しない)
import ZxingP5.*;
CodeWriter codeWriter; //Code39_128 Writer
PImage pImage; //画像
void setup(){
size(400,400);
//インスタンス作成
codeWriter = new CodeWriter(this);
//画像化
String code = "AB123XY";
pImage = codeWriter.encode128( code, 350, 50, false );
}
void draw(){
background(255);
if( pImage != null ){
image( pImage, 0, 0 );
}
}
public processing.core.PImage encode39(java.lang.String src, int width, int height, boolean appFont, boolean... appDegit)
src
- 画像化したい文字列width
- 画像の横幅height
- 画像の高さappFont
- バーコード文字付加指定(True:付加する False:付加しない)appDegit
- Code39チェックデジット付加除外指示(True:付加 False:除外)
import ZxingP5.*;
CodeWriter codeWriter; //Code39_128 Writer
PImage pImage; //画像
void setup(){
size(400,400);
//インスタンス作成
codeWriter = new CodeWriter(this);
//画像化
String code = "AB123XY";
pImage = pImage = codeWriter.encode39( code, 350, 50, false, false );
}
void draw(){
background(255);
if( pImage != null ){
image( pImage, 0, 0 );
}
}
public processing.core.PImage getImage()
import ZxingP5.*;
CodeWriter codeWriter; //Code39_128 Writer
PImage pImage; //画像
void setup(){
size(400,400);
//インスタンス作成
codeWriter = new CodeWriter(this);
//画像化
String code = "AB123XY";
if( codeWriter.encode39( code, 350, 50, false ) != null ){
pImage = codeWriter.getImage();
}
}
void draw(){
background(255);
if( pImage != null ){
image( pImage, 0, 0 );
}
}
public static java.lang.String getVersion()
import ZxingP5.*;
void setup(){
size(400,400);
println( CodeWriter.getVersion() );
}
void draw(){
background(255);
}