导航相机实时影像显示

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" Stretch="Uniform"
StretchDirection="Both" StretchDirection="Both"
RenderOptions.BitmapScalingMode="HighQuality" RenderOptions.BitmapScalingMode="HighQuality"
MouseMove="ImgCamera_MouseMove" MouseLeftButtonDown="ImgCamera_MouseLeftButtonDown" />
MouseLeave="ImgCamera_MouseLeave" />
</Border> </Border>
<!-- 状态信息 --> <!-- 状态信息 -->
@@ -68,32 +67,32 @@
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button <Button
Command="{Binding ConnectCameraCommand}" Command="{Binding ConnectCameraCommand}"
Padding="8,4" Width="60" Height="26"
Margin="2" Margin="2"
Background="#4CAF50" Background="#4CAF50"
Foreground="#000000" Foreground="#000000"
Content="连接" /> Content="连接" />
<Button <Button
Command="{Binding DisconnectCameraCommand}" Command="{Binding DisconnectCameraCommand}"
Padding="8,4" Width="60" Height="26"
Margin="2" Margin="2"
Background="#F44336" Background="#F44336"
Foreground="#000000" Foreground="#000000"
Content="断开" /> Content="断开" />
<Button <Button
Command="{Binding StartGrabCommand}" Command="{Binding StartGrabCommand}"
Padding="8,4" Width="60" Height="26"
Margin="2" Margin="2"
Background="#2196F3" Background="#2196F3"
Foreground="#000000" Foreground="#000000"
Content="开始采集" /> Content="采集" />
<Button <Button
Command="{Binding StopGrabCommand}" Command="{Binding StopGrabCommand}"
Padding="8,4" Width="60" Height="26"
Margin="2" Margin="2"
Background="#FF9800" Background="#FF9800"
Foreground="#000000" Foreground="#000000"
Content="停止采集" /> Content="停止" />
<CheckBox <CheckBox
IsChecked="{Binding IsLiveViewEnabled}" IsChecked="{Binding IsLiveViewEnabled}"
VerticalAlignment="Center" 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; if (_viewModel?.CameraImageSource == null) return;
@@ -44,11 +44,5 @@ namespace XplorePlane.Views
_viewModel.CameraPixelCoord = $"X: {px}, Y: {py}"; _viewModel.CameraPixelCoord = $"X: {px}, Y: {py}";
} }
} }
private void ImgCamera_MouseLeave(object sender, MouseEventArgs e)
{
if (_viewModel != null)
_viewModel.CameraPixelCoord = "";
}
} }
} }