public class EANWriter
extends java.lang.Object
修飾子とタイプ | フィールドと説明 |
---|---|
static java.lang.String |
VERSION |
コンストラクタと説明 |
---|
EANWriter(processing.core.PApplet applet)
コンストラクタ
クラスを初期化し、バーコードの書き込み準備を行います。 |
修飾子とタイプ | メソッドと説明 |
---|---|
processing.core.PImage |
encode(java.lang.String src,
com.google.zxing.BarcodeFormat format,
int width,
int height,
boolean... appFont)
バーコード生成
指定された文字列を、指定された大きさでバーコード画像化します。 |
processing.core.PImage |
encode13(java.lang.String src,
int width,
int height,
boolean... appFont)
EAN13 バーコード生成
指定された文字列を、指定された大きさでバーコード画像化します。 |
processing.core.PImage |
encode8(java.lang.String src,
int width,
int height,
boolean... appFont)
EAN8 バーコード生成
指定された文字列を、指定された大きさでバーコード画像化します。 |
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 EANWriter(processing.core.PApplet applet)
applet
- PROCESSINGアプレット
import ZxingP5.*;
EANWriter eanWriter; //EAN-Code Writer
void setup(){
size(400,400);
//インスタンス作成
eanWriter = new EANWriter(this);
}
void draw(){
background(255);
}
public processing.core.PImage resize(int width, int height)
width
- 画像の横幅(0以上の値)height
- 画像の高さ(0以上の値)
import ZxingP5.*;
EANWriter eanWriter; //EAN-Code Writer
PImage pImage; //画像
void setup(){
size(400,400);
//インスタンス作成
eanWriter = new EANWriter(this);
//画像化
if( eanWriter.encode8( "4501234", 200, 100 ) != null ){
//画像拡大
pImage = eanWriter.resize(300,150);
}
}
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)
src
- 画像化したい文字列format
- バーコード指定(BarcodeFormat.EAN_8、EAN_13)width
- 画像の横幅(0以上の値)height
- 画像の高さ(5以上の値)appFont
- バーコード文字付加指定(True:付加する False:付加しない)
import ZxingP5.*;
EANWriter eanWriter; //EAN-Code Writer
PImage pImage; //画像
void setup(){
size(400,400);
//インスタンス作成
eanWriter = new EANWriter(this);
//画像化
pImage = eanWriter.encode( "450123456789",BarcodeFormat.EAN_13, 200, 100 );
}
void draw(){
background(255);
if( pImage != null ){
image( pImage, 0, 0 );
}
}
public processing.core.PImage encode13(java.lang.String src, int width, int height, boolean... appFont)
src
- 画像化したい文字列width
- 画像の横幅height
- 画像の高さappFont
- バーコード文字付加指定(True:付加する False:付加しない)
import ZxingP5.*;
EANWriter eanWriter; //EAN-Code Writer
PImage pImage; //画像
void setup(){
size(400,400);
//インスタンス作成
eanWriter = new EANWriter(this);
//画像化
pImage = eanWriter.encode13( "450123456789", 200, 100 );
}
void draw(){
background(255);
if( pImage != null ){
image( pImage, 0, 0 );
}
}
public processing.core.PImage encode8(java.lang.String src, int width, int height, boolean... appFont)
src
- 画像化したい文字列width
- 画像の横幅height
- 画像の高さappFont
- バーコード文字付加指定(True:付加する False:付加しない)
import ZxingP5.*;
EANWriter eanWriter; //EAN-Code Writer
PImage pImage; //画像
void setup(){
size(400,400);
//インスタンス作成
eanWriter = new EANWriter(this);
//画像化
pImage = eanWriter.encode8( "4501234", 200, 100 );
}
void draw(){
background(255);
if( pImage != null ){
image( pImage, 0, 0 );
}
}
public processing.core.PImage getImage()
import ZxingP5.*;
EANWriter eanWriter; //EAN-Code Writer
PImage pImage; //画像
void setup(){
size(400,400);
//インスタンス作成
eanWriter = new EANWriter(this);
//画像化
if( eanWriter.encode8( "4501234", 200, 100 ) != null ){
//画像取得
pImage = eanWriter.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( EANWriter.getVersion() );
}
void draw(){
background(255);
}