导航相机实时影像显示

This commit is contained in:
李伟
2026-04-13 15:15:23 +08:00
parent ace1c70ddf
commit f22a4b74a1
2 changed files with 8 additions and 15 deletions
@@ -42,8 +42,7 @@
Stretch="Uniform"
StretchDirection="Both"
RenderOptions.BitmapScalingMode="HighQuality"
MouseMove="ImgCamera_MouseMove"
MouseLeave="ImgCamera_MouseLeave" />
MouseLeftButtonDown="ImgCamera_MouseLeftButtonDown" />
</Border>
<!-- 状态信息 -->
@@ -68,32 +67,32 @@
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button
Command="{Binding ConnectCameraCommand}"
Padding="8,4"
Width="60" Height="26"
Margin="2"
Background="#4CAF50"
Foreground="#000000"
Content="连接" />
<Button
Command="{Binding DisconnectCameraCommand}"
Padding="8,4"
Width="60" Height="26"
Margin="2"
Background="#F44336"
Foreground="#000000"
Content="断开" />
<Button
Command="{Binding StartGrabCommand}"
Padding="8,4"
Width="60" Height="26"
Margin="2"
Background="#2196F3"
Foreground="#000000"
Content="开始采集" />
Content="采集" />
<Button
Command="{Binding StopGrabCommand}"
Padding="8,4"
Width="60" Height="26"
Margin="2"
Background="#FF9800"
Foreground="#000000"
Content="停止采集" />
Content="停止" />
<CheckBox
IsChecked="{Binding IsLiveViewEnabled}"
VerticalAlignment="Center"
@@ -28,7 +28,7 @@ namespace XplorePlane.Views
}
}
private void ImgCamera_MouseMove(object sender, MouseEventArgs e)
private void ImgCamera_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (_viewModel?.CameraImageSource == null) return;
@@ -44,11 +44,5 @@ namespace XplorePlane.Views
_viewModel.CameraPixelCoord = $"X: {px}, Y: {py}";
}
}
private void ImgCamera_MouseLeave(object sender, MouseEventArgs e)
{
if (_viewModel != null)
_viewModel.CameraPixelCoord = "";
}
}
}