Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
AccAOI
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit a65495f4
由
LN
编写于
2019-08-06 15:16:43 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
加载图片修改
1 个父辈
1cc8c708
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
27 行增加
和
10 行删除
AccAOI/FrmAoiSetting.cs
AccAOI/control/AioMarkControl.cs
AccAOI/control/AioTempMatchControl.cs
AccAOI/FrmAoiSetting.cs
查看文件 @
a65495f
...
@@ -69,7 +69,9 @@ namespace AccAOI
...
@@ -69,7 +69,9 @@ namespace AccAOI
if
(
System
.
IO
.
File
.
Exists
(
defaultImg
))
if
(
System
.
IO
.
File
.
Exists
(
defaultImg
))
{
{
//读取图片内容
//读取图片内容
BaseImg
=
(
Image
)
Image
.
FromFile
(
defaultImg
).
Clone
();
Image
file
=
(
Image
)
Image
.
FromFile
(
defaultImg
);
BaseImg
=
new
Bitmap
(
file
);
file
.
Dispose
();
imageBox1
.
Image
=
BaseImg
;
imageBox1
.
Image
=
BaseImg
;
}
}
...
@@ -121,7 +123,10 @@ namespace AccAOI
...
@@ -121,7 +123,10 @@ namespace AccAOI
string
fileName
=
openDialog
.
FileName
;
string
fileName
=
openDialog
.
FileName
;
//读取图片内容
//读取图片内容
BaseImg
=
(
Image
)
Image
.
FromFile
(
fileName
).
Clone
();
Image
file
=
Image
.
FromFile
(
fileName
);
// BaseImg = (Image)Image.FromFile(fileName).Clone();
BaseImg
=
new
Bitmap
(
file
);
file
.
Dispose
();
if
(
Project
!=
null
)
if
(
Project
!=
null
)
{
{
Project
.
standardImage
=
BaseImg
;
Project
.
standardImage
=
BaseImg
;
...
@@ -143,22 +148,25 @@ namespace AccAOI
...
@@ -143,22 +148,25 @@ namespace AccAOI
MessageBox
.
Show
(
"清先选择相机"
);
MessageBox
.
Show
(
"清先选择相机"
);
return
;
return
;
}
//将图片保存到本地重新加载
}
//将图片保存到本地重新加载
string
file
Name
=
Application
.
StartupPath
+
@"\aimage\" + DateTime.Now.ToString("
yyyy
-
MM
-
dd
-
HH
-
mm
-
ss
") + DateTime.Now.Millisecond.ToString().PadLeft(3, '0') ;
string
file
Path
=
Application
.
StartupPath
+
@"\aimage\" + DateTime.Now.ToString("
yyyy
-
MM
-
dd
-
HH
-
mm
-
ss
") + DateTime.Now.Millisecond.ToString().PadLeft(3, '0') ;
string
file
=
@"\test.bmp"
;
string
file
Name
=
@"\test.bmp"
;
using
(
Bitmap
img
=
CameraManager
.
GetCamerImage
(
camera
))
using
(
Bitmap
img
=
CameraManager
.
GetCamerImage
(
camera
))
{
{
if
(
img
!=
null
)
if
(
img
!=
null
)
{
{
string
path
=
Path
.
GetFullPath
(
file
Name
);
string
path
=
Path
.
GetFullPath
(
file
Path
);
if
(!
Directory
.
Exists
(
path
))
if
(!
Directory
.
Exists
(
path
))
{
{
Directory
.
CreateDirectory
(
path
);
Directory
.
CreateDirectory
(
path
);
}
}
img
.
Save
(
file
Name
+
fil
e
,
ImageFormat
.
Bmp
);
img
.
Save
(
file
Path
+
fileNam
e
,
ImageFormat
.
Bmp
);
}
}
}
}
GC
.
Collect
();
GC
.
Collect
();
BaseImg
=
(
Image
)
Image
.
FromFile
(
fileName
+
file
).
Clone
();
Image
file
=
(
Image
)
Image
.
FromFile
(
filePath
+
fileName
);
BaseImg
=
new
Bitmap
(
file
);
file
.
Dispose
();
// BaseImg = (Image)Image.FromFile(filePath+ file).Clone();
//读取图片内容
//读取图片内容
//BaseImg = (Image)img.Clone();
//BaseImg = (Image)img.Clone();
if
(
Project
!=
null
)
if
(
Project
!=
null
)
...
@@ -542,7 +550,10 @@ namespace AccAOI
...
@@ -542,7 +550,10 @@ namespace AccAOI
string
fileName
=
openDialog
.
FileName
;
string
fileName
=
openDialog
.
FileName
;
//读取图片内容
//读取图片内容
TestImage
=
(
Image
)
Image
.
FromFile
(
fileName
).
Clone
();
// TestImage = (Image)Image.FromFile(fileName).Clone();
Image
file
=
(
Image
)
Image
.
FromFile
(
fileName
);
TestImage
=
new
Bitmap
(
file
);
file
.
Dispose
();
testImageBox1
.
Image
=
TestImage
;
testImageBox1
.
Image
=
TestImage
;
if
(
testImageBox1
.
Visible
.
Equals
(
false
))
if
(
testImageBox1
.
Visible
.
Equals
(
false
))
{
{
...
...
AccAOI/control/AioMarkControl.cs
查看文件 @
a65495f
...
@@ -63,7 +63,10 @@ namespace AccAOI.control
...
@@ -63,7 +63,10 @@ namespace AccAOI.control
if
(
File
.
Exists
(
fileName
))
if
(
File
.
Exists
(
fileName
))
{
{
//读取图片内容
//读取图片内容
checkImg
=
(
Image
)
Image
.
FromFile
(
fileName
).
Clone
();
// checkImg = (Image)Image.FromFile(fileName).Clone();
Image
file
=
(
Image
)
Image
.
FromFile
(
fileName
);
checkImg
=
new
Bitmap
(
file
);
file
.
Dispose
();
}
}
if
(
checkImg
==
null
)
if
(
checkImg
==
null
)
{
{
...
...
AccAOI/control/AioTempMatchControl.cs
查看文件 @
a65495f
...
@@ -62,7 +62,10 @@ namespace AccAOI.control
...
@@ -62,7 +62,10 @@ namespace AccAOI.control
if
(
File
.
Exists
(
fileName
))
if
(
File
.
Exists
(
fileName
))
{
{
//读取图片内容
//读取图片内容
checkImg
=
(
Image
)
Image
.
FromFile
(
fileName
).
Clone
();
//checkImg = (Image)Image.FromFile(fileName).Clone();
Image
file
=
(
Image
)
Image
.
FromFile
(
fileName
);
checkImg
=
new
Bitmap
(
file
);
file
.
Dispose
();
}
}
if
(
checkImg
==
null
)
if
(
checkImg
==
null
)
{
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论