Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
GeneralClassLibrary
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 918db417
由
LN
编写于
2019-09-06 14:18:15 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
9b0cfda5
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
38 行增加
和
31 行删除
CodeLibraryProject/CodeLibrary/FrmCodeDecode.Designer.cs
CodeLibraryProject/CodeLibrary/FrmCodeDecode.cs
CodeLibraryProject/CodeLibrary/resources/resources.txt
CodeLibraryProject/CodeTest/CodeCreater.cs
CodeLibraryProject/CodeTest/Program.cs
CodeLibraryProject/CodeLibrary/FrmCodeDecode.Designer.cs
查看文件 @
918db41
...
...
@@ -53,9 +53,9 @@
this
.
chbUseParam
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
txtParamPath
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
label4
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
btnLight
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button1
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
chbZxing
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
btnCopyN
=
new
System
.
Windows
.
Forms
.
Button
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
pictureBox1
)).
BeginInit
();
this
.
SuspendLayout
();
//
...
...
@@ -140,7 +140,7 @@
// btnbarCode
//
this
.
btnbarCode
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnbarCode
.
Location
=
new
System
.
Drawing
.
Point
(
896
,
50
);
this
.
btnbarCode
.
Location
=
new
System
.
Drawing
.
Point
(
905
,
50
);
this
.
btnbarCode
.
Name
=
"btnbarCode"
;
this
.
btnbarCode
.
Size
=
new
System
.
Drawing
.
Size
(
167
,
33
);
this
.
btnbarCode
.
TabIndex
=
9
;
...
...
@@ -152,7 +152,7 @@
//
this
.
btnLearn
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
btnLearn
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnLearn
.
Location
=
new
System
.
Drawing
.
Point
(
10
66
,
12
);
this
.
btnLearn
.
Location
=
new
System
.
Drawing
.
Point
(
10
74
,
12
);
this
.
btnLearn
.
Name
=
"btnLearn"
;
this
.
btnLearn
.
Size
=
new
System
.
Drawing
.
Size
(
109
,
33
);
this
.
btnLearn
.
TabIndex
=
10
;
...
...
@@ -163,7 +163,7 @@
// btnDCode
//
this
.
btnDCode
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnDCode
.
Location
=
new
System
.
Drawing
.
Point
(
896
,
12
);
this
.
btnDCode
.
Location
=
new
System
.
Drawing
.
Point
(
905
,
12
);
this
.
btnDCode
.
Name
=
"btnDCode"
;
this
.
btnDCode
.
Size
=
new
System
.
Drawing
.
Size
(
167
,
33
);
this
.
btnDCode
.
TabIndex
=
11
;
...
...
@@ -174,7 +174,7 @@
// btnClearLog
//
this
.
btnClearLog
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnClearLog
.
Location
=
new
System
.
Drawing
.
Point
(
691
,
50
);
this
.
btnClearLog
.
Location
=
new
System
.
Drawing
.
Point
(
785
,
50
);
this
.
btnClearLog
.
Name
=
"btnClearLog"
;
this
.
btnClearLog
.
Size
=
new
System
.
Drawing
.
Size
(
116
,
33
);
this
.
btnClearLog
.
TabIndex
=
12
;
...
...
@@ -239,7 +239,7 @@
//
this
.
btnExit
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
btnExit
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnExit
.
Location
=
new
System
.
Drawing
.
Point
(
10
66
,
50
);
this
.
btnExit
.
Location
=
new
System
.
Drawing
.
Point
(
10
74
,
50
);
this
.
btnExit
.
Name
=
"btnExit"
;
this
.
btnExit
.
Size
=
new
System
.
Drawing
.
Size
(
109
,
33
);
this
.
btnExit
.
TabIndex
=
18
;
...
...
@@ -344,18 +344,6 @@
this
.
label4
.
Text
=
"参数路径"
;
this
.
label4
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
//
// btnLight
//
this
.
btnLight
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnLight
.
Location
=
new
System
.
Drawing
.
Point
(
768
,
517
);
this
.
btnLight
.
Name
=
"btnLight"
;
this
.
btnLight
.
Size
=
new
System
.
Drawing
.
Size
(
59
,
33
);
this
.
btnLight
.
TabIndex
=
24
;
this
.
btnLight
.
Text
=
"提亮"
;
this
.
btnLight
.
UseVisualStyleBackColor
=
true
;
this
.
btnLight
.
Visible
=
false
;
this
.
btnLight
.
Click
+=
new
System
.
EventHandler
(
this
.
btnLigth_Click
);
//
// button1
//
this
.
button1
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
...
...
@@ -379,18 +367,29 @@
this
.
chbZxing
.
Text
=
"ZXing"
;
this
.
chbZxing
.
UseVisualStyleBackColor
=
true
;
//
// btnCopyN
//
this
.
btnCopyN
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnCopyN
.
Location
=
new
System
.
Drawing
.
Point
(
666
,
50
);
this
.
btnCopyN
.
Name
=
"btnCopyN"
;
this
.
btnCopyN
.
Size
=
new
System
.
Drawing
.
Size
(
116
,
33
);
this
.
btnCopyN
.
TabIndex
=
31
;
this
.
btnCopyN
.
Text
=
"复制名称"
;
this
.
btnCopyN
.
UseVisualStyleBackColor
=
true
;
this
.
btnCopyN
.
Click
+=
new
System
.
EventHandler
(
this
.
btnCopyN_Click
);
//
// FrmCodeDecode
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Font
;
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
1192
,
729
);
this
.
Controls
.
Add
(
this
.
btnCopyN
);
this
.
Controls
.
Add
(
this
.
chbZxing
);
this
.
Controls
.
Add
(
this
.
button1
);
this
.
Controls
.
Add
(
this
.
txtParamPath
);
this
.
Controls
.
Add
(
this
.
label4
);
this
.
Controls
.
Add
(
this
.
chbUseParam
);
this
.
Controls
.
Add
(
this
.
btnAn
);
this
.
Controls
.
Add
(
this
.
btnLight
);
this
.
Controls
.
Add
(
this
.
cmbCodeType
);
this
.
Controls
.
Add
(
this
.
cmbCamera
);
this
.
Controls
.
Add
(
this
.
label2
);
...
...
@@ -449,9 +448,9 @@
private
System
.
Windows
.
Forms
.
CheckBox
chbUseParam
;
private
System
.
Windows
.
Forms
.
TextBox
txtParamPath
;
private
System
.
Windows
.
Forms
.
Label
label4
;
private
System
.
Windows
.
Forms
.
Button
btnLight
;
private
System
.
Windows
.
Forms
.
Button
button1
;
private
System
.
Windows
.
Forms
.
CheckBox
chbZxing
;
private
System
.
Windows
.
Forms
.
Button
btnCopyN
;
}
}
CodeLibraryProject/CodeLibrary/FrmCodeDecode.cs
查看文件 @
918db41
...
...
@@ -220,11 +220,11 @@ namespace CodeLibrary
codeList
=
HDCodeHelper
.
DecodeCode
(
ho_image
,
count
,
codeParamPath
,
cmbCodeType
.
Text
);
}
if
(
codeList
.
Count
<=
0
)
{
zxingDecode
(
map
,
cmbCodeType
.
Text
);
}
else
//
if (codeList.Count <= 0)
//
{
//
zxingDecode(map, cmbCodeType.Text);
//
}
//
else
{
ShowCode
(
codeList
);
txtResult
.
Text
+=
"\r\n elapsed time:"
+
stopwatch
.
Elapsed
.
ToString
();
...
...
@@ -387,5 +387,11 @@ namespace CodeLibrary
HDLogUtil
.
error
(
ex
.
ToString
());
}
}
private
void
btnCopyN_Click
(
object
sender
,
EventArgs
e
)
{
string
text
=
cmbCamera
.
Text
;
Clipboard
.
SetDataObject
(
text
);
}
}
}
CodeLibraryProject/CodeLibrary/resources/resources.txt
查看文件 @
918db41
...
...
@@ -3,6 +3,7 @@ FrmCodeDecode_label4_Text,参数路径,Parameters of the path
FrmCodeDecode_chbUseParam_Text,使用参数,operation parameter
FrmCodeDecode_btnAn_Text,变暗,darken
FrmCodeDecode_btnLight_Text,提亮,brighten
FrmCodeDecode_btnCopyN_Text,复制名称,Copy Name
FrmCodeDecode_label3_Text,条码类型:,Bar code type:
FrmCodeDecode_label2_Text,相机列表:,Camera list:
FrmCodeDecode_btnExit_Text,退出,Exit
...
...
CodeLibraryProject/CodeTest/CodeCreater.cs
查看文件 @
918db41
...
...
@@ -23,10 +23,11 @@ namespace CodeTest
{
Directory
.
CreateDirectory
(
targetFilePath
);
}
for
(
int
i
=
1
00000
;
i
<=
100000
+
count
;
i
++)
for
(
int
i
=
1
;
i
<=
count
;
i
++)
{
string
name
=
"pn;A"
+
i
.
ToString
().
PadLeft
(
6
,
'0'
)
+
";1000"
;
Bitmap
map
=
ZXingCode
(
name
,
400
,
BarcodeFormat
.
CODE_128
);
string
name
=
i
.
ToString
().
PadLeft
(
8
,
'0'
);
//string name = "Line;A" + i.ToString().PadLeft(6, '0') + ";1000";
Bitmap
map
=
ZXingCode
(
name
,
400
,
BarcodeFormat
.
QR_CODE
);
// Bitmap map = DataMatrix(name, 200);
if
(
map
!=
null
)
{
...
...
CodeLibraryProject/CodeTest/Program.cs
查看文件 @
918db41
...
...
@@ -18,8 +18,8 @@ namespace CodeTest
[
STAThread
]
static
void
Main
()
{
// CodeCreater.CreateCode(1
0);
//
return;
//CodeCreater.CreateCode(2
0);
//
return;
Application
.
EnableVisualStyles
();
...
...
@@ -30,7 +30,7 @@ namespace CodeTest
//Application.Run(new FrmTest());
//string filename = @"C:/Users/WORK/Desktop/西安二维码/IMG_20190730_165612.jpg";
//Bitmap img = (Bitmap)Image.FromFile(filename).Clone();
//string text
=
CodeCreater.DecodeQRCode(img);
//string text
=
CodeCreater.DecodeQRCode(img);
//Console.WriteLine(text);
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论