Giter Site home page Giter Site logo

qrcodelibvbs's Introduction

QRCodeLibVBS

QRCodeLibVBSは、VBScriptで書かれたQRコード生成スクリプトです。
JIS X 0510に基づくモデル2コードシンボルを生成します。

特徴

  • 数字・英数字・8ビットバイト・漢字モードに対応しています
  • 分割QRコードを作成可能です
  • 1bppまたは24bpp BMP、SVG形式で保存可能です
  • 画像の配色(前景色・背景色)を指定可能です

使用方法

例1.最小限のコードを示します。

rem Command Line
CScript.exe QRCode.vbs /data:"Hello World" /out:"qrcode.bmp"
' VBScript

Const FORE_COLOR = "#000000"
Const BACK_COLOR = "#FFFFFF"
Const SCALE = 5

Dim sbls: Set sbls = CreateSymbols(ECR_M, 40, False)
Call sbls.AppendText("Hello World")

' 24bpp bitmap
Call sbls.Item(0).Save24bppDIB("qrcode.bmp", SCALE, FORE_COLOR, BACK_COLOR)

' 1bpp bitmap
Call sbls.Item(0).Save1bppDIB("qrcode.bmp", SCALE, FORE_COLOR, BACK_COLOR)

' SVG
Call sbls.Item(0).SaveSvg("qrcode.svg", SCALE, FORE_COLOR)

例2.分割QRコードの作成例

型番1のデータ量を超える場合に分割し、各QRコードをBMPファイルに保存する方法を示します。

Dim sbls: Set sbls = CreateSymbols(ECR_M, 1, True)
Call sbls.AppendText("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ")

Dim fName
Dim sbl, i
For i = 0 To sbls.Count - 1
    fName = "qrcode" & CStr(i) & ".bmp"
    Call sbls.Item(i).Save24bppDIB(fName, 5, "#000000", "#FFFFFF")
Next

qrcodelibvbs's People

Contributors

yas78 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.