forked from amkovkov/GranuSightSoftware2
28 lines
876 B
C#
28 lines
876 B
C#
using Avalonia.Controls;
|
|
|
|
namespace GSS2.Test;
|
|
|
|
public partial class MainWindow : Window
|
|
{
|
|
public MainWindow()
|
|
{
|
|
InitializeComponent();
|
|
int i = 0;
|
|
|
|
PointerPressed += async (_, _) =>
|
|
{
|
|
var viewModel = DataContext as MainWindowViewModel;
|
|
if (viewModel is null)
|
|
return;
|
|
|
|
var result = await viewModel.CaptureImage(i++);
|
|
if (result is not null)
|
|
{
|
|
var (frameBuffer, streamConfiguration) = result.Value;
|
|
if (frameBuffer.Metadata.Status == LibCameraSharp.FrameMetadata.StatusEnum.FrameSuccess)
|
|
// cameraView.Update(frameBuffer, streamConfiguration);
|
|
(cameraView.Content as CameraViewModel)?.CallUpdate(frameBuffer, streamConfiguration);
|
|
}
|
|
};
|
|
}
|
|
} |