Commit d8359e4a by 陶然

优化

parent 387a55f5
...@@ -256,14 +256,21 @@ namespace Kivii.Sample.ImageUploader ...@@ -256,14 +256,21 @@ namespace Kivii.Sample.ImageUploader
private void connect(int selectedIndex = 0) private void connect(int selectedIndex = 0)
{ {
if (videoDevice == null) return; if (InvokeRequired)
if ((videoCapabilities != null) && (videoCapabilities.Length != 0)) {
Invoke(new Action<int>(connect), selectedIndex);
}
else
{ {
videoDevice.VideoResolution = videoCapabilities[selectedIndex]; if (videoDevice == null) return;
if ((videoCapabilities != null) && (videoCapabilities.Length != 0))
{
videoDevice.VideoResolution = videoCapabilities[selectedIndex];
}
vspCamView.VideoSource = videoDevice;
vspCamView.Start();
tbxReportId.Focus();
} }
vspCamView.VideoSource = videoDevice;
vspCamView.Start();
tbxReportId.Focus();
} }
private void disconnect() private void disconnect()
...@@ -304,6 +311,8 @@ namespace Kivii.Sample.ImageUploader ...@@ -304,6 +311,8 @@ namespace Kivii.Sample.ImageUploader
} }
} }
} }
tbxReportId.Focus();
} }
catch (Exception ex) catch (Exception ex)
{ {
......
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