StrokeScribe Barcode Generator - Documentation
The documentation is modified to reflect changes made in version 5.
API Reference
Properties
Basic properties
Barcode design properties
Barcode-specific properties
- AztecECL
- AztecMinLayers
- CheckDigit
- CodabarStartCharacter
- CodabarStopCharacter
- CodabarHasCheckDigit
- Code11CheckDigits
- Code39HasCheckDigit
- NWRatio
- CompactPDF417
- DataMatrixMinSize
- ITF14BearerBox
- ITF14BearerWidth
- ISBN10
- PDF417Cols / PDF417Rows
- PDF417ErrLevel
- PDF417HorzQuietZone / PDF417VertQuietZone
- PDF417ModuleAspectRatio
- PDF417SymbolAspectRatio
- QrECL
- QrMinVersion
- GSSeparator
Error control properties
Methods
Barcode-specific methods
Structured Append mode properties and methods
Image output methods
Basic Properties
Alphabet
Specifies the barcode type. Must be one of:
- CODE128A (=0)
- CODE128B (=1)
- CODE128C (=2)
- EAN13 (=3)
- I2OF5 (=4)
- CODE128 (=5)
- PDF417 (=6)
- ITF14 (=7)
- DATAMATRIX (=8)
- CODE93 (=9)
- EAN8 (=12)
- CODABAR (=13)
- CODE39 (=14)
- CODE39FULLASCII (=15)
- CODE11 (=16)
- EAN128 (=17)
- QRCODE (=25)
- IMB (=28) (Intelligent Mail Barcode)
- GS1DATAMATRIX (=30)
- RM4SCC (=31) - Royal Mail barcode
- UPCA (=32) - UPC-A
- AZTEC (=33) - Aztec Code
- ISBN (=34) - ISBN-13. ISBN-10 needs additional conversion
- UPCE (=36) - UPC-E
- MICROQR (=37) - Micro QR Code (available starting from v.4.5.1)
- EAN5 (=38) - EAN-5 (5-digit supplemental barcode)
- AUSPOST (=39) - Australia Post 4-State Barcode (available starting from v.4.7.0)
Examples
Strokescribe1.Alphabet=EAN13
Strokescribe1.Alphabet=CODE128A
Strokescribe1.Alphabet=DATAMATRIX
Text
The data to be encoded in the barcode. This property accepts data of the following OLE types:
- VT_BSTR - a text string in Unicode format;
- VT_UI1|VT_ARRAY - an array of bytes. See Array Manipulation in MSDN for more details;
- VT_UI2|VT_ARRAY, VT_I2|VT_ARRAY - an array of two-byte words *;
- VT_R4, VT_R8 - floating point values. Supported but not recommended;
- VT_I1, VT_UI1, VT_I2, VT_UI2, VT_I4, VT_UI4, VT_I8, VT_UI8, VT_INT, VT_UINT, VT_BOOL - these are 8-, 16-, 32-, 64-bit integer values. Values of these types are automatically converted to a text string and stored in the barcode as text.
Remarks
A note to VB.NET and c# users: the .NET framework's ActiveX wrapper hides the Text property and maps it to CtlText. This property cannot be modified using the standard property sheet in Visual Studio. Use the ASCII property instead.
The information below is provided for 2D-barcode users. Linear barcodes encode only ASCII characters and are not affected by mapping from Unicode to national code pages.
Applications pass text data to the ActiveX in Unicode format. To be stored in a barcode, 16-bit Unicode characters must be converted to UTF-8 encoding (good for mobile barcode readers) or mapped to a 8-bit national code page (see Code Page Identifiers table at MSDN).
To convert Unicode data to UTF-8, set CodePage=65001.
If the UTF-8 encoding is not enabled, the ActiveX will map Unicode characters (16-bit) to national code page characters (8-bit). A valid code page identifier must be specified in the CodePage property.
Some Unicode characters may be mapped to more than one code page. For example, the Cyrillic letter А is 0x0410 in Unicode, 0xC0 in Windows-1251 and 0x80 in Code Page 866.
ASCII characters from the range of [0..0x7F] have the same codes both in Unicode and national code pages.
StrokeScribe versions prior to 4.3.1 did the Unicode-to-multibyte conversion only based on system's code page (or system locale, can be changed in the Control Panel). In other words, this did not allow to encode Arabic characters on PC with Hebrew system locale because Hebrew code page doesn't contain these characters. In the newer versions, the user must specify the correct code page identifier to map Unicode characters into the right national code page.
The code page, which identifier is specified in the CodePage property, must contain all characters passed in the Unicode string. If, for example, CodePage=1253 (Greek/Windows), and if the Text property contains some Arabic characters, the ActiveX will indicate an "unmappable character" Error.
2D barcodes (QR Code, Data Matrix, Aztec) allow to store raw byte arrays. The CodePage property must be set to -1 to disable code page mapping and leave these bytes as they are. Otherwise, the byte values in the range of [0x80..0xFF] will be treated as Unicode characters in the range of [0x0080..0x00FF] and mapped to the currently selected code page. For additional details, see the ProcessTilde property description.
Warning: When an array of two-byte words (VT_UI2|VT_ARRAY or VT_I2|VT_ARRAY) is passed to the Text property, and if a valid code page identifier is specified in the CodePage property, each word will be treated as a Unicode character and mapped to the selected code page. If CodePage=-1, the code page translation is disabled and these values will be treated as bytes - the most significant byte will be ignored and only LSBs will be stored in the barcode.
Floating point values (VT_R4 and VT_R8) are converted to text strings using VarBstrFromR4 and VarBstrFromR8 with LCID set to LANG_NEUTRAL. The user should convert these values to text in the application (instead of passing them to the ActiveX) to get the desired formatting.
A short summary:
1. Always check the receiving party's requirements about code page(s) you must use in 2D barcodes.
2. To map non-ASCII Unicode characters to a particular national code page, use the CodePage property. By default, the code page of the current thread (CodePage=3) is used to map character codes.
3. To disable code page mapping for byte arrays and Tilde sequences, set CodePage=-1.
4. To encode Cyrillic, Arabic, Hebrew or Chinese characters in one barcode or to make national characters readable on smartphones, set CodePage=65001.
5. If you are working only with linear barcodes or using only 0..9, A..Z, a..z and ASCII control characters, leave the CodePage property intact.
Examples
Strokescribe1.Alphabet = EAN13
Strokescribe1.Text="222333444555"
How to define byte values using tilde:
Strokescribe1.Alphabet = DATAMATRIX
Strokescribe1.ProcessTilde = True
Strokescribe1.CodePage = -1
Strokescribe1.Text="~x80~x81~x82" ' The barcode will store 80 81 82 (hex)
An example of UTF-8 encoding:
Strokescribe1.Alphabet = QRCODE
Strokescribe1.CodePage=65001
Strokescribe1.Text="Кириллица"
' The barcode will store: d0 9a d0 b8 d1 80 d0 b8 d0 bb d0 bb d0 b8 d1 86 d0 b0 (hex)
How to map Unicode characters to a national code page:
StrokeScribe1.Alphabet = DATAMATRIX
StrokeScribe1.CodePage = 1256 ' Windows Arabic code page
StrokeScribe1.Text = "تجربة" ' A barcode scanner will output: CA CC D1 C8 C9 (hex)
How to store an array of raw bytes in a 2D barcode:
Dim arr(1 To 3) As Byte
arr(1) = &HA1
arr(2) = &HB2
arr(3) = &HC3
Strokescribe1.Alphabet = AZTEC
StrokeScribe1.CodePage = -1
StrokeScribe1.Text = arr ' The barcode will store A1 B2 C3 (hex)
ASCII
This is a replacement for the Text property to use the ActiveX in .NET applications. The .NET framework's ActiveX wrapper hides the original Text property and maps it to CtlText. The CtlText property cannot be modified using the standard property sheet in Visual Studio.
Remarks
The property is available starting from version 4.3.8.
The property does not accept byte arrays.
Example
StrokeScribe1.ASCII = "12345678"
TextBelow
Defines an alternative label text below the barcode instead of standard human-readable representation of encoded data.
Example
Specifying an alternative text label below the barcode:StrokeScribe1.Alphabet = CODE128
StrokeScribe1.Text = "12345678"
StrokeScribe1.TextBelow = "Item 1"

Enabled
When Enabled=false, the ActiveX does not show the Properties dialog after being double-clicked.
Example
StrokeScribe1.Enabled = false
Version
Reports the current version of StrokeScribe ActiveX / StrokeScribe Class.
Example
ver = StrokeScribe1.Version
MsgBox ver

ProcessTilde
If the property is set to True, the tilde processing for the data is enabled. For example, ASCII codes ~d065 and ~x41 both encode the letter 'A'.
Example

StrokeScribe1.Alphabet = CODE128
StrokeScribe1.ProcessTilde = True
StrokeSribe1.Text = "~d065 ~d066 ~d067 ~x41 ~x42 ~x43"
Remarks
To disable code page mapping for byte arrays and tilde and sequences, set CodePage=-1.
To encode a Unicode character, use the ~Xyyyy sequence: ~X1234.
ECI
Assigns the Extended Channel Interpretation code to a 2D barcode.
The typical use is to indicate the character set or code page of the encoded data.
The valid codes are 0, 3..30.
The default value is 0.
When the default value is specified, no ECI information is inserted into the barcode.
Example
StrokeScribe1.Alphabet = PDF417
StrokeScribe1.ECI = 22
StrokeScribe1.CodePage = -1
StrokeScribe1.Text = "АБВГДЕ"
BitmapW/BitmapH
These properties return the minimum width/height of the barcode in pixels.
Remarks
To produce best looking pictures, specify the image width as a multiple of BitmapW for linear barcodes and height as a multiple of BitmapH for 2D barcodes.
Example
StrokeScribe1.Alphabet = EAN13
StrokeScribe1.Text = "123456789012"
StrokeScribe1.SavePicture "c:\bar.bmp", BMP, StrokeScribe1.BitmapW, StrokeScribe1.BitmapW / 2
ModulePixelsX/ModulePixelsY
The width and height of each barcode module (or bar) in pixels. To fix the module size, both of these properties must be nonzero.
These properties are 0 by default and module size is calculated automatically to fit the bitmap size (when saving by SavePicture) or the size of ActiveX window.
Remarks
If the barcode dimensions are larger than the bitmap size, you will receive the error #212 (The loss of resolution).
Example 1
Each bar of barcode will have 3px width and 150px height:
StrokeScribe1.ModulePixelsX = 3
StrokeScribe1.ModulePixelsY = 150
StrokeScribe1.Alphabet = CODE128
StrokeScribe1.Text = "ABC"
StrokeScribe1.SavePicture "c:\bar.bmp", BMP, 300, 200
Example 2
Each module of QR Code will have 3px width and 3px height:
StrokeScribe1.ModulePixelsX = 3
StrokeScribe1.ModulePixelsY = 3
StrokeScribe1.Alphabet = QRCODE
StrokeScribe1.Text = "ABC"
StrokeScribe1.SavePicture "c:\bar.bmp", BMP, 100, 100
ZebraBits
Returns the bit pattern of the current barcode image. 1 represents black modules, 0 represents white modules.
This property is useful in implementing a custom barcode drawing method (for example, creating a barcode for CNC).
Remarks
This property is fully supported only in commercial versions of the barcode generator. The demo version allows to produce bit patterns only for linear barcodes that contain up to 5 characters and 2D barcodes that contain up to 10 bytes.
Example
StrokeScribe1.Alphabet = QRCODE
StrokeScribe1.Text = "123"
dim s as string
s = StrokeScribe1.ZebraBits
MsgBox s
The principle of operation
111111100010101111111<CR>
100000101010101000001<CR>
101110101011001011101<CR>
101110100000101011101<CR>
101110101111101011101<CR>
100000101110001000001<CR>
111111101010101111111<CR>
000000001000000000000<CR>
110100110011101110110<CR>
111011011111010100001<CR>
000101100011001111010<CR>
001111000000111110000<CR>
010100101101011100011<CR>
000000001010011111000<CR>
111111101001101010000<CR>
100000100110001101001<CR>
101110100110111001111<CR>
101110101000011101011<CR>
101110100011011011101<CR>
100000101111100001010<CR>
111111101000010011100
This 21x21 barcode is described by a group of 21 sub-strings separated by ASCII <CR> codes.
The first substring represents the topmost horizontal line of black and white modules. The first "1" corresponds to the top-left square black module.
The last "1" of the first sub-string corresponds to the top-right square black module.

This EAN-13 code is described by a single sequence of bits. There is no CR-separated sub-strings. The first "1" in the string represents the leftmost black bar of the barcode.

1010010011011110100111010
1100010000101001000101010
1001000111010011100101100
11011011001001000101
FontOut
Returns a text string that is intended to display the barcode using specialized TrueType font.
The StrokeScribe 2D TrueType font is supplied with StrokeScribe ActiveX starting from version 4.4.1. The following barcodes are supported: Data Matrix, Aztec, QR Code.
The StrokeScribe 1D TrueType font is supplied with StrokeScribe ActiveX starting from version 4.4.2. This font displays all linear barcodes excluding ITF-14 and mailing barcodes.
The StrokeScribe PDF417 TrueType font is supplied with StrokeScribe ActiveX starting from version 4.5.5. To use this font in Microsoft Word, go here.
Remarks
This property is fully supported only by commercial version of the barcode generator. The demo version allows to use the property for linear barcodes that contain up to 5 characters and 2D barcodes that contain up to 10 bytes.
Example (Microsoft Word)
Dim sel As Selection
Set sel = Selection
sel.ParagraphFormat.LineSpacingRule = wdLineSpaceSingle
sel.ParagraphFormat.SpaceAfter = 0
sel.ParagraphFormat.SpaceBefore = 0
sel.ParagraphFormat.Alignment = wdAlignParagraphLeft
sel.Font.Name = "StrokeScribe 2D"
sel.Font.Size = 28
Dim ss As StrokeScribeClass
Set ss = CreateObject("STROKESCRIBE.StrokeScribeClass.1")
ss.Alphabet = DATAMATRIX
ss.Text = "123ABCD"
sel.Text = ss.FontOut
sel.Collapse Direction:=wdCollapseEnd
This is the text string taken from the FontOut property. With Arial or Times font applied, it looks like groups of ASCII characters with <CR><LF> placed between them: | And this is how the same text string looks like after applying the barcode font: | |
VKq
QGp
ZTk
RPp
ePq
XZj
eOu
TNv
XIk
eHv
SZs
bQl
Yfm
ffv
| ![]() |
CodePage
The identifier of a national code page.
Basically, the data to be stored in the barcode is passed into the ActiveX as a Unicode string or as a byte array (see the Text property for details). 16-bit Unicode characters need be converted to UTF-8 encoding or mapped to a 8-bit national code page.
To map Unicode characters to a national code page, a valid code page identifier should be specified in the CodePage property. By default (CodePage=3), the code page of the current thread is used.
Remarks
The code page mapping should be disabled (CodePage=-1) if an array of raw bytes is passed to the Text property to prevent data corruption.
The mapping should also be disabled if byte values are specified in tilde sequences. Otherwise, byte values in the range of [0x80..0xFF] will be treated as Unicode characters and mapped to the currently selected code page.
Byte values in the range of [0x00..0x7F] aren't changed by the mapping algorithm because ASCII characters (A..Z, a..z, 0..9 and control characters) have the same codes in Unicode and in national code pages.
Because a choice of code pages may be available for the same Unicode characters, the value of CodePage should be explicitly set by user. For example, Cyrillic users may choose between CP-1251 (Cyrillic/Windows), CP-866 (Cyrillic/DOS), CP-10007 (Cyrillic/Mac) and CP-20866 (KOI8-R) where the same characters may have different codes.
The exact code page identifier value may depend on reading software/scanner requirements.
NOTE: If you are working only with linear barcodes (EAN-13, CODE 128) or using only ASCII codes (A..Z, a..z, 0..9) and control characters like <CR>, <LF> or <TAB>, do not change this property.
The property is available starting from v.4.3.1.
Examples
StrokeScribe1.Alphabet = DATAMATRIX
StrokeScribe1.CodePage = 1251 ' This will map Unicode characters to
' the Windows/Cyrillic code page
StrokeScribe1.Text = "АБВГДЕ" ' The Unicode data is: 0x0410, 0x0411, 0x0412, 0x0413,
' 0x0414, 0x0415 (16-bit, hexadecimal)
' The barcode will store: C0 C1 C2 C3 C4 C5 (hexadecimal)
' The Unicode character codes are mapped to the same characters in CP-1251
The Arabic code page encodes different symbols with the same codes:
StrokeScribe1.Alphabet = DATAMATRIX
StrokeScribe1.CodePage = 1256 ' This will map Unicode characters to the
' Windows/Arabic code page
StrokeScribe1.Text = "تجربة" ' A barcode scanner will output: CA CC D1 C8 C9 (hex)
An UTF-8 barcode:
StrokeScribe1.Alphabet = QRCODE
StrokeScribe1.CodePage = 65001
StrokeScribe1.Text = "تجربة"
An error will be indicated if some characters cannot be mapped:
StrokeScribe1.Alphabet = DATAMATRIX
StrokeScribe1.CodePage = 1251 ' This will map Unicode characters to
' the Windows/Cyrillic code page
StrokeScribe1.Text = "تجربة" ' Cyrillic code page doesn't contain Arabic characters
If StrokeScribe1.Error Then ' An "unmappable character" error will be indicated
MsgBox ss.ErrorDescription
End If
To encode a byte array, the code page mapping should be disabled to prevent data corruption. This is also useful when the data is pre-encoded in UTF8 or previously translated into a national code page:
Dim arr(1 To 3) As Byte
arr(1) = &HA1
arr(2) = &HB2
arr(3) = &HC3
StrokeScribe1.CodePage = -1
StrokeScribe1.Text = arr ' The barcode will store: A1 B2 C3 (hexadecimal)
OR
StrokeScribe1.CodePage = -1
StrokeScribe1.ProcessTilde = True
StrokeScribe1.Text = "~xc1~xe2~xf3" ' The barcode will store: C1, E2, F3
Error Control
Error
Contains result code of the latest property assignment or method call.
Error code | Short description | Possible cause of the error |
---|---|---|
30001 | A character cannot be encoded using this barcode type | This typically means you are trying to encode a non-Latin character in CODE 128 or a non-digit character in EAN barcode. Also check the CodePage property value. |
30002 | The string is too long | This means the supplied text string exceeds the data capacity of the selected barcode type. For example, you cannot encode 500 characters in CODE 128 on 10KB in Data Matrix/Aztec/QR. |
30004 | Bad data size | Wrong source data length when encoding EAN barcodes, postal barcodes, GS1 AIs. For example, you cannot encode a 5-digit string in EAN13. |
30005 | Bad check digit | The check digit you have supplied in the source data for EAN13/EAN8/EAN5 barcode is incorrect. |
30007 | Bad parameter | You have specified an incorrect value for a property or a parameter value in a method call. |
30008 | Bad data | This typically means a malformed AI value in GS1 barcode, an incorrectly specified ISBN registrant range or an incorrectly formatted Royal Mail data string. |
30009 | Internal error | A memory or other system resource related error |
30010 | Invalid code page | An invalid value specified in the CodePage property. |
30011 | Unencodable character | A character cannot be encoded in the currently selected code page. Check the CodePage property. |
30012 | File I/O error | You have specified a bad path for the SavePicture call or you are trying to re-write a file which is currently in use. |
30013 | Resolution loss | The image size you have specifier in the SavePicture call cannot fit the barcode. |
Example
See the ErrorDescription property.ErrorDescription
Contains the error description string for the code returned by the Error property.
Example
If StrokeScribe1.Error <> 0 Then
MsgBox StrokeScribe1.ErrorDescription
End If
Barcode Design
ShowText
Controls the visibility of the human-readable text below the barcode image. The text is visible by default.
This property does not affect EAN-13 barodes.Example
Strokescribe1.ShowText=false
FontColor
Gets or sets the color of the barcode modules.
Example
See the BkgndColor property.
BkgndColor
Gets or sets the background color for barcode image.
Example
StrokeScribe1.FontColor = RGB(0, 0, 255)
StrokeScribe1.BkgndColor = RGB(255, 255, 0)

VBorderPercent
A size of whitespace appended at top and bottom of the 1D barcode, measured in percent of barcode height. The default value is 5 (5%).
Example
StrokeScribe1.VBorderPercent = 0
OR StrokeScribe1.VBorderPercent = 30

FontAntialiasing
When set to False, disables font smoothing for text labels displayed below linear and ITF-14 barcodes. Font antialiasing is enabled by default for on-screen barcode rendering, for BMP24, PNG, JPG and for WMF/EMF picture formats and can be disabled using this property.
Remarks
For monochrome BMP and GIF pictures, font antialiasing is disabled starting from v.4.2.
Remarks
StrokeScribe1.Alphabet = CODE128
StrokeScribe1.Text = "123ABC"
StrokeScribe1.FontAntialiasing = False
Err = StrokeScribe1.SavePicture ("code-128.jpg", JPG, 1000, 500)
If Err Then
MsgBox StrokeScribe1.ErrorDescription
End If
FontName
Sets the font name used in drawing the text label below the barcode.
Remarks
This property is not available in demo version.
Example
See FontSize property.
FontSize
Sets the font size (in percent of barcode height) used to draw the text label below the barcode.
Remarks
This property is not available in demo version.
Example
StrokeScribe1.Alphabet = CODE128B
StrokeScribe1.Text = "ABCDEF"
StrokeScribe1.FontSize = 40
StrokeScribe1.FontName = "Lucida Console"

Rotation
Sets the barcode rotation angle. The value must be a multiply of 90.
Example

StrokeScribe1.Rotation = 90
HBorderSize
Sets the quiet zone size at the left and right sides of 1D barcode. This value is measured in number of additional bars what can fill the quiet zone. The default value is 5 and allowed range is [0..50].
Remarks
This property is not available in demo version.
Example
StrokeScribe1.HBorderSize = 30

QuietZone2D
Changes the quiet zone size for 2D barcodes. The value is measured in the number of additional modules that can fill the quiet zone. The default value is 1 (the quiet zone size is equal to 1 module) and the range of allowed values is [0..50].
Example
StrokeScribe1.Alphabet=DATAMATRIX
StrokeScribe1.QuietZone2D = 3 ' The quiet zone size is equal to 3 barcode modules

TextJustify
If set to True, justifies the text label as shown on (1). If you prefer the text formatting shown on (2), set the property value to False.
The default value is True.
Example
StrokeScribe1.Alphabet = CODE128
StrokeScribe1.Text = "1234567890"
StrokeScribe1.TextJustify = False

Transparent
If set to True, a barcode background will not be filled with the color specified in the BkgndColor property.
This property affects the GetPictureHandle(), SavePicture(), GetPicture(), GetPictureArray() methods when creating EMF images and it is intended to produce transparent metafiles.
Example
StrokeScribe1.Transparent = True
StrokeScribe1.SavePicture "barcode.emf", EMF, 300, 200
Example (MS Excel)
StrokeScribe1.ShapeRange.Fill.Transparency = 1
StrokeScribe1.Transparent = True
Barcode-specific Properties
CheckDigit
Contains the automatically calculated check digit value for 1D barcode symbologies (EAN-13, CODE 128, CODE93).
Example
StrokeScribe1.Text = "111111111111"
StrokeScribe1.Alphabet = EAN13
MsgBox "EAN-13 Check Digit = " + Str$(StrokeScribe1.CheckDigit)

ITF14BearerBox
Changes the bearer type for ITF-14 barcodes. If ITF14BearerBox=True, the rectangular bearer is displayed. If ITF14BearerBox=False, the linear bearer is displayed at the top/bottom sides of the barcode.
Example
StrokeScribe1.Alphabet = ITF14
StrokeScribe1.Text = "1234567890123"
StrokeScribe1.ITF14BearerBox = True

ITF14BearerWidth
Changes the bearer width for ITF-14 barcodes. The value must be in the range of [1..10] and it's measured in the number of narrow modules (i.e. 10 means the bearer width is equal the width of 10 narrow modules).
Example
StrokeScribe1.Alphabet = ITF14
StrokeScribe1.Text = "1234567890123"
StrokeScribe1.ITF14BearerBox = True
StrokeScribe1.ITF14BearerWidth = 3

NWRatio
This property controls the narrow:wide ratio (the proportion btw. wide and narrow bar widths) of I2OF5, ITF-14 and CODE39 barcodes.
The value must be in the range of [2..3], the default value is 2.
When NWRatio=2, the wide:narrow ratio is 2:1. When NWRatio=3, the wide:narrow ratio is 3:1.
Example
StrokeScribe1.Alphabet = I2OF5
StrokeScribe1.NWRatio = 3
CodabarStartCharacter/
CodabarStopCharacter
These properties allow to set the start and stop symbols for CODABAR. The value must be one of the following: A, B, C, D, T, N, *, E.
Example
StrokeScribe1.Alphabet = CODABAR
StrokeScribe1.CodabarStartCharacter = "N"
StrokeScribe1.CodabarStopCharacter = "*"

CodabarHasCheckDigit
If set to True, enables automatic calculation of the optional MOD-16 check digit for CODABAR.
Example
StrokeScribe1.Alphabet = CODABAR
StrokeScribe1.CodabarHasCheckDigit = True
Code39HasCheckDigit
If set to True, enables automatic calculation of optional MOD-43 check digit for CODE 39.
Example
StrokeScribe1.Alphabet = CODE39
StrokeScribe1.Code39HasCheckDigit = True
Code11CheckDigits
If Code11CheckDigits=1, enables automatic calculation of the first check digit for CODE 11. If Code11CheckDigits=2, enables automatic calculation of two check digits.
Having at least one check digit in CODE 11 barcodes is highly recommended. The second check digit calculation is recommended for barcodes that contain 10 or more characters.
The default value is 1. You can switch off the auto-calculation by setting this property value to 0.
Setting the property value to 3 enables the automatic switching between one or two check digits for short (<10) and long barcodes respectively. Please check your barcode scanner settings before using this property.
Example
StrokeScribe1.Alphabet = CODE11
StrokeScribe1.Code11CheckDigits = 2
PDF417ErrLevel
If in range of [0..8], forces the level of error correction to the user-specified value. If set to -1, the barcode genertor will automatically use the optimal correction level for the current barcode.
The value of 8 gives the best data protection but increases the barcode size.
The value of 0 gives the weakest data protection level and smallest barcode size.
Remarks
It's not recommended to change this value unless you are really understand how the error correction works.
This property is not available in demo version of the barcode generator.
Examples
StrokeScribe1.PDF417ErrLevel = 8 ' max. error correction
OR StrokeScribe1.PDF417ErrLevel = 1 ' weak error correction
OR StrokeScribe1.PDF417ErrLevel = -1 ' automatic error correction level
On the picture - the same barcode, but with different error correction levels:

PDF417Cols
PDF417Rows
The properies fix the number of rows and data columns in PDF417. The number of rows must be in the range of [1..90] and the number of data columns must be in the range of [1..30].
The value of 0 turns on automatic size calculation. The default value is 0 for both properties.
Example
StrokeScribe1.Alphabet = PDF417
StrokeScribe1.PDF417Cols = 1
StrokeScribe1.PDF417Rows = 20
OR StrokeScribe2.Alphabet = PDF417
StrokeScribe2.PDF417Cols = 3
StrokeScribe2.PDF417Rows = 7

QrECL
In the QR Code, there are four error correction levels allowing recovery of 7%, 15%, 25% and 30% of a damaged QR CODE:
- L = 0
- M = 1
- Q = 2
- H = 3
The default value for this property is L.
MICRO QR Code: The ECL=H is not available. M1 matrices support only error detection (ECL=L must be specified). M2 and M3 matrices support L and M error correction levels. M4 matrices support all ECL levels excluding H.
Example
StrokeScribe1.Alphabet = QRCODE
StrokeScribe1.Text = "abcdef"
StrokeScribe1.QrECL = H
StrokeScribe1.QrECL = L ![]() | StrokeScribe1.QrECL = H ![]() |
QrMinVersion
Allows to fix the minimum version (the minimum matrix size) of a QR Code symbol.
The relationship between version numbers and barcode sizes (measured in modules) is following:
- Version 1 - 21x21 (this is the smallest possible size)
- Version 2 - 25x25
- Version 3 - 29x29
- ...
- Version 10 - 57x57
- ...
- Version 20 - 97x97
- ...
- Version 30 - 137x137
- ...
- Version 40 - 177x177 (the largest QR Code size)
QR Code, Version 1: ![]() The matrix size is 21x21. | QR Code, Version 2: ![]() The matrix size is 25x25. |
Remarks
Setting the QrMinVersion to any value larger than 1 will limit the minimum barcode size even it is possible to create a smaller barcode that fits the data.
If the version number specified in QrMinVersion does not provide enough barcode capacity to store the data, the matrix size will be automatically increased to fit the data.
When generating Micro QR barcodes, the property accepts only values in the range [1..4].
Example
StrokeScribe1.QrMinVersion=11
StrokeScribe1.Text="a" ' The 61x61 QR CODE is generated
' (regardless the data can be stored in the 21x21 matrix)
AztecECL
The desired error correction level (in percent of the symbol capacity) to use in Aztec barcode generation.
The value must be in the range of [5..95]. The default value is 23 (23% of symbol capacity).
Example
StrokeScribe1.Alphabet = AZTEC
StrokeScribe1.Text = "abcdef"
StrokeScribe1.AztecECL = 50
Remarks
This property is not available in demo version of the barcode generator.
AztecMinLayers
The property fixes the minimum matrix size for Aztec barcodes.
The value must be in the range of [1..32]. The default value is 1.
Remarks
This property is not available in demo version of the barcode generator.
Example
StrokeScribe1.Alphabet = AZTEC
StrokeScribe1.AztecMinLayers=3
StrokeScribe1.Text="a" ' The 3-layer Aztec barcode is generated
' (regardless the data can be stored in 1-layer barcode)
1-layer Aztec Code:

2-layer Aztec Code:

3-layer Aztec Code:

32-layer Aztec Code:

DataMatrixMinSize
Limits the minimum matrix size of Data Matrix barcodes.
The value must be one of the following:
8, 10, 12, 14, 16, 18, 20, 22, 24, 28, 32, 36, 40, 44, 48, 56, 64, 72, 80, 88, 96, 108, 120, 132
Example
StrokeScribe1.Alphabet = DATAMATRIX
StrokeScribe1.DataMatrixMinSize=48
StrokeScribe1.Text="a"
Data Matrix, 8x8:

Data Matrix, 48x48:

Data Matrix, 132x132:

Please note: the values used by this property are the "Data region" sizes shown on the picture below. Setting the DataMatrixMinSize to 8 will produce a 10x10-module barcode and DataMatrixMinSize=88 will produce a 96x96-module barcode:

ISBN10
Enables ISBN-10 numbers processing by the ActiveX. If set to True, ISBN-10 numbers will be accepted and converted to ISBN-13 by appending the EAN prefix (978) and EAN check digit. By default, ISBN10=False.
Example
StrokeScribe1.Alphabet = ISBN
StrokeScribe1.ISBN10 = True
StrokeScribe1.Text="303480190" ' If only first 9 digits of
' ISBN-10 are specified,
' the check digit will be
' automatically calculated.
If StrokeScribe1.Error Then
MsgBox StrokeScribe1.ErrorDescription
End If
CompactPDF417
When the Alphabet=PDF417 and the CompactPDF417 property is set to True, a Compact PDF417 symbol is created. Compact PDF417 doesn't contain a column of indicator codewords at the right and the stop pattern at the right is reduced to only one bar. Use this property only for clean environments where the barcode cannot be damaged.
Example
StrokeScribe1.Alphabet = PDF417
StrokeScribe1.CompactPDF417 = True
Remarks
This property is available in commercial versions of StrokeScribe starting from v4.2.
Compact PDF417: ![]() | Normal PDF417 symbol: ![]() |
PDF417ModuleAspectRatio
Allows to set the desired height:width ratio for PDF417 modules.
The default value is 3 (the height:width ratio is 3:1).
Example
StrokeScribe1.Alphabet = PDF417
StrokeScribe1.PDF417ModuleAspectRatio = 4
How the module's aspect ratio is measured. This is a standard ratio of 3:1:

This PDF417 symbol has the module aspect ratio of 5:1. The aspect ratio of 4 and more is recommended if the error correction level is less than the recommended minimum:

Remarks
This property is available in commercial versions of StrokeScribe starting from v4.2.
PDF417SymbolAspectRatio
When obtaining bitmap size for PDF417 using BitmapW/BitmapH properties, set the PDF417SymbolAspectRatio to indicate the desired aspect ratio of PDF417 symbol (including quiet zones).
For example, if you want to know minimum bitmap size that fits the PDF417 picture with width:height ratio of 5:1, specify PDF417SymbolAspectRatio = 5. For width:height ratio of 1:2, specify PDF417SymbolAspectRatio = 0.5.
After the PDF417SymbolAspectRatio property value is set, BitmapW and BitmapH will return the size of smallest possible bitmap able to store the barcode image. You can proportionally scale these values to get a bigger image. Any other arbitrary values of width and height will result unneeded whitespaces at the barcode sides (see image size selection notes for SavePicture).
PDF417 aspect ratio includes left and right quiet zone sizes (see HBorderSize) and top/bottom border size (see VBorderPercent).
The default aspect ratio is 2:1.
The property is ignored when PDF417Cols or PDF417Rows is set.
Remarks
This property is available starting from v4.2.
Example
StrokeScribe1.Alphabet = PDF417
StrokeScribe1.Text = "12345ABC"
StrokeScribe1.PDF417SymbolAspectRatio = 0.5 ' the width:height ratio = 1:2
StrokeScribe1.SavePicture "c:\pdf417-tall.bmp", BMP, _
StrokeScribe1.BitmapW, StrokeScribe1.BitmapH
StrokeScribe1.PDF417SymbolAspectRatio = 3 ' the width:height ratio = 3:1
StrokeScribe1.SavePicture "c:\pdf417-wide.bmp", BMP, _
StrokeScribe1.BitmapW*5, StrokeScribe1.BitmapH*5
A wide PDF417 symbol with PDF417SymbolAspectRatio=3 (the width:height ratio of the symbol is 3:1):

A tall PDF417 with PDF417SymbolAspectRatio=0.5 (the width:height ratio of the symbol is 1:2):

PDF417HorzQuietZone PDF417VertQuietZone
Both vertical and horizontal quiet zones of PDF417 barcode are specified as multiples of the module width. For example, if PDF417HorzQuietZone=5, the left and the right quiet zones will have the size equal to the width of 5 modules.
The minimum value allowed by the standards is 2.
Example
StrokeScribe1.Alphabet = PDF417
StrokeScribe1.Text = "ABCDEF"
StrokeScribe1.BkgndColor = RGB(255, 255, 0)
' the width:height ratio of the barcode is 2:1
StrokeScribe1.PDF417SymbolAspectRatio = 2
' the width:height ratio of barcode modules is 3:1
StrokeScribe1.PDF417ModuleAspectRatio = 3
StrokeScribe1.PDF417HorzQuietZone = 10 ' the left and right quiet zones will
' have the width of 10 modules (10x)
StrokeScribe1.PDF417VertQuietZone = 3 ' the vertical quiet zones will have
' the height of 3X
ww = StrokeScribe1.BitmapW * 2 ' the width and height (in pixels) of
' a smallest possible bitmap to fit the barcode
hh = StrokeScribe1.BitmapH * 2 ' the picture is 2x scaled up
rc = StrokeScribe1.SavePicture("c:\pdf417.bmp", BMP, ww, hh)
If rc > 0 Then
MsgBox StrokeScribe1.ErrorDescription
End If
A PDF417 barcode with 2X quiet zones:

A PDF417 barcode with 10X horizontal quiet zones and 3X vertical quiet zones:

Remarks
This property is available starting from v4.3.2.
GSSeparator
When set to False, the GS1 Data Matrix barcodes use FNC1 as a separator character for variable-length AIs. The ASCII GS codes (29 decimal) from the user-supplied data are internally converted to FNC1.
When set to True, the GS1 Data Matrix barcodes use ASCII GS as a separator character for variable-length AIs. The ASCII GS codes from the user-supplied data are encoded in the barcode as they are.
The default value is False.
Example
StrokeScribe1.Alphabet = GS1DATAMATRIX
StrokeScribe1.GSSeparator = True
StrokeScribe1.Text = "10ABC123" & Chr(29) & "3151000035"
Remarks
This property is available starting from v5.2.27.
Barcode-specific Methods
EanCheckDigit
The EanCheckDigit function calculates the EAN check digit for a given numeric string.
Syntax
- Function EanCheckDigit(Text As String) As String
Parameters:
- Text - The numeric string.
Return value
A string containing the EAN check digit for the specified input string. The function returns an empty string in case of error.
Example
StrokeScribe1.Alphabet = EAN128
AI = "01" ' the Application Identifier of EAN-14 in EAN-128 coding system
Code = "3001234567890"
CS = StrokeScribe1.EanCheckDigit(Code) ' The check digit value is "6"
StrokeScribe1.Text = AI + Code + CS

Structured Append Mode Properties and Methods
SaCount
The number of barcodes in a Structured Append sequence.
Must be in the range of [1..16] for QR Code and [1..26] for Aztec code. The default value for this property is 0 (which means no structured append mode presence).
Example
See SaID and CalcQrSaParity.
Remarks
This property works with QR Code and Aztec code.
SaPos
Identifies the barcode position in the Structured Append sequence.
Must be in the range of [1..SaCount]. The default value for this property is 0 (which means no structured append mode presence).
To produce a Structured Append sequence of 3 barcodes, set the SaCount property to 3 for each barcode in the sequence, and set SaPos=1 for the first barcode, SaPos=2 for the second barcode and SaPos=3 for the third barcode. After scanning, the data stored in these barcodes will be concatenated in this order.
Example
See SaID and CalcQrSaParity.
Remarks
This property works with QR Code and Aztec code.
SaParity/SaID
Please note: starting from v.4.1.6, the SaParity property is deprecated, use SaID instead. StrokeScribe will continue to accept the SaParity values when it's statically embedded into a Word or Excel document, but the property will made unavailable for all programming languages in next releases of StrokeScribe.
Identifies the particular Structured Append sequence. Helps the scanner to assemble a sequence of barcodes if more than one sequence of barcodes appears at the scanner's field of view.
For Aztec Code, it's a user-selectable numeric value in range of 0..2147483647.
For QR Code, the sequence ID must be calculated by XORing of all bytes stored in the sequence. See CalcQrSaParity method for automatic parity value calculation.
Example
Two Structured Append sequences of Aztec codes. The first sequence of 3 Aztec codes encodes "ABCDEFGHI" and has the sequence ID=12345. The second sequence of barcodes encodes "123456" and has the sequence ID=678. It's doesn't matter that they are printed so closely. Different sequence IDs and correctly specified position numbers help the scanner to read these sequences in the right way.

' The first sequence of 3 Aztec barcodes, encodes ABCDEFGHI
StrokeScribe1.SaCount=3 ' 3 barcodes in the sequence
StrokeScribe1.SaPos=1 ' This is the first barcode in the sequence
StrokeScribe1.SaID=12345 ' Sequence ID must be the same for all barcodes
StrokeScribe1.Text="ABC"' The part of original text string is encoded in the first barcode
StrokeScribe2.SaCount=3
StrokeScribe2.SaPos=2 ' This is the second barcode in the sequence
StrokeScribe2.SaID=12345
StrokeScribe2.Text="DEF" ' Another part of the text is encoded in the second barcode
StrokeScribe3.SaCount=3
StrokeScribe3.SaPos=3 ' This is the third barcode in the sequence
StrokeScribe3.SaID=12345
StrokeScribe3.Text="GHI"
' The second sequence of 2 Aztec barcodes, encodes 123456
StrokeScribe4.SaCount=2 ' An another sequence of 2 barcodes
StrokeScribe4.SaPos=1 ' This is the first barcode in the sequence
StrokeScribe4.SaID=678 ' The ID of this group is any numeric value that differs from
' other sequence IDs printed on this page
StrokeScribe4.Text="123"
StrokeScribe5.SaCount=2
StrokeScribe6.SaPos=2 ' This is the second barcode in the sequence
StrokeScribe7.SaID=678
StrokeScribe8.Text="456"
CalcSaParity
CalcQrSaParity
Please note: starting from v.4.1.6, the CalcSaParity property is deprecated, use CalcQrSaParity instead. The CalcSaParity method will be removed in next releases of StrokeScribe ActiveX.
The CalcQrSaParity method calculates the parity value (by XORing of all data bytes contained in the sequence) which must be used as an ID of each barcode in a particular Structured Append sequence of QR codes. Sequence ID helps the scanner to concatenate the data in the right order if more than one sequence of barcodes appears at the scanner's field of view.
Syntax
- Function CalcQrSaParity(Data as VARIANT) As long
Parameters
- Data - A text string or a byte array to calculate the parity value from.
Return value
- The calculated parity value in the range of [0..255].
Example
To encode "123abcDEFxyz" in a sequence of 4 barcodes, let's calculate the parity value by XORing of ASCII codes of all characters in the string:
'1' xor '2' xor '3' xor 'a' xor 'b' xor 'c' xor 'D' xor 'E' xor
'F' xor 'x' xor 'y' xor 'z' = 108.
The CalcQrSaParity("123abcDEFxyz") call will return the value shown above. We need to assign this value to each barcode in the sequence to be able to reassemble the stored data by scanner.
parity = CalcQrSaParity("123abcDEFxyz")
StrokeScribe1.SaCount=4 ' 4 barcodes in the sequence
StrokeScribe1.SaPos=1 ' this is the first barcode in the sequence
StrokeScribe1.SaID=parity' parity data - must be the same value for all barcodes
StrokeScribe1.Text="123"' the part of original text string is encoded in the first barcode
StrokeScribe2.SaCount=4
StrokeScribe2.SaPos=2 ' this is the second barcode in the sequence
StrokeScribe2.SaID=parity
StrokeScribe2.Text="abc" ' an another part of the text is encoded in the second barcode
StrokeScribe3.SaCount=4
StrokeScribe3.SaPos=3
StrokeScribe3.SaID=parity
StrokeScribe3.Text="DEF"
StrokeScribe4.SaCount=4
StrokeScribe4.SaPos=4 ' this is the last barcode in the sequence
StrokeScribe4.SaID=parity
StrokeScribe4.Text="xyz"
WARNING: Our hardware testing experience shows that some barcode scanners (Xenon 1900 with the latest firmware, for example) ignore the parity field in QR codes and may mix data form different sequences printed too closely. Always print Structured Append sequences of QR codes distantly from each other so the scanner wouldn't read them at once.
Image Output Methods
Picture
Returns a handle to enhanced metafile (IPictureDisp).
This property will be deprecated in future releases in favor of the new GetPictureHandle method.
Example
StrokeScribe1.Alphabet = PDF417
Image1.Picture = StrokeScribe1.Picture

GetPictureHandle
The GetPictureHandle method returns a pointer to a picture object (a IPictureDisp interface, really). The picture object may contain a handle to a 24-bit BMP picture, a 1-bit per pixel BMP picture, or a handle to enhanced metafile.
Syntax
- GetPictureHandle(format As enumFormats, width As Long, height As Long, [dpi As Long]) As StdPicture
Parameters
- format - one of the following values: EMF (=4), BMP24 (=6), BMP (=0)
- width - the desired image width.
- height - the desired image height.
- dpi - BMP/BMP-24: DPI to report in the BMP data structure. The default value is 0.
- dpi - EMF: dpi parameter is used to calculate millimeters/pixels ratio of the picture. The default value is 96.
Return value
A handle to 24-bit bitmap or to enhanced metafile (depending on format parameter value).
Remarks
This method is available starting from version 4.2.3.
The 1-bit per pixel BMP format is available starting from version 4.3.8. Please note - the Microsoft Forms Image control does not load palette data form the image handle so barcode will be always black and white.
EMF: Width and height can be both positive and negative. Positive values are in millimeters, negative values are in pixels. Because EMF format stores image dimensions both in pixels and millimeters, pixel-related values will be automatically calculated if image dimensions are specified in millimeters (positive values) and millimeter-related values will be automatically calculated if image dimensions are specified in pixels (width and height are both negative). The dpi parameter is used in pixel/mm ratio calculations.
The most common setting for modern displays is 96 dots per inch. So if you have specified -96 for width, the EMF file will store both 96 pixels and 25.4 millimeters. And if you have specified 50 for width, the EMF file will store both 187 pixels and 50 millimeters.
From our experience, Visio, Excel and Word use only millimeter-related values from the EMF file and ignore pixel values. Internet Explorer, ACDSee and many other image viewing applications use only pixel dimensions. So you can choose a convenient dimensioning type if you are planning to use EMF-formatted barcodes with a single application.
Example 1
StrokeScribe1.Alphabet = CODE128
w = StrokeScribe1.BitmapW
Image1.Picture = StrokeScribe1.GetPictureHandle(BMP24, w, w / 2)
If StrokeScribe1.Error Then
MsgBox StrokeScribe1.ErrorDescription
End If
Example 2
StrokeScribe1.Alphabet = QRCODE
Image1.Picture = StrokeScribe1.GetPictureHandle(EMF, 20, 20)
Example 3
StrokeScribe1.Alphabet = CODE128
StrokeScribe1.ShowText = False
w = StrokeScribe1.BitmapW
Image1.Picture = StrokeScribe1.GetPictureHandle(BMP, w*3, w)
Remarks
See the SavePicture method description for raster image width/height selection notes.
SavePicture
The method saves the barcode image into a file.
Syntax
- Function SavePicture ( fileName As String, format As enumFormats, [width As Long], [height As Long], [dpi As Long] ) As Long
Parameters
- fileName - the path name for the saved image.
- format - one of the following values: BMP = 0, GIF = 1, PNG = 2, JPG = 3, EMF=4, TIFF=5, BMP24=6, WMF=7
- width - the desired image width in pixels (see notes). If not specified, the ActiveX width will be used as the default value.
- height - the desired image height in pixels (see notes). If not specified, the ActiveX height will be used as the default value.
- dpi - BMP: DPI to report in the BMP data structure. The default value is 0.
- dpi - EMF: dpi parameter is used to calculate millimeters/pixels ratio of the picture. The default value is 96.
Return value
Zero on success. See code examples of error handling below.
Remarks
This property has limited functionality in demo version: only BMP, GIF (starting from 3.8.4), WMF (starting from v.4.0.4), EMF (starting from v.4.1.8) formats are allowed.
EMF format is supported in v3.7 and higher.
WMF format is supported in v4.0.4 and higher.
WMF: width and height of the image are specified in TWIPs (1440 per inch).
EMF: Width and height can be both positive and negative (starting from v.4.1.8). Positive values are in millimeters, negative values are in pixels - see the code example below. Because EMF format stores image dimensions both in pixels and millimeters, pixel-related values are automatically calculated if the dimensions are specified in millimeters (positive values) and millimeter-related values are automatically calculated if the dimensions are specified in pixels (width and height are both negative). The dpi parameter is used in pixel/mm ratio calculations.
The most common DPI value is 96 dots per inch. So if you have specified -96 for width, the EMF file will store both 96 pixels and 25.4 millimeters. And if you have specified 50 for width, the EMF file will store both 187 pixels and 50 millimeters.
From our experience, Visio, Excel and Word use only millimeter values from the EMF file and ignore pixel values. Internet Explorer, ACDSee and many other image viewing applications use only pixel dimensions.
BMP/GIF/JPG/PNG:
The minimum acceptable width/height values are returned by the BitmapW and BitmapH, respectively. To get best-looking images, always select width/height values as multiples of BitmapW and BitmapH.
For 1D barcodes, you can choose any reasonable value for height.
Example
StrokeScribe1.Alphabet = EAN13 ' A BMP picture of EAN-13, height = 1/2 of width
Err = StrokeScribe1.SavePicture ("c:\bar.bmp", BMP, _
StrokeScribe1.BitmapW, StrokeScribe1.BitmapW/2)
If Err Then
MsgBox StrokeScribe1.ErrorDescription
End If
StrokeScribe1.Alphabet = QRCODE ' A GIF picture of QR Code with 3x3 pixel modules
Err = StrokeScribe1.SavePicture ("c:\qr-code.gif", GIF, _
StrokeScribe1.BitmapW*3, StrokeScribe1.BitmapH*3)
If Err Then
MsgBox StrokeScribe1.ErrorDescription
End If
StrokeScribe1.Alphabet = DATAMATRIX ' 1x1 inch barcode in WMF format
Err = StrokeScribe1.SavePicture ("c:\datamatrix.wmf", WMF, 1440, 1440)
If Err Then
MsgBox StrokeScribe1.ErrorDescription
End If
StrokeScribe1.Alphabet = AZTEC ' 50x50mm barcode in EMF format
Err = StrokeScribe1.SavePicture ("c:\aztec.emf", EMF, 50, 50)
If Err Then
MsgBox StrokeScribe1.ErrorDescription
End If
StrokeScribe1.Alphabet = CODE128 ' 50x30 pixel barcode in EMF format, 96 DPI
Err = StrokeScribe1.SavePicture ("c:\code-128.emf", EMF, -50, -30, 96)
If Err Then
MsgBox StrokeScribe1.ErrorDescription
End If
GetPicture
The method returns a pointer to IStream interface that contains a byte array of the barcode picture.
Syntax
- Function GetPicture (format As enumFormats, width As Long, height As Long, [dpi As Long] ) As IStream
Parameters:
- format - One of the following values: BMP = 0, GIF = 1, PNG = 2, JPG = 3, EMF=4, TIFF=5, BMP24=6, WMF=7
- width - Desired image width in pixels.
- height - Desired image height in pixels.
- dpi - The desired DPI value for BMP/EMF. This parameter is introduced in v.4.1.8. See SavePicture for more information.
Return value
- A pointer to IStream interface.
Remarks
For the list of supported formats and limitations, see SavePicture.
Example
' ASP.NET/VB
dim stream as System.Runtime.InteropServices.ComTypes.IStream
StrokeScribe1.Alphabet = QRCODE
stream = StrokeScribe1.GetPictureArray(GIF, StrokeScribe1.BitmapW*2, StrokeScribe1.BitmapH*2)
dim stat as System.Runtime.InteropServices.ComTypes.STATSTG
stream.Stat(stat, 0)
Dim buf (stat.cbSize) as Byte
stream.Read(buf, stat.cbSize, System.IntPtr.Zero)
GetPictureArray
The method returns a byte array that contains raw data in GIF/PNG/JPG format depending on the value of the format argument.
Syntax
- Function GetPictureArray (format As enumFormats, width As Long, height As Long, [dpi As Long] ) As Byte()
Parameters
- format - One of the following values: BMP = 0, GIF = 1, PNG = 2, JPG = 3, EMF=4, TIFF=5, BMP24=6, WMF=7
- width - The desired image width in pixels.
- height - The desired image height in pixels.
- dpi - The desired DPI value for BMP/EMF. See SavePicture.
Return value
An array of bytes of the barcode image.
Remarks
For the list of supported formats and limitations, see SavePicture.
Example
StrokeScribe1.Alphabet = QRCODE
Dim arr() As Byte
arr = StrokeScribe1.GetPictureArray(GIF, _
StrokeScribe1.BitmapW*3, StrokeScribe1.BitmapH*3)
Open "c:\1.gif" For Binary As 1
Put #1, , arr
Close #1
CopyToClipboard
Copies the barcode image in EMF format to the clipboard.
Syntax
- Function SaveCopyToClipboard ([width As Long], [height As Long]) As Long
Parameters
- width - The desired image width in pixels. If not specified, the ActiveX width will be used as the default value.
- height - The desired image height in pixels. If not specified, the ActiveX height will be used as the default value.
Return value
Zero on success.
Remarks
When using StrokeScribe Class, you must set both width and height to non-zero values.
Example
StrokeScribe1.CopyToClipboard 300, 200