Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张东亮
/
NS100
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 5f5fd015
由
刘韬
编写于
2025-04-24 17:00:22 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
模板界面打开本地图像,闪烁bug
1 个父辈
9a7f80c7
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
21 行增加
和
5 行删除
SmartScan/SetControl/UsrMaterialTemplate.cs
SmartScan/SetControl/UsrMaterialTemplate.cs
查看文件 @
5f5fd01
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Drawing
;
using
System.Drawing.Imaging
;
using
System.IO
;
using
System.IO
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Web.UI.WebControls
;
using
System.Web.UI.WebControls
;
using
System.Windows.Forms
;
using
System.Windows.Forms
;
using
Asa.FaceControl
;
using
Asa.FaceControl
;
...
@@ -310,13 +313,23 @@ namespace SmartScan
...
@@ -310,13 +313,23 @@ namespace SmartScan
bmp
=
ObjConversion
.
ReadImageFile
(
dlg
.
FileName
);
bmp
=
ObjConversion
.
ReadImageFile
(
dlg
.
FileName
);
LstCode
.
Items
.
Clear
();
LstCode
.
Items
.
Clear
();
ImgShow
.
CodeCenterClear
();
ImgShow
.
CodeCenterClear
();
//ImgShow.Image = null;
mateCopy
[
mateIndex
].
State
=
TemplateState
.
Unsaved
;
mateCopy
[
mateIndex
].
State
=
TemplateState
.
Unsaved
;
mateCopy
[
mateIndex
].
ImagePath
=
""
;
mateCopy
[
mateIndex
].
ImagePath
=
""
;
mateCopy
[
mateIndex
].
Image
=
bmp
;
mateCopy
[
mateIndex
].
Image
=
bmp
;
ImgShow
.
Image
=
bmp
;
Application
.
DoEvents
();
ImgShow
.
Image
=
bmp
;
// ConvertTo24bppRgb(bmp);
iscamp
=
false
;
iscamp
=
false
;
}
}
public
Bitmap
ConvertTo24bppRgb
(
Bitmap
argbImage
)
{
Bitmap
rgbImage
=
new
Bitmap
(
argbImage
.
Width
,
argbImage
.
Height
,
PixelFormat
.
Format24bppRgb
);
using
(
Graphics
g
=
Graphics
.
FromImage
(
rgbImage
))
{
g
.
DrawImage
(
argbImage
,
new
Rectangle
(
0
,
0
,
rgbImage
.
Width
,
rgbImage
.
Height
));
}
return
rgbImage
;
}
public
bool
iscamp
=
true
;
public
bool
iscamp
=
true
;
private
void
BtnScanCode_Click
(
object
sender
,
EventArgs
e
)
private
void
BtnScanCode_Click
(
object
sender
,
EventArgs
e
)
{
{
...
@@ -329,7 +342,8 @@ namespace SmartScan
...
@@ -329,7 +342,8 @@ namespace SmartScan
return
;
return
;
}
}
List
<
BarcodeInfo
>
info
=
null
;
List
<
BarcodeInfo
>
info
=
null
;
LstCode
.
Items
.
Clear
();
ImgShow
.
CodeCenterClear
();
if
(
iscamp
&&
Camera
.
useIDCamera
)
if
(
iscamp
&&
Camera
.
useIDCamera
)
{
{
Bitmap
[]
result
=
Camera
.
CaptureAndGetCode
(
out
info
);
Bitmap
[]
result
=
Camera
.
CaptureAndGetCode
(
out
info
);
...
@@ -345,8 +359,7 @@ namespace SmartScan
...
@@ -345,8 +359,7 @@ namespace SmartScan
}
}
//info = Camera.GetBarCode(bmp);
//info = Camera.GetBarCode(bmp);
LstCode
.
Items
.
Clear
();
ImgShow
.
CodeCenterClear
();
mateCopy
[
mateIndex
].
Match
.
Clear
();
mateCopy
[
mateIndex
].
Match
.
Clear
();
mateCopy
[
mateIndex
].
Code
.
Clear
();
mateCopy
[
mateIndex
].
Code
.
Clear
();
mateCopy
[
mateIndex
].
Ocr
.
Clear
();
mateCopy
[
mateIndex
].
Ocr
.
Clear
();
...
@@ -767,8 +780,11 @@ namespace SmartScan
...
@@ -767,8 +780,11 @@ namespace SmartScan
{
{
int
matchCount
=
0
;
int
matchCount
=
0
;
var
codeText
=
codeinfo
.
Text
;
var
codeText
=
codeinfo
.
Text
;
if
(
codeinfo
.
CodeType
==
"OCR"
)
{
codeText
=
codeText
.
Replace
(
"\r"
,
""
);
codeText
=
codeText
.
Replace
(
"\r"
,
""
);
codeText
=
codeText
.
Replace
(
"\n"
,
""
);
codeText
=
codeText
.
Replace
(
"\n"
,
""
);
}
code
=
codeMatch
[
i
].
CaseSensitive
?
codeText
:
codeText
.
ToUpper
();
code
=
codeMatch
[
i
].
CaseSensitive
?
codeText
:
codeText
.
ToUpper
();
bool
ismatch
=
true
;
bool
ismatch
=
true
;
//匹配CodeType
//匹配CodeType
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论