属性, 活动 & 方法

 Standard 或更高

属性

确定条形码的内容和设计
Text PropertyLink
Text char
文本包含条形码的内容。 通常输入时不带校验位。
您可以像这样以人类可读的形式输入 控制代码: <CR>, <LF>, ...
Visual Basic:
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
    AxBarcode1.Text = TextBox1.Text
End Sub
Delphi:
procedure TForm1.Edit1Change(Sender: TObject);
begin
  Barcode1.Text := Edit1.Text;
end;  
C#:
axBarcode1.Type = BARCODELib.TypeConstants.CODEEAN13;
axBarcode1.Text = "431234100707";
axBarcode1.ForeColor = Color.DimGray;
axBarcode1.BackColor = Color.AntiqueWhite;
axBarcode1.Rotate = 90;
axBarcode1.BorderHeight = 10;
axBarcode1.BorderWidth = 20;
axBarcode1.Alignment = BARCODELib.AlignConstants.ALIGNCENTER;
axBarcode1.NotchHeightInPercent = 50;
axBarcode1.AutoType = false;
axBarcode1.PrintFix = false;
axBarcode1.AboutBox;
axBarcode1.SetDemoText;
VBA (Office):
Barcode1.Type = 1 ' EAN-13
Barcode1.Text = "431234100707"
Barcode1.ForeColor = vbBlack
Barcode1.BackColor = vbWhite
Barcode1.BorderHeight = 10
Barcode1.BorderWidth = 20
Barcode1.Rotate = 90
Barcode1.Alignment = ALIGNCENTER
Barcode1.NotchHeightInPercent = 50
Barcode1.AutoType = False
Barcode1.PrintFix = False
Barcode1.AboutBox
Barcode1.SetDemoText
ShowText PropertyLink
ShowText bool
TRUE: 条形码上有人类可读的文字。
FALSE: 显示的条形码没有人可读文本。

实例:
ActiveBarcode: TRUE
ShowText=TRUE
ActiveBarcode: FALSE
ShowText=FALSE

请注意,某些条形码类型没有人类可读文本。 这适用于 QR 码、PDF417 和 DataMatrix。 使用这些代码时,ShowText 属性不起作用。
Visual Basic:
AxBarcode1.ShowText = True
Delphi:
Barcode1.ShowText := TRUE;
C#:
axBarcode1.ShowText = true;
VBA (Office):
Barcode1.ShowText = True
Type PropertyLink
Type long
用唯一编号指定条形码类型。
Value Code Name
0 ISBN-10 CODEISBN
1 EAN 13 CODEEAN13
2 EAN 8 CODEEAN8
3 EAN 5 CODEEAN5
4 EAN 2 CODEEAN2
5 UPC A CODEUPCA
6 Code 39 CODE39
7 Code 25 Interleaved CODE25I
8 Codabar CODABAR
9 Code 25 Industrial CODE25
10 Code 39 Extended CODE39E
11 Code 128A CODECODE128A
12 Code 128B CODECODE128B
13 Code 128C CODECODE128C
14 Code 128 CODECODE128
15 EAN/UCC 128 CODEEAN128
16 EAN 99 CODEEAN99
17 UPC E CODEUPCE
18 PostNet CODEPOSTNET
19 Royal Mail CODEROYALMAIL
20 MSI CODEMSI
21 Code 93 CODE93
22 Code 93 Extended CODE93E
23 PZN7 CODEPZN8
24 Identcode CODEIDENTCODE
25 Leitcode CODELEITCODE
26 Code 39 Checksum CODE39CHECKSUM
27 Code 39 Extended Checksum CODE39ECHECKSUM
28 EAN/UCC 128 AI CODEEAN128AI
29 EAN 14 CODEEAN14
30 ITF-14 CODEITF14
31 EAN-18/NVE CODEEAN18
32 SSCC-18 CODESSCC18
33 Codabar Checksum CODABARCHECKSUM
34 Code 25 Interleaved Checksum CODE25ICHECKSUM
35 Code 25 Industrial Checksum CODE25CHECKSUM
36 PDF417 CODEPDF417
37 DataMatrix CODEDATAMATRIX
38 ISBN-13 CODEISBN13
39 ISBN-13 Dual CODEISBN13DUAL
40 ISSN CODEISSN
41 ISMN CODEISMN
42 DataMatrix Square CODEDATAMATRIXSQUARE
43 DataMatrix Rectangular CODEDATAMATRIXRECTANGULAR
44 DataMatrix 10x10 CODEDATAMATRIX10X10
45 DataMatrix 12x12 CODEDATAMATRIX12X12
46 DataMatrix 8x18 CODEDATAMATRIX8X18
47 DataMatrix 14x14 CODEDATAMATRIX14X14
48 DataMatrix 8x32 CODEDATAMATRIX8X32
49 DataMatrix 16x16 CODEDATAMATRIX16X16
50 DataMatrix 12x26 CODEDATAMATRIX12X26
51 DataMatrix 18x18 CODEDATAMATRIX18X18
52 DataMatrix 20x20 CODEDATAMATRIX20X20
53 DataMatrix 12x36 CODEDATAMATRIX12X36
54 DataMatrix 22x22 CODEDATAMATRIX22X22
55 DataMatrix 16x36 CODEDATAMATRIX16X36
56 DataMatrix 24x24 CODEDATAMATRIX24X24
57 DataMatrix 26x26 CODEDATAMATRIX26X26
58 DataMatrix 16x48 CODEDATAMATRIX16X48
59 DataMatrix 32x32 CODEDATAMATRIX32X32
60 DataMatrix 36x36 CODEDATAMATRIX36X36
61 DataMatrix 40x40 CODEDATAMATRIX40X40
62 DataMatrix 44x44 CODEDATAMATRIX44X44
63 DataMatrix 48x48 CODEDATAMATRIX48X48
64 DataMatrix 52x52 CODEDATAMATRIX52X52
65 DataMatrix 64x64 CODEDATAMATRIX64X64
66 DataMatrix 72x72 CODEDATAMATRIX72X72
67 DataMatrix 80x80 CODEDATAMATRIX80X80
68 DataMatrix 88x88 CODEDATAMATRIX88X88
69 DataMatrix 96x96 CODEDATAMATRIX96X96
70 DataMatrix 104x104 CODEDATAMATRIX104X104
71 DataMatrix 120x120 CODEDATAMATRIX120X120
72 DataMatrix 132x132 CODEDATAMATRIX132X132
73 DataMatrix 144x144 CODEDATAMATRIX144X144
74 GS1-Data Matrix CODEGS1DATAMATRIX
75 GS1-Data Matrix Square CODEGS1DATAMATRIXSQUARE
76 GS1-Data Matrix Rectangular CODEGS1DATAMATRIXRECTANGULAR
77 GS1-Data Matrix 10x10 CODEGS1DATAMATRIX10X10
78 GS1-Data Matrix 12x12 CODEGS1DATAMATRIX12X12
79 GS1-Data Matrix 8x18 CODEGS1DATAMATRIX8X18
80 GS1-Data Matrix 14x14 CODEGS1DATAMATRIX14X14
81 GS1-Data Matrix 8x32 CODEGS1DATAMATRIX8X32
82 GS1-Data Matrix 16x16 CODEGS1DATAMATRIX16X16
83 GS1-Data Matrix 12x26 CODEGS1DATAMATRIX12X26
84 GS1-Data Matrix 18x18 CODEGS1DATAMATRIX18X18
85 GS1-Data Matrix 20x20 CODEGS1DATAMATRIX20X20
86 GS1-Data Matrix 12x36 CODEGS1DATAMATRIX12X36
87 GS1-Data Matrix 22x22 CODEGS1DATAMATRIX22X22
88 GS1-Data Matrix 16x36 CODEGS1DATAMATRIX16X36
89 GS1-Data Matrix 24x24 CODEGS1DATAMATRIX24X24
90 GS1-Data Matrix 26x26 CODEGS1DATAMATRIX26X26
91 GS1-Data Matrix 16x48 CODEGS1DATAMATRIX16X48
92 GS1-Data Matrix 32x32 CODEGS1DATAMATRIX32X32
93 GS1-Data Matrix 36x36 CODEGS1DATAMATRIX36X36
94 GS1-Data Matrix 40x40 CODEGS1DATAMATRIX40X40
95 GS1-Data Matrix 44x44 CODEGS1DATAMATRIX44X44
96 GS1-Data Matrix 48x48 CODEGS1DATAMATRIX48X48
97 GS1-Data Matrix 52x52 CODEGS1DATAMATRIX52X52
98 GS1-Data Matrix 64x64 CODEGS1DATAMATRIX64X64
99 None CODENONE
100 GS1-Data Matrix 72x72 CODEGS1DATAMATRIX72X72
101 GS1-Data Matrix 80x80 CODEGS1DATAMATRIX80X80
102 GS1-Data Matrix 88x88 CODEGS1DATAMATRIX88X88
103 GS1-Data Matrix 96x96 CODEGS1DATAMATRIX96X96
104 GS1-Data Matrix 104x104 CODEGS1DATAMATRIX104X104
105 GS1-Data Matrix 120x120 CODEGS1DATAMATRIX120X120
106 GS1-Data Matrix 132x132 CODEGS1DATAMATRIX132X132
107 GS1-Data Matrix 144x144 CODEGS1DATAMATRIX144X144
108 GS1-128 CODEGS1128
109 GTIN-8 CODEGTIN8
110 GTIN-12 CODEGTIN12
111 GTIN-13 CODEGTIN13
112 GTIN-14 CODEGTIN14
113 QR Code CODEQRCODE
114 QR Code ECC Level L CODEQRCODEECCLEVELL
115 QR Code ECC Level M CODEQRCODEECCLEVELM
116 QR Code ECC Level Q CODEQRCODEECCLEVELQ
117 QR Code ECC Level H CODEQRCODEECCLEVELH
118 QR Code 21x21 CODEQRCODE21X21
119 QR Code 25x25 CODEQRCODE25X25
120 QR Code 29x29 CODEQRCODE29X29
121 QR Code 33x33 CODEQRCODE33X33
122 QR Code 37x37 CODEQRCODE37X37
123 QR Code 41x41 CODEQRCODE41X41
124 QR Code 45x45 CODEQRCODE45X45
125 QR Code 49x49 CODEQRCODE49X49
126 QR Code 53x53 CODEQRCODE53X53
127 QR Code 57x57 CODEQRCODE57X57
128 QR Code 61x61 CODEQRCODE61X61
129 QR Code 65x65 CODEQRCODE65X65
130 QR Code 69x69 CODEQRCODE69X69
131 QR Code 73x73 CODEQRCODE73X73
132 QR Code 77x77 CODEQRCODE77X77
133 QR Code 81x81 CODEQRCODE81X81
134 QR Code 85x85 CODEQRCODE85X85
135 QR Code 89x89 CODEQRCODE89X89
136 QR Code 93x93 CODEQRCODE93X93
137 QR Code 97x97 CODEQRCODE97X97
138 QR Code 101x101 CODEQRCODE101X101
139 QR Code 105x105 CODEQRCODE105X105
140 QR Code 109x109 CODEQRCODE109X109
141 QR Code 113x113 CODEQRCODE113X113
142 QR Code 117x117 CODEQRCODE117X117
143 QR Code 121x121 CODEQRCODE121X121
144 QR Code 125x125 CODEQRCODE125X125
145 QR Code 129x129 CODEQRCODE129X129
146 QR Code 133x133 CODEQRCODE133X133
147 QR Code 137x137 CODEQRCODE137X137
148 QR Code 141x141 CODEQRCODE141X141
149 QR Code 145x145 CODEQRCODE145X145
150 QR Code 149x149 CODEQRCODE149X149
151 QR Code 153x153 CODEQRCODE153X153
152 QR Code 157x157 CODEQRCODE157X157
153 QR Code 161x161 CODEQRCODE161X161
154 QR Code 165x165 CODEQRCODE165X165
155 QR Code 169x169 CODEQRCODE169X169
156 QR Code 173x173 CODEQRCODE173X173
157 QR Code 177x177 CODEQRCODE177X177
158 PZN8 CODEPZN8
Visual Basic:
AxBarcode1.Type = 1 ' EAN-13
AxBarcode1.Text = "431234100707"
AxBarcode1.ForeColor = Color.DimGray
AxBarcode1.BackColor = Color.AntiqueWhite
AxBarcode1.BorderHeight = 10
AxBarcode1.BorderWidth = 20
AxBarcode1.Rotate = 90
AxBarcode1.Alignment = BARCODELib.AlignConstants.ALIGNCENTER
AxBarcode1.NotchHeightInPercent = 50
AxBarcode1.AutoType = False
AxBarcode1.PrintFix = False
AxBarcode1.AboutBox
axBarcode1.SetDemoText
Delphi:
Barcode1.Type_ := 1; // EAN_13
Barcode1.Text := '431234100707';
C#:
axBarcode1.Type = BARCODELib.TypeConstants.CODEEAN13;
axBarcode1.Text = "431234100707";
axBarcode1.ForeColor = Color.DimGray;
axBarcode1.BackColor = Color.AntiqueWhite;
axBarcode1.Rotate = 90;
axBarcode1.BorderHeight = 10;
axBarcode1.BorderWidth = 20;
axBarcode1.Alignment = BARCODELib.AlignConstants.ALIGNCENTER;
axBarcode1.NotchHeightInPercent = 50;
axBarcode1.AutoType = false;
axBarcode1.PrintFix = false;
axBarcode1.AboutBox;
axBarcode1.SetDemoText;
VBA (Office):
Barcode1.Type = 1 ' EAN-13
Barcode1.Text = "431234100707"
Barcode1.ForeColor = vbBlack
Barcode1.BackColor = vbWhite
Barcode1.BorderHeight = 10
Barcode1.BorderWidth = 20
Barcode1.Rotate = 90
Barcode1.Alignment = ALIGNCENTER
Barcode1.NotchHeightInPercent = 50
Barcode1.AutoType = False
Barcode1.PrintFix = False
Barcode1.AboutBox
Barcode1.SetDemoText
Rotate PropertyLink
Rotate long
条形码的方向(单位:度 (0, 90, 180, 270).

实例
ActiveBarcode: 0 学位
0 学位
ActiveBarcode: 90 学位
90 学位
ActiveBarcode: 180 学位
180 学位
ActiveBarcode: 270 学位
270 学位
Visual Basic:
AxBarcode1.Rotate = 0
AxBarcode1.Rotate = 90
AxBarcode1.Rotate = 180
AxBarcode1.Rotate = 270
Delphi:
Barcode1.Rotate := 0;
Barcode1.Rotate := 90;
Barcode1.Rotate := 180;
Barcode1.Rotate := 270;
C#:
axBarcode1.Type = BARCODELib.TypeConstants.CODEEAN13;
axBarcode1.Text = "431234100707";
axBarcode1.ForeColor = Color.DimGray;
axBarcode1.BackColor = Color.AntiqueWhite;
axBarcode1.Rotate = 90;
axBarcode1.BorderHeight = 10;
axBarcode1.BorderWidth = 20;
axBarcode1.Alignment = BARCODELib.AlignConstants.ALIGNCENTER;
axBarcode1.NotchHeightInPercent = 50;
axBarcode1.AutoType = false;
axBarcode1.PrintFix = false;
axBarcode1.AboutBox;
axBarcode1.SetDemoText;
VBA (Office):
Barcode1.Type = 1 ' EAN-13
Barcode1.Text = "431234100707"
Barcode1.ForeColor = vbBlack
Barcode1.BackColor = vbWhite
Barcode1.BorderHeight = 10
Barcode1.BorderWidth = 20
Barcode1.Rotate = 90
Barcode1.Alignment = ALIGNCENTER
Barcode1.NotchHeightInPercent = 50
Barcode1.AutoType = False
Barcode1.PrintFix = False
Barcode1.AboutBox
Barcode1.SetDemoText
Alignment PropertyLink
Alignment AlignConstants
设置条形码向左、向右或居中对齐。 您可以传递 AlignLeft、AlignCenter 或 AlignRight。

实例:
ActiveBarcode: AlignLeft
AlignLeft

ActiveBarcode: AlignCenter
AlignCenter

ActiveBarcode: AlignRight
AlignRight


声明 'AlignConstants':
type
  AlignConstants = TOleEnum;
const
  ALIGNLEFT = $00000000;
  ALIGNCENTER = $00000001;
  ALIGNRIGHT = $00000002;
Visual Basic:
AxBarcode1.Type = 1 ' EAN-13
AxBarcode1.Text = "431234100707"
AxBarcode1.ForeColor = Color.DimGray
AxBarcode1.BackColor = Color.AntiqueWhite
AxBarcode1.BorderHeight = 10
AxBarcode1.BorderWidth = 20
AxBarcode1.Rotate = 90
AxBarcode1.Alignment = BARCODELib.AlignConstants.ALIGNCENTER
AxBarcode1.NotchHeightInPercent = 50
AxBarcode1.AutoType = False
AxBarcode1.PrintFix = False
AxBarcode1.AboutBox
axBarcode1.SetDemoText
Delphi:
Barcode1.Type_ := 1; // EAN_13
Barcode1.Text := '431234100707';
Barcode1.Alignment := AlignLeft;
Barcode1.ForeColor := clDkGray;
Barcode1.BackColor := clCream;
Barcode1.BorderHeight := 10;
Barcode1.BorderWidth := 20;
Barcode1.NotchHeightInPercent := 50;
Barcode1.AutoType := FALSE;
Barcode1.PrintFix := FALSE;
Barcode1.AboutBox;
Barcode1.SetDemoText;
if (Barcode1.MaxBorderHeight < MyValue) then BEGIN DoAnything; END;
if (Barcode1.MaxBorderWidth < MyValue) then BEGIN DoAnything; END;
C#:
axBarcode1.Type = BARCODELib.TypeConstants.CODEEAN13;
axBarcode1.Text = "431234100707";
axBarcode1.ForeColor = Color.DimGray;
axBarcode1.BackColor = Color.AntiqueWhite;
axBarcode1.Rotate = 90;
axBarcode1.BorderHeight = 10;
axBarcode1.BorderWidth = 20;
axBarcode1.Alignment = BARCODELib.AlignConstants.ALIGNCENTER;
axBarcode1.NotchHeightInPercent = 50;
axBarcode1.AutoType = false;
axBarcode1.PrintFix = false;
axBarcode1.AboutBox;
axBarcode1.SetDemoText;
VBA (Office):
Barcode1.Type = 1 ' EAN-13
Barcode1.Text = "431234100707"
Barcode1.ForeColor = vbBlack
Barcode1.BackColor = vbWhite
Barcode1.BorderHeight = 10
Barcode1.BorderWidth = 20
Barcode1.Rotate = 90
Barcode1.Alignment = ALIGNCENTER
Barcode1.NotchHeightInPercent = 50
Barcode1.AutoType = False
Barcode1.PrintFix = False
Barcode1.AboutBox
Barcode1.SetDemoText
TypeName PropertyLink
TypeName char
条形码类型的名称。
Visual Basic:
AxBarcode1.TypeName = "EAN-13"
AxBarcode1.Text = "431234100707"

MessageBox.Show("Current barcode symbology is: " & AxBarcode1.TypeName)
Delphi:
Barcode1.TypeName := 'EAN-13';
Barcode1.Text := '431234100707';

Application.Messagebox(PChar(Barcode1.TypeName),'Current Barcode symbology',mb_ok);
VBA (Office):
Barcode1.TypeName = "EAN-13"
Barcode1.Text = "431234100707"

MsgBox ("Current barcode symbology is: " & Barcode1.TypeName)
IsValid PropertyLink
IsValid bool
如果条形码有效,则返回 TRUE。 如果无效,则无法使用所选条形码类型对文本进行编码。
Visual Basic:
    If AxBarcode1.IsValid = False Then
        MessageBox.Show("Barcode is not valid. Please change properties")
    End If
IsSizeOk PropertyLink
IsSizeOk bool
表示能否正确显示条形码。 如果控件的尺寸足以显示条形码,则返回 TRUE。 只有当条形码本身正确(即 IsValid 值也为 TRUE)时,该值才会变为 TRUE。
Visual Basic:
    If AxBarcode1.IsSizeOk = False Then
        MessageBox.Show("Objects size is to small. Please enlarge")
    End If
Checksum PropertyLink
Checksum long
返回校验位。
Visual Basic:
AxBarcode1.TypeName = "EAN-13"
AxBarcode1.Text = "431234100707"
MessageBox.Show("The check digit of this code is: " & AxBarcode1.Checksum)
Delphi:
Barcode1.Type_ := 1; // EAN_13
Barcode1.Text := '431234100707';
Application.Messagebox(Pchar(inttostr(Barcode1.Checksum)),
                       'The barcodes check digit',mb_ok);
Picture PropertyLink
Picture pictureobject
返回条形码图片。
如果需要特定尺寸的图片,请在检索图片之前使用 CreatePictureBySize 方法。
Visual Basic:
' Set the bitmap picture of the barcode to the clipboard
Clipboard.Clear()
Clipboard.SetImage(AxBarcode1.Picture)
BackColor PropertyLink
BackColor OLE_Color
条形码的背景颜色。

实例:
ActiveBarcode: White BackColor
白色 BackColor
ActiveBarcode: White BackColor
绿色 BackColor
Visual Basic:
AxBarcode1.Type = 1 ' EAN-13
AxBarcode1.Text = "431234100707"
AxBarcode1.ForeColor = Color.DimGray
AxBarcode1.BackColor = Color.AntiqueWhite
AxBarcode1.BorderHeight = 10
AxBarcode1.BorderWidth = 20
AxBarcode1.Rotate = 90
AxBarcode1.Alignment = BARCODELib.AlignConstants.ALIGNCENTER
AxBarcode1.NotchHeightInPercent = 50
AxBarcode1.AutoType = False
AxBarcode1.PrintFix = False
AxBarcode1.AboutBox
axBarcode1.SetDemoText
Delphi:
Barcode1.Type_ := 1; // EAN_13
Barcode1.Text := '431234100707';
Barcode1.Alignment := AlignLeft;
Barcode1.ForeColor := clDkGray;
Barcode1.BackColor := clCream;
Barcode1.BorderHeight := 10;
Barcode1.BorderWidth := 20;
Barcode1.NotchHeightInPercent := 50;
Barcode1.AutoType := FALSE;
Barcode1.PrintFix := FALSE;
Barcode1.AboutBox;
Barcode1.SetDemoText;
if (Barcode1.MaxBorderHeight < MyValue) then BEGIN DoAnything; END;
if (Barcode1.MaxBorderWidth < MyValue) then BEGIN DoAnything; END;
C#:
axBarcode1.Type = BARCODELib.TypeConstants.CODEEAN13;
axBarcode1.Text = "431234100707";
axBarcode1.ForeColor = Color.DimGray;
axBarcode1.BackColor = Color.AntiqueWhite;
axBarcode1.Rotate = 90;
axBarcode1.BorderHeight = 10;
axBarcode1.BorderWidth = 20;
axBarcode1.Alignment = BARCODELib.AlignConstants.ALIGNCENTER;
axBarcode1.NotchHeightInPercent = 50;
axBarcode1.AutoType = false;
axBarcode1.PrintFix = false;
axBarcode1.AboutBox;
axBarcode1.SetDemoText;
VBA (Office):
Barcode1.BackColor = &HFFFFFF ' White
ForeColor PropertyLink
ForeColor OLE_Color
条形码的前景色。

实例:
ActiveBarcode: Barcode with black forecolor
黑色 Forecolor
ActiveBarcode: Barcode with green forecolor
绿色 Forecolor
Visual Basic:
AxBarcode1.Type = 1 ' EAN-13
AxBarcode1.Text = "431234100707"
AxBarcode1.ForeColor = Color.DimGray
AxBarcode1.BackColor = Color.AntiqueWhite
AxBarcode1.BorderHeight = 10
AxBarcode1.BorderWidth = 20
AxBarcode1.Rotate = 90
AxBarcode1.Alignment = BARCODELib.AlignConstants.ALIGNCENTER
AxBarcode1.NotchHeightInPercent = 50
AxBarcode1.AutoType = False
AxBarcode1.PrintFix = False
AxBarcode1.AboutBox
axBarcode1.SetDemoText
Delphi:
Barcode1.Type_ := 1; // EAN_13
Barcode1.Text := '431234100707';
Barcode1.Alignment := AlignLeft;
Barcode1.ForeColor := clDkGray;
Barcode1.BackColor := clCream;
Barcode1.BorderHeight := 10;
Barcode1.BorderWidth := 20;
Barcode1.NotchHeightInPercent := 50;
Barcode1.AutoType := FALSE;
Barcode1.PrintFix := FALSE;
Barcode1.AboutBox;
Barcode1.SetDemoText;
if (Barcode1.MaxBorderHeight < MyValue) then BEGIN DoAnything; END;
if (Barcode1.MaxBorderWidth < MyValue) then BEGIN DoAnything; END;
C#:
axBarcode1.Type = BARCODELib.TypeConstants.CODEEAN13;
axBarcode1.Text = "431234100707";
axBarcode1.ForeColor = Color.DimGray;
axBarcode1.BackColor = Color.AntiqueWhite;
axBarcode1.Rotate = 90;
axBarcode1.BorderHeight = 10;
axBarcode1.BorderWidth = 20;
axBarcode1.Alignment = BARCODELib.AlignConstants.ALIGNCENTER;
axBarcode1.NotchHeightInPercent = 50;
axBarcode1.AutoType = false;
axBarcode1.PrintFix = false;
axBarcode1.AboutBox;
axBarcode1.SetDemoText;
VBA (Office):
Barcode1.ForeColor = &H000000 ' Black
Font PropertyLink
Font fontobject
通过名称、样式、效果和文本行的大小指定字体。

字体属性是一个说明字体不同属性的对象。

字体对象的用法如下:

更改尺寸:
Barcode1.Font.Size = 10

更改字体
Barcode1.Font.Name = "Arial"

改变风格和效果
Barcode1.Font.Bold = True
Barcode1.Font.Italic = True
Barcode1.Font.Underline = True
Barcode1.Font.Strikethrough = True

在某些开发环境中,这些属性由枚举类型决定,例如 Delphi。 请查看开发系统的帮助,了解如何处理这些问题。


实例:
ActiveBarcode: 条形码 @ Font: Arial, 12pt, Bold
Font: Arial, 12pt, Bold
ActiveBarcode: 条形码 @ Font: Comix, 14pt, Standard
Font: Comix, 14pt, Standard
Delphi:
Barcode1.Font.name := 'Courier New';
Barcode1.Font.size := 14;
Barcode1.Font.style := [fsbold];
Version PropertyLink
Version char
返回条形码对象的版本号。
Visual Basic:
   MessageBox.Show("The barcode objects version is: " & AxBarcode1.version)
Delphi:
Application.Messagebox(Pchar(Barcode1.Version),
                       'The barcode objects version number',mb_ok);
BorderHeight PropertyLink
BorderHeight long
条形码上方和下方边框的高度(像素)。 边框采用当前的背景颜色。

实例:
ActiveBarcode: BorderHeight=4
BorderHeight=4
ActiveBarcode: BorderHeight=20
BorderHeight=20
Visual Basic:
AxBarcode1.Type = 1 ' EAN-13
AxBarcode1.Text = "431234100707"
AxBarcode1.ForeColor = Color.DimGray
AxBarcode1.BackColor = Color.AntiqueWhite
AxBarcode1.BorderHeight = 10
AxBarcode1.BorderWidth = 20
AxBarcode1.Rotate = 90
AxBarcode1.Alignment = BARCODELib.AlignConstants.ALIGNCENTER
AxBarcode1.NotchHeightInPercent = 50
AxBarcode1.AutoType = False
AxBarcode1.PrintFix = False
AxBarcode1.AboutBox
axBarcode1.SetDemoText
Delphi:
Barcode1.Type_ := 1; // EAN_13
Barcode1.Text := '431234100707';
Barcode1.Alignment := AlignLeft;
Barcode1.ForeColor := clDkGray;
Barcode1.BackColor := clCream;
Barcode1.BorderHeight := 10;
Barcode1.BorderWidth := 20;
Barcode1.NotchHeightInPercent := 50;
Barcode1.AutoType := FALSE;
Barcode1.PrintFix := FALSE;
Barcode1.AboutBox;
Barcode1.SetDemoText;
if (Barcode1.MaxBorderHeight < MyValue) then BEGIN DoAnything; END;
if (Barcode1.MaxBorderWidth < MyValue) then BEGIN DoAnything; END;
C#:
axBarcode1.Type = BARCODELib.TypeConstants.CODEEAN13;
axBarcode1.Text = "431234100707";
axBarcode1.ForeColor = Color.DimGray;
axBarcode1.BackColor = Color.AntiqueWhite;
axBarcode1.Rotate = 90;
axBarcode1.BorderHeight = 10;
axBarcode1.BorderWidth = 20;
axBarcode1.Alignment = BARCODELib.AlignConstants.ALIGNCENTER;
axBarcode1.NotchHeightInPercent = 50;
axBarcode1.AutoType = false;
axBarcode1.PrintFix = false;
axBarcode1.AboutBox;
axBarcode1.SetDemoText;
VBA (Office):
Barcode1.Type = 1 ' EAN-13
Barcode1.Text = "431234100707"
Barcode1.ForeColor = vbBlack
Barcode1.BackColor = vbWhite
Barcode1.BorderHeight = 10
Barcode1.BorderWidth = 20
Barcode1.Rotate = 90
Barcode1.Alignment = ALIGNCENTER
Barcode1.NotchHeightInPercent = 50
Barcode1.AutoType = False
Barcode1.PrintFix = False
Barcode1.AboutBox
Barcode1.SetDemoText
BorderWidth PropertyLink
BorderWidth long
条形码左侧和右侧边框的宽度(像素)。 边框采用当前的背景颜色。
Visual Basic:
AxBarcode1.Type = 1 ' EAN-13
AxBarcode1.Text = "431234100707"
AxBarcode1.ForeColor = Color.DimGray
AxBarcode1.BackColor = Color.AntiqueWhite
AxBarcode1.BorderHeight = 10
AxBarcode1.BorderWidth = 20
AxBarcode1.Rotate = 90
AxBarcode1.Alignment = BARCODELib.AlignConstants.ALIGNCENTER
AxBarcode1.NotchHeightInPercent = 50
AxBarcode1.AutoType = False
AxBarcode1.PrintFix = False
AxBarcode1.AboutBox
axBarcode1.SetDemoText
Delphi:
Barcode1.Type_ := 1; // EAN_13
Barcode1.Text := '431234100707';
Barcode1.Alignment := AlignLeft;
Barcode1.ForeColor := clDkGray;
Barcode1.BackColor := clCream;
Barcode1.BorderHeight := 10;
Barcode1.BorderWidth := 20;
Barcode1.NotchHeightInPercent := 50;
Barcode1.AutoType := FALSE;
Barcode1.PrintFix := FALSE;
Barcode1.AboutBox;
Barcode1.SetDemoText;
if (Barcode1.MaxBorderHeight < MyValue) then BEGIN DoAnything; END;
if (Barcode1.MaxBorderWidth < MyValue) then BEGIN DoAnything; END;
C#:
axBarcode1.Type = BARCODELib.TypeConstants.CODEEAN13;
axBarcode1.Text = "431234100707";
axBarcode1.ForeColor = Color.DimGray;
axBarcode1.BackColor = Color.AntiqueWhite;
axBarcode1.Rotate = 90;
axBarcode1.BorderHeight = 10;
axBarcode1.BorderWidth = 20;
axBarcode1.Alignment = BARCODELib.AlignConstants.ALIGNCENTER;
axBarcode1.NotchHeightInPercent = 50;
axBarcode1.AutoType = false;
axBarcode1.PrintFix = false;
axBarcode1.AboutBox;
axBarcode1.SetDemoText;
VBA (Office):
Barcode1.Type = 1 ' EAN-13
Barcode1.Text = "431234100707"
Barcode1.ForeColor = vbBlack
Barcode1.BackColor = vbWhite
Barcode1.BorderHeight = 10
Barcode1.BorderWidth = 20
Barcode1.Rotate = 90
Barcode1.Alignment = ALIGNCENTER
Barcode1.NotchHeightInPercent = 50
Barcode1.AutoType = False
Barcode1.PrintFix = False
Barcode1.AboutBox
Barcode1.SetDemoText
MaxBorderHeight PropertyLink
MaxBorderHeight long
BorderHeight 的最大可能值。
Delphi:
Barcode1.Type_ := 1; // EAN_13
Barcode1.Text := '431234100707';
Barcode1.Alignment := AlignLeft;
Barcode1.ForeColor := clDkGray;
Barcode1.BackColor := clCream;
Barcode1.BorderHeight := 10;
Barcode1.BorderWidth := 20;
Barcode1.NotchHeightInPercent := 50;
Barcode1.AutoType := FALSE;
Barcode1.PrintFix := FALSE;
Barcode1.AboutBox;
Barcode1.SetDemoText;
if (Barcode1.MaxBorderHeight < MyValue) then BEGIN DoAnything; END;
if (Barcode1.MaxBorderWidth < MyValue) then BEGIN DoAnything; END;
MaxBorderWidth PropertyLink
MaxBorderWidth long
边框宽度的最大可能值。
Delphi:
Barcode1.Type_ := 1; // EAN_13
Barcode1.Text := '431234100707';
Barcode1.Alignment := AlignLeft;
Barcode1.ForeColor := clDkGray;
Barcode1.BackColor := clCream;
Barcode1.BorderHeight := 10;
Barcode1.BorderWidth := 20;
Barcode1.NotchHeightInPercent := 50;
Barcode1.AutoType := FALSE;
Barcode1.PrintFix := FALSE;
Barcode1.AboutBox;
Barcode1.SetDemoText;
if (Barcode1.MaxBorderHeight < MyValue) then BEGIN DoAnything; END;
if (Barcode1.MaxBorderWidth < MyValue) then BEGIN DoAnything; END;
NotchHeightInPercent PropertyLink
NotchHeightInPercent long
凹槽的长度(百分比)。

实例:
ActiveBarcode: 50%
NotchHeightInPercent=50
ActiveBarcode: 100%
NotchHeightInPercent=100
ActiveBarcode: 0%
NotchHeightInPercent=0
Visual Basic:
AxBarcode1.Type = 1 ' EAN-13
AxBarcode1.Text = "431234100707"
AxBarcode1.ForeColor = Color.DimGray
AxBarcode1.BackColor = Color.AntiqueWhite
AxBarcode1.BorderHeight = 10
AxBarcode1.BorderWidth = 20
AxBarcode1.Rotate = 90
AxBarcode1.Alignment = BARCODELib.AlignConstants.ALIGNCENTER
AxBarcode1.NotchHeightInPercent = 50
AxBarcode1.AutoType = False
AxBarcode1.PrintFix = False
AxBarcode1.AboutBox
axBarcode1.SetDemoText
Delphi:
Barcode1.Type_ := 1; // EAN_13
Barcode1.Text := '431234100707';
Barcode1.Alignment := AlignLeft;
Barcode1.ForeColor := clDkGray;
Barcode1.BackColor := clCream;
Barcode1.BorderHeight := 10;
Barcode1.BorderWidth := 20;
Barcode1.NotchHeightInPercent := 50;
Barcode1.AutoType := FALSE;
Barcode1.PrintFix := FALSE;
Barcode1.AboutBox;
Barcode1.SetDemoText;
if (Barcode1.MaxBorderHeight < MyValue) then BEGIN DoAnything; END;
if (Barcode1.MaxBorderWidth < MyValue) then BEGIN DoAnything; END;
C#:
axBarcode1.Type = BARCODELib.TypeConstants.CODEEAN13;
axBarcode1.Text = "431234100707";
axBarcode1.ForeColor = Color.DimGray;
axBarcode1.BackColor = Color.AntiqueWhite;
axBarcode1.Rotate = 90;
axBarcode1.BorderHeight = 10;
axBarcode1.BorderWidth = 20;
axBarcode1.Alignment = BARCODELib.AlignConstants.ALIGNCENTER;
axBarcode1.NotchHeightInPercent = 50;
axBarcode1.AutoType = false;
axBarcode1.PrintFix = false;
axBarcode1.AboutBox;
axBarcode1.SetDemoText;
VBA (Office):
Barcode1.Type = 1 ' EAN-13
Barcode1.Text = "431234100707"
Barcode1.ForeColor = vbBlack
Barcode1.BackColor = vbWhite
Barcode1.BorderHeight = 10
Barcode1.BorderWidth = 20
Barcode1.Rotate = 90
Barcode1.Alignment = ALIGNCENTER
Barcode1.NotchHeightInPercent = 50
Barcode1.AutoType = False
Barcode1.PrintFix = False
Barcode1.AboutBox
Barcode1.SetDemoText
PrintFix PropertyLink
PrintFix bool
未使用。 自 6.0.0 版起不再具有任何功能。
Visual Basic:
AxBarcode1.Type = 1 ' EAN-13
AxBarcode1.Text = "431234100707"
AxBarcode1.ForeColor = Color.DimGray
AxBarcode1.BackColor = Color.AntiqueWhite
AxBarcode1.BorderHeight = 10
AxBarcode1.BorderWidth = 20
AxBarcode1.Rotate = 90
AxBarcode1.Alignment = BARCODELib.AlignConstants.ALIGNCENTER
AxBarcode1.NotchHeightInPercent = 50
AxBarcode1.AutoType = False
AxBarcode1.PrintFix = False
AxBarcode1.AboutBox
axBarcode1.SetDemoText
Delphi:
Barcode1.Type_ := 1; // EAN_13
Barcode1.Text := '431234100707';
Barcode1.Alignment := AlignLeft;
Barcode1.ForeColor := clDkGray;
Barcode1.BackColor := clCream;
Barcode1.BorderHeight := 10;
Barcode1.BorderWidth := 20;
Barcode1.NotchHeightInPercent := 50;
Barcode1.AutoType := FALSE;
Barcode1.PrintFix := FALSE;
Barcode1.AboutBox;
Barcode1.SetDemoText;
if (Barcode1.MaxBorderHeight < MyValue) then BEGIN DoAnything; END;
if (Barcode1.MaxBorderWidth < MyValue) then BEGIN DoAnything; END;
C#:
axBarcode1.Type = BARCODELib.TypeConstants.CODEEAN13;
axBarcode1.Text = "431234100707";
axBarcode1.ForeColor = Color.DimGray;
axBarcode1.BackColor = Color.AntiqueWhite;
axBarcode1.Rotate = 90;
axBarcode1.BorderHeight = 10;
axBarcode1.BorderWidth = 20;
axBarcode1.Alignment = BARCODELib.AlignConstants.ALIGNCENTER;
axBarcode1.NotchHeightInPercent = 50;
axBarcode1.AutoType = false;
axBarcode1.PrintFix = false;
axBarcode1.AboutBox;
axBarcode1.SetDemoText;
VBA (Office):
Barcode1.Type = 1 ' EAN-13
Barcode1.Text = "431234100707"
Barcode1.ForeColor = vbBlack
Barcode1.BackColor = vbWhite
Barcode1.BorderHeight = 10
Barcode1.BorderWidth = 20
Barcode1.Rotate = 90
Barcode1.Alignment = ALIGNCENTER
Barcode1.NotchHeightInPercent = 50
Barcode1.AutoType = False
Barcode1.PrintFix = False
Barcode1.AboutBox
Barcode1.SetDemoText
AutoType PropertyLink
AutoType bool
ActiveBarcde 会尝试自动检测条形码类型。 该属性已过时,不应依赖。 这样做是为了与旧版本兼容。
Visual Basic:
AxBarcode1.Type = 1 ' EAN-13
AxBarcode1.Text = "431234100707"
AxBarcode1.ForeColor = Color.DimGray
AxBarcode1.BackColor = Color.AntiqueWhite
AxBarcode1.BorderHeight = 10
AxBarcode1.BorderWidth = 20
AxBarcode1.Rotate = 90
AxBarcode1.Alignment = BARCODELib.AlignConstants.ALIGNCENTER
AxBarcode1.NotchHeightInPercent = 50
AxBarcode1.AutoType = False
AxBarcode1.PrintFix = False
AxBarcode1.AboutBox
axBarcode1.SetDemoText
Delphi:
Barcode1.Type_ := 1; // EAN_13
Barcode1.Text := '431234100707';
Barcode1.Alignment := AlignLeft;
Barcode1.ForeColor := clDkGray;
Barcode1.BackColor := clCream;
Barcode1.BorderHeight := 10;
Barcode1.BorderWidth := 20;
Barcode1.NotchHeightInPercent := 50;
Barcode1.AutoType := FALSE;
Barcode1.PrintFix := FALSE;
Barcode1.AboutBox;
Barcode1.SetDemoText;
if (Barcode1.MaxBorderHeight < MyValue) then BEGIN DoAnything; END;
if (Barcode1.MaxBorderWidth < MyValue) then BEGIN DoAnything; END;
C#:
axBarcode1.Type = BARCODELib.TypeConstants.CODEEAN13;
axBarcode1.Text = "431234100707";
axBarcode1.ForeColor = Color.DimGray;
axBarcode1.BackColor = Color.AntiqueWhite;
axBarcode1.Rotate = 90;
axBarcode1.BorderHeight = 10;
axBarcode1.BorderWidth = 20;
axBarcode1.Alignment = BARCODELib.AlignConstants.ALIGNCENTER;
axBarcode1.NotchHeightInPercent = 50;
axBarcode1.AutoType = false;
axBarcode1.PrintFix = false;
axBarcode1.AboutBox;
axBarcode1.SetDemoText;
VBA (Office):
Barcode1.Type = 1 ' EAN-13
Barcode1.Text = "431234100707"
Barcode1.ForeColor = vbBlack
Barcode1.BackColor = vbWhite
Barcode1.BorderHeight = 10
Barcode1.BorderWidth = 20
Barcode1.Rotate = 90
Barcode1.Alignment = ALIGNCENTER
Barcode1.NotchHeightInPercent = 50
Barcode1.AutoType = False
Barcode1.PrintFix = False
Barcode1.AboutBox
Barcode1.SetDemoText

活动

当属性发生变化时触发
TypeChange EventLink
TypeChange BarcodeType:long
条形码类型更改时触发。 属性 Type 已传递并可使用。
Visual Basic:
Private Sub AxBarcode1_TypeChange(sender As Object, 
            e As AxBARCODELib._DBarcodeEvents_TypeChangeEvent) Handles AxBarcode1.TypeChange
    MessageBox.Show("Barcode symbology changed to: " & AxBarcode1.TypeName)
End Sub
TextChange EventLink
TextChange Text:char
条形码文本更改时触发。 属性 Text 已传递并可使用。
Visual Basic:
Private Sub AxBarcode1_TextChange(sender As Object, 
            e As AxBARCODELib._DBarcodeEvents_TextChangeEvent) Handles AxBarcode1.TextChange
    MessageBox.Show("Barcode content changed to: " & AxBarcode1.Text)
End Sub
ShowTextChange EventLink
ShowTextChange ShowText:bool
启用或禁用条形码文本显示时触发。 属性 ShowText 已传递并可使用。
Visual Basic:
Private Sub AxBarcode1_ShowTextChange(sender As Object, 
        e As AxBARCODELib._DBarcodeEvents_ShowTextChangeEvent) Handles AxBarcode1.ShowTextChange
    If AxBarcode1.ShowText = False Then
        MessageBox.Show("Human readable text is disabled now")
    End If
End Sub
AutoTypeChange EventLink
AutoTypeChange AutoType:bool
启用或禁用 Autotype 选项时触发。 属性 Autotype 已传递并可使用。

方法

访问条形码对象功能并使其自动化。
CopyToClipboard MethodLink
CopyToClipboard : bool
将元图形格式的条形码复制到剪贴板。 如果成功,则返回 TRUE。
Visual Basic:
Private Sub CopyButton_Click(sender As Object, e As EventArgs) Handles CopyButton.Click
    AxBarcode1.CopyToClipboard()
End Sub
Delphi:
procedure TForm1.CopyButtonClick(Sender: TObject);
begin
  Barcode1.CopyToClipboard; 
end;
CopyToClipboardBySize MethodLink
CopyToClipboardBySize (Width: Integer, Height: Integer): Bool
将元图形格式的条形码复制到剪贴板。 条形码的大小由参数 width 和 height 指定。 如果成功,则返回 TRUE。
Visual Basic:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
' Assigns a sized image of the barcode to the clipboard
    AxBarcode1.CopyToClipboardBySize(600, 400)
End Sub
CreatePictureBySize MethodLink
CreatePictureBySize (Width: Integer, Height: Integer): Bool
允许处理自定义大小的图片属性。 条形码图片的大小由参数 width 和 height 指定。 如果成功,则返回 TRUE。
Visual Basic:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
' Create an image of the barcode in specific size and assigns this to the clipboard
    AxBarcode1.CreatePictureBySize(800, 800)
    Clipboard.SetImage(AxBarcode1.Picture)
End Sub
SaveAs MethodLink
SaveAs (path: WideString): Smallint
将当前条形码保存为图像文件 (BMP, JPEG, PNG, TIFF, Targa, GIF, WMF, EMF, PBM, PGM, PPM, WBMP, XPM). 图像大小是控件的当前大小。 使用的图像文件类型由文件名的扩展名定义(如 BMP 表示 Windows 位图)。

相关主题: 图像文件选项
Delphi:
Barcode1.SaveAs(MyFileName);
SaveAsBySize MethodLink
SaveAsBySize (path: WideString, Width: Integer, Height: Integer): Smallint
将当前条形码保存为图像文件 (BMP, JPEG, PNG, TIFF, Targa, GIF, WMF, EMF, PBM, PGM, PPM, WBMP, XPM). 图像大小由宽度和高度参数指定。 使用的图像文件类型由文件名的扩展名定义(如 BMP 表示 Windows 位图)。

相关主题: 图像文件选项
Delphi:
Barcode1.SaveAsBySize(MyFileName,600,200);
SaveAsBySizeExtended MethodLink
SaveAsBySizeExtended (path: WideString, Width: Integer, Height: Integer, Format: Integer, ColorDepth: Integer, Transparent: Integer, Flags: Integer, Angle: Integer, DPI: Integer): Smallint
SaveAsBySize 方法的扩展版本。

将当前条形码保存为图像文件。

图像大小由参数 widthheight 指定。

图像文件类型由参数 format 指定。如果想通过文件名扩展名自动选择文件类型,则将其设置为-1。

颜色深度设置为 (1, 8, 16, 24, 32) 位。

选项 transparent 尚未实施。 如果不希望背景透明,则将其设置为 0;如果希望背景透明,则将其设置为-1。

flags 用于特殊选项。

选项 angle 用于旋转图像。设置旋转的度数(0-359)。 要使用 rotate 属性的当前设置覆盖该选项,请将 angle 设置为-1。

使用参数 dpi 为图像文件设置特定的 DPI 分辨率。 可用于 BMP、JPEG、TIF 和 PNG 等图像格式。(0=不设置 DPI 值)

在这里,您可以看到支持的图像文件类型、色深和标志的列表。

该方法支持以下图像格式: Windows Bitmap (BMP), JPEG, PNG, TIFF, Targa, GIF, WMF, EMF, PBM, PGM, PPM, WBMP 和 XPM.

该函数的返回值:
0 : File save ok. No errors.
1 : Error while saving file.
2 : Wrong colordepth for this file format
3 : Colordepth/angle combination not possible
4 : Filetype not supported
5 : Low memory
6 : Low memory
7 : Low memory
SetDemoText MethodLink
SetDemoText
将属性 Text 设置为有效的默认值。 用于演示或测试目的,以获得有效代码。
Visual Basic:
AxBarcode1.Type = 1 ' EAN-13
AxBarcode1.Text = "431234100707"
AxBarcode1.ForeColor = Color.DimGray
AxBarcode1.BackColor = Color.AntiqueWhite
AxBarcode1.BorderHeight = 10
AxBarcode1.BorderWidth = 20
AxBarcode1.Rotate = 90
AxBarcode1.Alignment = BARCODELib.AlignConstants.ALIGNCENTER
AxBarcode1.NotchHeightInPercent = 50
AxBarcode1.AutoType = False
AxBarcode1.PrintFix = False
AxBarcode1.AboutBox
axBarcode1.SetDemoText
Delphi:
Barcode1.Type_ := 1; // EAN_13
Barcode1.Text := '431234100707';
Barcode1.Alignment := AlignLeft;
Barcode1.ForeColor := clDkGray;
Barcode1.BackColor := clCream;
Barcode1.BorderHeight := 10;
Barcode1.BorderWidth := 20;
Barcode1.NotchHeightInPercent := 50;
Barcode1.AutoType := FALSE;
Barcode1.PrintFix := FALSE;
Barcode1.AboutBox;
Barcode1.SetDemoText;
if (Barcode1.MaxBorderHeight < MyValue) then BEGIN DoAnything; END;
if (Barcode1.MaxBorderWidth < MyValue) then BEGIN DoAnything; END;
C#:
axBarcode1.Type = BARCODELib.TypeConstants.CODEEAN13;
axBarcode1.Text = "431234100707";
axBarcode1.ForeColor = Color.DimGray;
axBarcode1.BackColor = Color.AntiqueWhite;
axBarcode1.Rotate = 90;
axBarcode1.BorderHeight = 10;
axBarcode1.BorderWidth = 20;
axBarcode1.Alignment = BARCODELib.AlignConstants.ALIGNCENTER;
axBarcode1.NotchHeightInPercent = 50;
axBarcode1.AutoType = false;
axBarcode1.PrintFix = false;
axBarcode1.AboutBox;
axBarcode1.SetDemoText;
VBA (Office):
Barcode1.Type = 1 ' EAN-13
Barcode1.Text = "431234100707"
Barcode1.ForeColor = vbBlack
Barcode1.BackColor = vbWhite
Barcode1.BorderHeight = 10
Barcode1.BorderWidth = 20
Barcode1.Rotate = 90
Barcode1.Alignment = ALIGNCENTER
Barcode1.NotchHeightInPercent = 50
Barcode1.AutoType = False
Barcode1.PrintFix = False
Barcode1.AboutBox
Barcode1.SetDemoText
BinaryWriteAsPNGBySize MethodLink
BinaryWriteAsPNGBySize (Width: Integer, Height: Integer): OleVariant
以二进制 PNG 图像格式返回当前条形码。 尺寸由 宽度 和 高度 参数指定。 此方法仅适用于企业版。
BinaryWriteAsPNG MethodLink
BinaryWriteAsPNG : OleVariant
以当前大小的二进制 PNG 图像格式返回当前条形码。 此方法仅适用于企业版。
AboutBox MethodLink
AboutBox
打开 ActiveBarcode 的信息对话框,显示版本和其他详细信息。
Visual Basic:
AxBarcode1.Type = 1 ' EAN-13
AxBarcode1.Text = "431234100707"
AxBarcode1.ForeColor = Color.DimGray
AxBarcode1.BackColor = Color.AntiqueWhite
AxBarcode1.BorderHeight = 10
AxBarcode1.BorderWidth = 20
AxBarcode1.Rotate = 90
AxBarcode1.Alignment = BARCODELib.AlignConstants.ALIGNCENTER
AxBarcode1.NotchHeightInPercent = 50
AxBarcode1.AutoType = False
AxBarcode1.PrintFix = False
AxBarcode1.AboutBox
axBarcode1.SetDemoText
Delphi:
Barcode1.Type_ := 1; // EAN_13
Barcode1.Text := '431234100707';
Barcode1.Alignment := AlignLeft;
Barcode1.ForeColor := clDkGray;
Barcode1.BackColor := clCream;
Barcode1.BorderHeight := 10;
Barcode1.BorderWidth := 20;
Barcode1.NotchHeightInPercent := 50;
Barcode1.AutoType := FALSE;
Barcode1.PrintFix := FALSE;
Barcode1.AboutBox;
Barcode1.SetDemoText;
if (Barcode1.MaxBorderHeight < MyValue) then BEGIN DoAnything; END;
if (Barcode1.MaxBorderWidth < MyValue) then BEGIN DoAnything; END;
C#:
axBarcode1.Type = BARCODELib.TypeConstants.CODEEAN13;
axBarcode1.Text = "431234100707";
axBarcode1.ForeColor = Color.DimGray;
axBarcode1.BackColor = Color.AntiqueWhite;
axBarcode1.Rotate = 90;
axBarcode1.BorderHeight = 10;
axBarcode1.BorderWidth = 20;
axBarcode1.Alignment = BARCODELib.AlignConstants.ALIGNCENTER;
axBarcode1.NotchHeightInPercent = 50;
axBarcode1.AutoType = false;
axBarcode1.PrintFix = false;
axBarcode1.AboutBox;
axBarcode1.SetDemoText;
VBA (Office):
Barcode1.Type = 1 ' EAN-13
Barcode1.Text = "431234100707"
Barcode1.ForeColor = vbBlack
Barcode1.BackColor = vbWhite
Barcode1.BorderHeight = 10
Barcode1.BorderWidth = 20
Barcode1.Rotate = 90
Barcode1.Alignment = ALIGNCENTER
Barcode1.NotchHeightInPercent = 50
Barcode1.AutoType = False
Barcode1.PrintFix = False
Barcode1.AboutBox
Barcode1.SetDemoText
SaveAsPNG MethodLink
SaveAsPNG (path: WideString): Smallint
将当前条形码保存为 PNG 图像文件。 图像大小是控件的当前大小。

该功能已过时。 使用支持更多文件格式的函数 SaveAs 代替。
SaveAsPNGBySize MethodLink
SaveAsPNGBySize (path: WideString, Width: Integer, Height: Integer): Smallint
将当前条形码保存为 PNG 图像文件。 图像大小由宽度和高度参数指定。

该功能已过时。 使用支持更多文件格式的函数 SaveAsBySize 代替。

支持的图像文件格式

ActiveBarcode 控件的 SaveAs、SaveAsBySize 和 SaveAsBySizeExtended 功能支持不同的图像格式和颜色深度:

ActiveBarcode: Windows Bitmap
Windows Bitmap
Extension: BMP
Format #: 0
1-bit s/w: ✔
8-bit: ✔
16-bit: ✔
24-bit: ✔
32-bit: ✔ default
位图图形
ActiveBarcode: JPEG
JPEG
Extension: JPG, JPEG
Format #: 2
1-bit s/w: ✕
8-bit: gray
16-bit: ✕
24-bit: ✔ default
32-bit: ✕
位图图形
ActiveBarcode: Portable Network Graphic
Portable Network Graphic
Extension: PNG
Format #: 13
1-bit s/w: ✔
8-bit: ✔
16-bit: ✕
24-bit: ✔ default
32-bit: ✔
位图图形
ActiveBarcode: TIFF
TIFF
Extension: TIF
Format #: 18
1-bit s/w: ✔
8-bit: ✔
16-bit: ✕
24-bit: ✔ default
32-bit: ✔
位图图形
ActiveBarcode: Targa
Targa
Extension: TGA
Format #: 17
1-bit s/w: ✕
8-bit: ✔
16-bit: ✔
24-bit: ✔ default
32-bit: ✔
位图图形
ActiveBarcode: GIF
GIF
Extension: GIF
Format #: 25
1-bit s/w: ✔
8-bit: ✔ default
16-bit: ✕
24-bit: ✕
32-bit: ✕
位图图形
ActiveBarcode: Windows Metafile Format
Windows Metafile Format
Extension: WMF
Format #: 101
1-bit s/w: ✕
8-bit: ✕
16-bit: ✕
24-bit: ✔ default
32-bit: ✕
矢量图形
ActiveBarcode: Enhanced Metafile Format
Enhanced Metafile Format
Extension: EMF
Format #: 100
1-bit s/w: ✕
8-bit: ✕
16-bit: ✕
24-bit: ✔ default
32-bit: ✕
矢量图形
ActiveBarcode: Wireless Bitmap
Wireless Bitmap
Extension: WBM, WBMP
Format #: 19
1-bit s/w: ✔ default
8-bit: ✕
16-bit: ✕
24-bit: ✕
32-bit: ✕
位图图形
ActiveBarcode: Portable Bit Map
Portable Bit Map
Extension: PBM
Format #: 7
1-bit s/w: ✔ default
8-bit: ✕
16-bit: ✕
24-bit: ✕
32-bit: ✕
位图图形
ActiveBarcode: Portable Gray Map
Portable Gray Map
Extension: PGM
Format #: 11
1-bit s/w: ✕
8-bit: gray/default
16-bit: ✕
24-bit: ✕
32-bit: ✕
位图图形
ActiveBarcode: Portable Pixel Map
Portable Pixel Map
Extension: PPM
Format #: 14
1-bit s/w: ✕
8-bit: ✕
16-bit: ✕
24-bit: ✔ default
32-bit: ✕
位图图形
ActiveBarcode: X Pix Map
X Pix Map
Extension: XPM
Format #: 23
1-bit s/w: ✕
8-bit: ✕
16-bit: ✕
24-bit: ✔ default
32-bit: ✕
位图图形

标记为 default 的颜色深度在使用 SaveAs 和 SaveAsBySize 功能时使用,或者在使用 SaveAsBySizeExtended 功能时将颜色深度设置为零。

图像文件的颜色深度

支持的色深为

颜色深度 说明
1 1-bit 则图像为黑白。
8 8-bit 颜色或灰度,取决于图像格式
16 16-bit TrueColor
24 24-bit TrueColor
32 32-bit TrueColor

请注意,并非每种色彩深度都适用于每种图像文件格式。

图像文件支持的标记

保存图像文件时,可以使用以下标记:

图像格式 旗帜 说明
BMP 0x1 将位图保存为 RLE (Run Length Encoded)
JPEG 0x80
0x100
0x200
0x400
0x800
JPEG 质量超级 (100%)
JPEG 质量良好 (75%)
JPEG 质量 正常 (50%)
JPEG 质量 一般 (25%)
JPEG 质量 (10%)

DPI 设置

如果使用 SaveAsBySizeExtended 方法,在保存为 JPEG、PNG、TIFF 或 BMP 图像格式时,可以设置 DPI(每英寸点数)。