forked from amkovkov/GranuSightSoftware2
fix: CameraService view finder
Image capturing while view finder work
This commit is contained in:
@@ -23,7 +23,7 @@ public partial class MainViewModel : ViewModelBase
|
||||
ResourcesViewModel = resourcesViewModel;
|
||||
ButtonClick = new RelayCommand(() =>
|
||||
{
|
||||
cameraService.CaptureImage(CancellationToken.None, 10).ContinueWith(image => Image = image.Result);
|
||||
Task.Run(() => cameraService.CaptureImage(CancellationToken.None, 10).ContinueWith(image => Image = image.Result));
|
||||
});
|
||||
|
||||
_logger.LogInformation("{} initialized", nameof(MainViewModel));
|
||||
|
||||
@@ -6,10 +6,12 @@
|
||||
xmlns:core="using:GSS2.UI.Core"
|
||||
x:DataType="local_vm:MainViewModel"
|
||||
x:Class="GSS2.Test.Views.MainView">
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
<core:OpenCvImage Grid.Column="0" Image="{Binding Image}" />
|
||||
<Button Grid.Column="1" Width="50" VerticalAlignment="Stretch" Command="{Binding ButtonClick}"/>
|
||||
<!-- <ContentControl Grid.Row="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Content="{Binding CameraViewModel}" /> -->
|
||||
<!-- <ContentControl Grid.Row="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Content="{Binding ResourcesViewModel}" /> -->
|
||||
<Grid RowDefinitions="*,*">
|
||||
<Grid Grid.Row="0" ColumnDefinitions="*,*,Auto">
|
||||
<ContentControl Grid.Column="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Content="{Binding CameraViewModel}" />
|
||||
<core:OpenCvImage Grid.Column="1" Image="{Binding Image}" />
|
||||
<Button Grid.Column="2" Width="50" VerticalAlignment="Stretch" Command="{Binding ButtonClick}"/>
|
||||
</Grid>
|
||||
<ContentControl Grid.Row="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Content="{Binding ResourcesViewModel}" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -39,8 +39,8 @@
|
||||
"Camera": {
|
||||
"CameraId": "",
|
||||
"ViewFinderFrameBufferCount": 5,
|
||||
"ViewFinderWidth": 1920,
|
||||
"ViewFinderHeight": 1080,
|
||||
"ViewFinderWidth": 4056,
|
||||
"ViewFinderHeight": 3040,
|
||||
"ViewFinderFps": 30,
|
||||
"ImageCaptureFrameBufferCount": 2,
|
||||
"ImageCaptureWidth": 4056,
|
||||
|
||||
Reference in New Issue
Block a user