Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
GeneralClassLibrary
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 2ef1b3ce
由
LN
编写于
2021-04-30 10:06:14 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
eyem可选择是否默认打钩
1 个父辈
32b2ae2c
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
26 行增加
和
24 行删除
CodeLibraryProject/CodeLibrary/FrmCodeDecode.Designer.cs
CodeLibraryProject/CodeLibrary/FrmCodeDecode.cs
CodeLibraryProject/CodeLibrary/HDCodeHelper.cs
CodeLibraryProject/CodeLibrary/FrmCodeDecode.Designer.cs
查看文件 @
2ef1b3c
...
...
@@ -51,7 +51,7 @@
this
.
txtParamPath
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
label4
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
btnScanTest
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
chb
Zxing
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
chb
Eyem
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
label5
=
new
System
.
Windows
.
Forms
.
Label
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
pictureBox1
)).
BeginInit
();
this
.
SuspendLayout
();
...
...
@@ -317,18 +317,18 @@
this
.
btnScanTest
.
Visible
=
false
;
this
.
btnScanTest
.
Click
+=
new
System
.
EventHandler
(
this
.
btnScanTest_Click
);
//
// chb
Zxing
// chb
Eyem
//
this
.
chb
Zxing
.
AutoSize
=
true
;
this
.
chb
Zxing
.
Checked
=
true
;
this
.
chb
Zxing
.
CheckState
=
System
.
Windows
.
Forms
.
CheckState
.
Checked
;
this
.
chb
Zxing
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
chb
Zxing
.
Location
=
new
System
.
Drawing
.
Point
(
765
,
16
);
this
.
chb
Zxing
.
Name
=
"chbZxing
"
;
this
.
chb
Zxing
.
Size
=
new
System
.
Drawing
.
Size
(
103
,
21
);
this
.
chb
Zxing
.
TabIndex
=
31
;
this
.
chb
Zxing
.
Text
=
"EyemDecode"
;
this
.
chb
Zxing
.
UseVisualStyleBackColor
=
true
;
this
.
chb
Eyem
.
AutoSize
=
true
;
this
.
chb
Eyem
.
Checked
=
true
;
this
.
chb
Eyem
.
CheckState
=
System
.
Windows
.
Forms
.
CheckState
.
Checked
;
this
.
chb
Eyem
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
chb
Eyem
.
Location
=
new
System
.
Drawing
.
Point
(
765
,
16
);
this
.
chb
Eyem
.
Name
=
"chbEyem
"
;
this
.
chb
Eyem
.
Size
=
new
System
.
Drawing
.
Size
(
103
,
21
);
this
.
chb
Eyem
.
TabIndex
=
31
;
this
.
chb
Eyem
.
Text
=
"EyemDecode"
;
this
.
chb
Eyem
.
UseVisualStyleBackColor
=
true
;
//
// label5
//
...
...
@@ -344,7 +344,7 @@
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Font
;
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
1375
,
729
);
this
.
Controls
.
Add
(
this
.
label5
);
this
.
Controls
.
Add
(
this
.
chb
Zxing
);
this
.
Controls
.
Add
(
this
.
chb
Eyem
);
this
.
Controls
.
Add
(
this
.
btnScanTest
);
this
.
Controls
.
Add
(
this
.
txtParamPath
);
this
.
Controls
.
Add
(
this
.
label4
);
...
...
@@ -404,7 +404,7 @@
private
System
.
Windows
.
Forms
.
TextBox
txtParamPath
;
private
System
.
Windows
.
Forms
.
Label
label4
;
private
System
.
Windows
.
Forms
.
Button
btnScanTest
;
private
System
.
Windows
.
Forms
.
CheckBox
chb
Zxing
;
private
System
.
Windows
.
Forms
.
CheckBox
chb
Eyem
;
private
System
.
Windows
.
Forms
.
Label
label5
;
}
}
...
...
CodeLibraryProject/CodeLibrary/FrmCodeDecode.cs
查看文件 @
2ef1b3c
...
...
@@ -25,9 +25,10 @@ namespace CodeLibrary
// private List<string> baslerNameList = new List<string>();
// private List<string> hikNameList = new List<string>();
public
FrmCodeDecode
()
public
FrmCodeDecode
(
bool
eyemSel
=
true
)
{
InitializeComponent
();
chbEyem
.
Checked
=
eyemSel
;
}
private
string
selCamera
=
CodeResourceControl
.
GetString
(
CodeResourceControl
.
selCamera
,
"请先选择相机"
);
private
string
selImage
=
CodeResourceControl
.
GetString
(
CodeResourceControl
.
selImage
,
"请先选择图片"
);
...
...
@@ -208,7 +209,7 @@ namespace CodeLibrary
stopwatch
.
Restart
();
HDCodeHelper
.
HalconWindow
=
this
.
hWindowControl1
.
HalconWindow
;
if
(
chb
Zxing
.
Checked
)
if
(
chb
Eyem
.
Checked
)
{
if
(
pictureBox1
.
Image
==
null
)
{
...
...
@@ -265,7 +266,7 @@ namespace CodeLibrary
{
codeParamPath
=
""
;
}
if
(
chb
Zxing
.
Checked
)
if
(
chb
Eyem
.
Checked
)
{
if
(
pictureBox1
.
Image
==
null
)
{
...
...
@@ -351,7 +352,7 @@ namespace CodeLibrary
{
try
{
if
(!
chb
Zxing
.
Checked
)
if
(!
chb
Eyem
.
Checked
)
{
HObject
bitmap
=
GetCameraBitmap
(
out
Bitmap
b
);
if
(
bitmap
!=
null
)
...
...
CodeLibraryProject/CodeLibrary/HDCodeHelper.cs
查看文件 @
2ef1b3c
...
...
@@ -320,12 +320,7 @@ namespace CodeLibrary
HOperatorSet
.
ReadImage
(
out
ho_Image
,
filePath
);
return
DecodeBarCode
(
ho_Image
);
}
//public static List<CodeInfo> DecodeBarCode(Bitmap bitmap)
//{
// HObject ho_image;
// Bitmap2HObjectBpp24(bitmap,out ho_image);
// return DecodeBarCode(ho_image);
//}
public
static
List
<
CodeInfo
>
DecodeBarCode
(
HObject
ho_Image
)
{
...
...
@@ -341,6 +336,12 @@ namespace CodeLibrary
HTuple
hv_Row1
=
null
;
HTuple
hv_Column
=
null
;
HTuple
hv_Orientation
=
null
;
HObject
ExpTmpOutVar_0
;
HOperatorSet
.
ZoomImageFactor
(
ho_Image
,
out
ExpTmpOutVar_0
,
2
,
2
,
"bilinear"
);
ho_Image
.
Dispose
();
ho_Image
=
ExpTmpOutVar_0
;
HOperatorSet
.
Rgb1ToGray
(
ho_Image
,
out
ho_GrayImage
);
HOperatorSet
.
GenEmptyObj
(
out
ho_SymbolRegions
);
ho_SymbolRegions
.
Dispose
();
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论