Skip to content

Commit

Permalink
feat: Auto select Smart Camera and a few UI changes
Browse files Browse the repository at this point in the history
  • Loading branch information
WhatDamon committed Nov 29, 2024
1 parent a367a00 commit 8daf364
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
22 changes: 5 additions & 17 deletions WndMain.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions WndMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,23 @@ public WndMain()
private void CameraDevicesLoad()
{
cameraComboBox.Items.Clear();
bool _cameraFound = false;
foreach (var i in FindCamera.EnumDevices.Devices)
{
// 添加设备名称到下拉列表
cameraComboBox.Items.Add(i);

// 检查是否找到特定摄像头
if (i.ToString() == "Smart Camera" || _cameraFound == false) // 希沃一体机顶部摄像头名称为Smart Camera
{
cameraComboBox.SelectedItem = i;
_cameraFound = true;
}
}
if (cameraComboBox.Items.Count == 0)
{
currentStatusLabel.Text = "未找到摄像头";
cameraComboBox.Enabled = false;
}
else
{
Expand Down

0 comments on commit 8daf364

Please # to comment.