From 8d278833127325e39909873c05ba44878687e849 Mon Sep 17 00:00:00 2001 From: iTob Date: Fri, 27 Feb 2026 22:15:07 +0100 Subject: [PATCH] solid state --- .../Core/AppSettings/app.settings.dev.json | 4 +- .../Features/LiveView/LiveViewPage.xaml | 6 +- .../Features/LiveView/LiveViewPage.xaml.cs | 17 ++- .../TimerControlRectangleAnimation.xaml | 7 +- .../TimerControlRectangleAnimation.xaml.cs | 41 +++++- .../PictureGallery/PictureGalleryPage.xaml | 51 +++++++- .../PictureGallery/PictureGalleryPage.xaml.cs | 123 ++++++++++++++++-- src/CamBooth/CamBooth.App/MainWindow.xaml | 37 ++++-- src/CamBooth/CamBooth.App/MainWindow.xaml.cs | 28 +++- src/CamBooth/CamBooth.App/ToDos.txt | 4 +- src/CamBooth/CamBooth.sln.DotSettings.user | 1 + 11 files changed, 287 insertions(+), 32 deletions(-) diff --git a/src/CamBooth/CamBooth.App/Core/AppSettings/app.settings.dev.json b/src/CamBooth/CamBooth.App/Core/AppSettings/app.settings.dev.json index 4341bb2..e77cb5e 100644 --- a/src/CamBooth/CamBooth.App/Core/AppSettings/app.settings.dev.json +++ b/src/CamBooth/CamBooth.App/Core/AppSettings/app.settings.dev.json @@ -2,9 +2,9 @@ "AppSettings": { "AppName": "Meine Anwendung", "Version": "1.0.0", - "IsDebugMode": true, + "IsDebugMode": false, "PictureLocation": "C:\\tmp\\cambooth", - "DebugConsoleVisible": "true", + "DebugConsoleVisible": "false", "PhotoCountdownSeconds": 2, "FocusDelaySeconds": 1, "FocusTimeoutMs": 1000, diff --git a/src/CamBooth/CamBooth.App/Features/LiveView/LiveViewPage.xaml b/src/CamBooth/CamBooth.App/Features/LiveView/LiveViewPage.xaml index e4695f0..9aeacbd 100644 --- a/src/CamBooth/CamBooth.App/Features/LiveView/LiveViewPage.xaml +++ b/src/CamBooth/CamBooth.App/Features/LiveView/LiveViewPage.xaml @@ -6,8 +6,8 @@ xmlns:liveView="clr-namespace:CamBooth.App.Features.LiveView" mc:Ignorable="d" Title="LiveViewPage" Width="1350" Height="900" - Background="PaleVioletRed"> - - + Background="Transparent"> + + \ No newline at end of file diff --git a/src/CamBooth/CamBooth.App/Features/LiveView/LiveViewPage.xaml.cs b/src/CamBooth/CamBooth.App/Features/LiveView/LiveViewPage.xaml.cs index 39c1d33..750a49e 100644 --- a/src/CamBooth/CamBooth.App/Features/LiveView/LiveViewPage.xaml.cs +++ b/src/CamBooth/CamBooth.App/Features/LiveView/LiveViewPage.xaml.cs @@ -1,4 +1,4 @@ -using System.IO; +using System.IO; using System.Windows; using System.Windows.Controls; using System.Windows.Media; @@ -33,11 +33,20 @@ public partial class LiveViewPage : Page this.InitializeComponent(); this.SetImageAction = img => { this.bgbrush.ImageSource = img; }; - // Mirror the LiveView image horizontally - ScaleTransform scaleTransform = new ScaleTransform(-1, 1, 0.5, 0.5); - this.bgbrush.Transform = scaleTransform; + // Configure the image brush + this.bgbrush.Stretch = Stretch.UniformToFill; + this.bgbrush.AlignmentX = AlignmentX.Center; + this.bgbrush.AlignmentY = AlignmentY.Center; this.LVCanvas.Background = this.bgbrush; + + // Apply horizontal flip on the Canvas using RenderTransform + TransformGroup transformGroup = new(); + transformGroup.Children.Add(new ScaleTransform { ScaleX = -1, ScaleY = 1 }); + transformGroup.Children.Add(new TranslateTransform { X = 1, Y = 0 }); + this.LVCanvas.RenderTransform = transformGroup; + this.LVCanvas.RenderTransformOrigin = new Point(0.5, 0.5); + cameraService.ConnectCamera(); cameraService._mainCamera.LiveViewUpdated += this.MainCamera_OnLiveViewUpdated; } diff --git a/src/CamBooth/CamBooth.App/Features/LiveView/TimerControlRectangleAnimation.xaml b/src/CamBooth/CamBooth.App/Features/LiveView/TimerControlRectangleAnimation.xaml index 36d9557..83d12cf 100644 --- a/src/CamBooth/CamBooth.App/Features/LiveView/TimerControlRectangleAnimation.xaml +++ b/src/CamBooth/CamBooth.App/Features/LiveView/TimerControlRectangleAnimation.xaml @@ -16,7 +16,12 @@ Fill="#4CAF50" Height="75" HorizontalAlignment="Left"/> - HIER EINE ANWEISUNG ANZEIGEN + Lächeln! diff --git a/src/CamBooth/CamBooth.App/Features/LiveView/TimerControlRectangleAnimation.xaml.cs b/src/CamBooth/CamBooth.App/Features/LiveView/TimerControlRectangleAnimation.xaml.cs index 01b364f..2107ba7 100644 --- a/src/CamBooth/CamBooth.App/Features/LiveView/TimerControlRectangleAnimation.xaml.cs +++ b/src/CamBooth/CamBooth.App/Features/LiveView/TimerControlRectangleAnimation.xaml.cs @@ -1,4 +1,4 @@ -using System.Windows; +using System.Windows; using System.Windows.Controls; using System.Windows.Media.Animation; using System.Windows.Shapes; @@ -22,6 +22,32 @@ public partial class TimerControlRectangleAnimation : UserControl private Storyboard _progressBarAnimation; + private Random _random = new Random(); + + private List _photoInstructions = new List + { + "Lächeln! 😊", + "Hasenohren machen! 🐰", + "Zunge rausstrecken! 👅", + "Grimasse ziehen! 😝", + "Daumen hoch! 👍", + "Peace-Zeichen! ✌️", + "Lustig gucken! 🤪", + "Crazy Face! 🤯", + "Küsschen! 😘", + "Winken! 👋", + "Herz mit den Händen! ❤️", + "Verrückt sein! 🤪", + "Überrascht schauen! 😲", + "Cool bleiben! 😎", + "Lachen! 😄", + "Zähne zeigen! 😁", + "Schnute ziehen! 😗", + "Augen zukneifen! 😆", + "Arm hochstrecken! 🙌", + "Gruppe umarmen! 🤗" + }; + public TimerControlRectangleAnimation() { @@ -66,6 +92,10 @@ public partial class TimerControlRectangleAnimation : UserControl // TimerText.Text = TimeSpan.FromSeconds(_remainingTime).ToString(@"mm\:ss"); // StatusText.Text = "Timer läuft..."; + + // Show initial random instruction + ShowRandomInstruction(); + _timer.Start(); StartProgressBarAnimation(); @@ -120,4 +150,13 @@ public partial class TimerControlRectangleAnimation : UserControl { _progressBarAnimation?.Stop(); } + + private void ShowRandomInstruction() + { + if (_photoInstructions.Count > 0) + { + int randomIndex = _random.Next(_photoInstructions.Count); + InstructionText.Text = _photoInstructions[randomIndex]; + } + } } \ No newline at end of file diff --git a/src/CamBooth/CamBooth.App/Features/PictureGallery/PictureGalleryPage.xaml b/src/CamBooth/CamBooth.App/Features/PictureGallery/PictureGalleryPage.xaml index b1c8a90..15cf199 100644 --- a/src/CamBooth/CamBooth.App/Features/PictureGallery/PictureGalleryPage.xaml +++ b/src/CamBooth/CamBooth.App/Features/PictureGallery/PictureGalleryPage.xaml @@ -9,7 +9,12 @@ Background="Black"> - + + + + + + @@ -18,6 +23,50 @@ + + + + + + + + + + + + + +