Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
GeneralClassLibrary
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 1085af9b
由
LN
编写于
2021-03-04 17:19:48 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
打开图片报错修改
1 个父辈
43f333cc
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
15 行增加
和
62 行删除
CodeLibraryProject/CodeLibrary/FrmCodeDecode.Designer.cs
CodeLibraryProject/CodeLibrary/FrmCodeDecode.cs
CodeLibraryProject/CodeLibrary/HDCodeHelper.cs
CodeLibraryProject/CodeLibrary/FrmCodeDecode.Designer.cs
查看文件 @
1085af9
...
...
@@ -85,7 +85,7 @@
this
.
pictureBox1
.
Size
=
new
System
.
Drawing
.
Size
(
451
,
313
);
this
.
pictureBox1
.
SizeMode
=
System
.
Windows
.
Forms
.
PictureBoxSizeMode
.
Zoom
;
this
.
pictureBox1
.
TabIndex
=
2
;
this
.
pictureBox1
.
TabStop
=
false
;
this
.
pictureBox1
.
TabStop
=
false
;
//
// txtResult
//
...
...
@@ -148,7 +148,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
(
711
,
49
);
this
.
btnClearLog
.
Location
=
new
System
.
Drawing
.
Point
(
675
,
49
);
this
.
btnClearLog
.
Name
=
"btnClearLog"
;
this
.
btnClearLog
.
Size
=
new
System
.
Drawing
.
Size
(
116
,
33
);
this
.
btnClearLog
.
TabIndex
=
12
;
...
...
@@ -283,7 +283,7 @@
this
.
chbUseParam
.
Checked
=
true
;
this
.
chbUseParam
.
CheckState
=
System
.
Windows
.
Forms
.
CheckState
.
Checked
;
this
.
chbUseParam
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
chbUseParam
.
Location
=
new
System
.
Drawing
.
Point
(
711
,
16
);
this
.
chbUseParam
.
Location
=
new
System
.
Drawing
.
Point
(
675
,
16
);
this
.
chbUseParam
.
Name
=
"chbUseParam"
;
this
.
chbUseParam
.
Size
=
new
System
.
Drawing
.
Size
(
75
,
21
);
this
.
chbUseParam
.
TabIndex
=
26
;
...
...
@@ -327,7 +327,7 @@
this
.
chbZxing
.
Checked
=
true
;
this
.
chbZxing
.
CheckState
=
System
.
Windows
.
Forms
.
CheckState
.
Checked
;
this
.
chbZxing
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
chbZxing
.
Location
=
new
System
.
Drawing
.
Point
(
7
92
,
16
);
this
.
chbZxing
.
Location
=
new
System
.
Drawing
.
Point
(
7
65
,
16
);
this
.
chbZxing
.
Name
=
"chbZxing"
;
this
.
chbZxing
.
Size
=
new
System
.
Drawing
.
Size
(
103
,
21
);
this
.
chbZxing
.
TabIndex
=
31
;
...
...
CodeLibraryProject/CodeLibrary/FrmCodeDecode.cs
查看文件 @
1085af9
...
...
@@ -146,11 +146,12 @@ namespace CodeLibrary
Image
img
=
(
Image
)
Image
.
FromFile
(
filename
).
Clone
();
pictureBox1
.
Image
=
img
;
Bitmap
bitmap
=
new
Bitmap
(
filename
);
HDCodeLearnHelper
.
DefaultBitmap
=
bitmap
;
HDCodeLearnHelper
.
DefaultBitmap
=
bitmap
;
HObject
hoimg
;
HDCodeHelper
.
Bitmap2HObjectBpp24
(
bitmap
,
out
hoimg
);
HOperatorSet
.
ReadImage
(
out
hoimg
,
filename
);
//HDCodeHelper.Bitmap2HObjectBpp24(bitmap, out hoimg);
HDCodeLearnHelper
.
DefaultImage
=
hoimg
;
ShowImage
(
hoimg
);
ShowImage
(
hoimg
);
}
}
...
...
@@ -226,6 +227,10 @@ namespace CodeLibrary
}
public
void
ShowImage
(
HObject
ho_Image
)
{
if
(
ho_Image
==
null
)
{
return
;
}
HTuple
width
,
height
;
HOperatorSet
.
GetImageSize
(
ho_Image
,
out
width
,
out
height
);
...
...
@@ -507,61 +512,7 @@ namespace CodeLibrary
//ScanTest();
ScanDemo
(
100
);
});
}
private
void
ScanTest
()
{
for
(
int
index
=
1
;
index
<=
200
;
index
++)
{
try
{
label5
.
Text
=
"扫码测试_"
+
index
;
int
name
=
(
index
%
3
)
+
1
;
string
filename
=
@"F:\test\" + name + "
.
hobj
";
if
(!
File
.
Exists
(
filename
))
{
continue
;
}
ClearPicImg
();
if
(
filename
.
EndsWith
(
".hobj"
))
{
HObject
hObject
=
null
;
HOperatorSet
.
GenEmptyObj
(
out
hObject
);
hObject
.
ReadObject
(
filename
);
if
(
hObject
!=
null
)
{
HDCodeLearnHelper
.
DefaultImage
=
hObject
;
ShowImage
(
hObject
);
}
else
{
MessageBox
.
Show
(
"读取文件失败:"
+
filename
);
}
}
else
{
//读取图片内容
Image
img
=
(
Image
)
Image
.
FromFile
(
filename
).
Clone
();
pictureBox1
.
Image
=
img
;
Bitmap
bitmap
=
new
Bitmap
(
pictureBox1
.
Image
);
HObject
hoimg
;
HDCodeHelper
.
Bitmap2HObjectBpp24
(
bitmap
,
out
hoimg
);
HDCodeLearnHelper
.
DefaultImage
=
hoimg
;
ShowImage
(
hoimg
);
}
btnDCode_Click
(
null
,
null
);
Thread
.
Sleep
(
100
);
}
catch
(
Exception
ex
)
{
HDLogUtil
.
error
(
"ScanTest["
+
index
+
"]出错:"
+
ex
.
ToString
());
}
}
this
.
Enabled
=
true
;
this
.
Cursor
=
Cursors
.
Default
;
}
}
private
void
ScanDemo
(
int
whileCount
=
1
)
{
...
...
@@ -645,5 +596,6 @@ namespace CodeLibrary
string
text
=
cmbCamera
.
Text
;
Clipboard
.
SetDataObject
(
text
);
}
}
}
CodeLibraryProject/CodeLibrary/HDCodeHelper.cs
查看文件 @
1085af9
...
...
@@ -258,6 +258,7 @@ namespace CodeLibrary
HDLogUtil
.
error
(
"将BitMap转换为HObject对象出错:"
+
ex
.
ToString
());
ho_Image
=
null
;
}
ho_Image
=
null
;
return
false
;
}
public
static
void
HObject2Bpp8
(
HObject
image
,
out
Bitmap
res
)
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论