Commit 4da8a85c by Neo Turing

优化

parent 8ef7f384
...@@ -124,7 +124,7 @@ namespace Kivii.Sample.ImageUploader ...@@ -124,7 +124,7 @@ namespace Kivii.Sample.ImageUploader
//cbxResolution.Items.Clear(); //cbxResolution.Items.Clear();
currentCameraIndex = 0; currentCameraIndex = 0;
cameraQuantity = 0; cameraQuantity = 0;
gbCamView.Text = "相机视图"; //gbCamView.Text = "相机视图";
tbxReportId.Text = string.Empty; tbxReportId.Text = string.Empty;
outputMessage(string.Empty, true); outputMessage(string.Empty, true);
//lbCurrentReportId.Text = "__________"; //lbCurrentReportId.Text = "__________";
...@@ -541,24 +541,32 @@ namespace Kivii.Sample.ImageUploader ...@@ -541,24 +541,32 @@ namespace Kivii.Sample.ImageUploader
{ {
if (videoDevice != null && vspCamView.IsRunning) if (videoDevice != null && vspCamView.IsRunning)
{ {
// 捕获当前帧 try
Bitmap bitmap = (Bitmap)vspCamView.GetCurrentVideoFrame().Clone();
var picName = string.Empty;
string reportId = string.Empty;
if (currentReport != null)
{ {
reportId = currentReport.ReportId; // 捕获当前帧
Bitmap bitmap = (Bitmap)vspCamView.GetCurrentVideoFrame().Clone();
var picName = string.Empty;
string reportId = string.Empty;
if (currentReport != null)
{
reportId = currentReport.ReportId;
}
if (!reportId.IsNullOrEmpty())
{
picName = reportId + "_";
}
picName += DateTime.Now.ToString("mmssfff");
var photo = new Photo(bitmap, picName);
addSnapshot(photo);
Thread.Sleep(50);
showSnapshot(photo);
} }
if (!reportId.IsNullOrEmpty()) catch(Exception ex)
{ {
picName = reportId + "_"; MessageBox.Show("相机模组未初始化完成,稍后重试");
} }
picName += DateTime.Now.ToString("mmssfff");
var photo = new Photo(bitmap, picName);
addSnapshot(photo);
Thread.Sleep(50);
showSnapshot(photo);
} }
else else
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment