修飾子とタイプ | フィールドと説明 |
---|---|
static java.lang.String |
VERSION |
コンストラクタと説明 |
---|
ITFP5Writer(processing.core.PApplet applet)
コンストラクタ
クラスを初期化し、バーコードの書き込み準備を行います。 |
修飾子とタイプ | メソッドと説明 |
---|---|
processing.core.PImage |
encode(java.lang.String src,
int width,
int height,
boolean appFont,
boolean... appBar)
バーコード生成
指定された文字列を、指定された大きさでバーコード画像化します。 |
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 ITFP5Writer(processing.core.PApplet applet)
applet
- PROCESSINGアプレット
import ZxingP5.*;
ITFP5Writer itfWriter; //ITF-Code Writer
void setup(){
size(400,400);
//インスタンス作成
itfWriter = new ITFP5Writer(this);
}
void draw(){
background(255);
}
public processing.core.PImage resize(int width, int height)
width
- 画像の横幅height
- 画像の高さ
import ZxingP5.*;
ITFP5Writer itfWriter; //ITF-Code Writer
PImage pImage; //画像
void setup(){
size(400,400);
//インスタンス作成
itfWriter = new ITFP5Writer(this);
//画像化
if( itfWriter.encode( "0123456789012", 100, 50 ) != null ){
//画像を拡大
pImage = itfWriter.resize(200,100);
}
}
void draw(){
background(255);
if( pImage != null ){
image( pImage, 0, 0 );
}
}
public processing.core.PImage encode(java.lang.String src, int width, int height, boolean appFont, boolean... appBar)
src
- 画像化したい文字列width
- 画像の横幅(6文字なら90以上、14文字なら160以上、16文字なら180以上)height
- 画像の高さ(0以上の値)appFont
- バーコード文字付加指定(True:付加する False:付加しない)appBar
- ベアラーバー付加指定(True:付加する False:付加しない)
import ZxingP5.*;
ITFP5Writer itfWriter; //ITF-Code Writer
PImage pImage; //画像
void setup(){
size(400,400);
//インスタンス作成
itfWriter = new ITFP5Writer(this);
//画像化
pImage = itfWriter.encode( "0123456789012", 200, 100, true, true );
}
void draw(){
background(255);
if( pImage != null ){
image( pImage, 0, 0 );
}
}
public processing.core.PImage getImage()
import ZxingP5.*;
ITFP5Writer itfWriter; //ITF-Code Writerr
PImage pImage; //画像
void setup(){
size(400,400);
//インスタンス作成
itfWriter = new ITFP5Writer(this);
//画像化
if( itfWriter.encode( "01234", 200, 100, true, true ) != null ){
//ITF画像を取得
pImage = itfWriter.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( ITFP5Writer.getVersion() );
}
void draw(){
background(255);
}