diff --git a/Views/Overlays/ScreenshotOverlay.xaml b/Views/Overlays/ScreenshotOverlay.xaml
index 172b160..951ffd2 100644
--- a/Views/Overlays/ScreenshotOverlay.xaml
+++ b/Views/Overlays/ScreenshotOverlay.xaml
@@ -5,6 +5,156 @@
Background="Transparent"
WindowStyle="None"
ShowInTaskbar="False"
- Topmost="True">
-
+ Topmost="True"
+ Cursor="Cross">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Views/Overlays/ScreenshotOverlay.xaml.cs b/Views/Overlays/ScreenshotOverlay.xaml.cs
index 04b5d03..0945ef8 100644
--- a/Views/Overlays/ScreenshotOverlay.xaml.cs
+++ b/Views/Overlays/ScreenshotOverlay.xaml.cs
@@ -1,6 +1,8 @@
+using System;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
+using System.Windows.Media.Animation;
using System.Runtime.InteropServices;
using PrettyScreenSHOT.Helpers;
using PrettyScreenSHOT.Services;
@@ -15,6 +17,9 @@ public partial class ScreenshotOverlay : Window
private Point startPoint;
private Point endPoint;
private bool isSelecting = false;
+ private bool helpVisible = false;
+ private Color maskColor = Color.FromArgb(100, 0, 0, 0); // Configurable mask color
+ private byte maskOpacity = 100; // Configurable opacity (0-255)
[DllImport("user32.dll")]
private static extern bool SetForegroundWindow(IntPtr hWnd);
@@ -23,6 +28,135 @@ public ScreenshotOverlay()
{
InitializeComponent();
SetupMultiMonitor();
+ InitializeOverlay();
+ }
+
+ private void InitializeOverlay()
+ {
+ // Load overlay settings from SettingsManager if available
+ // For now, use defaults
+ this.KeyDown += OnOverlayKeyDown;
+
+ // Show help panel with fade-in animation
+ ShowHelpPanelWithAnimation();
+
+ // Hide help after 3 seconds
+ var hideTimer = new System.Windows.Threading.DispatcherTimer
+ {
+ Interval = TimeSpan.FromSeconds(3)
+ };
+ hideTimer.Tick += (s, e) =>
+ {
+ HideHelpPanelWithAnimation();
+ hideTimer.Stop();
+ };
+ hideTimer.Start();
+ }
+
+ private void ShowHelpPanelWithAnimation()
+ {
+ var animation = new DoubleAnimation
+ {
+ From = 0,
+ To = 1,
+ Duration = TimeSpan.FromMilliseconds(300),
+ EasingFunction = new QuadraticEase { EasingMode = EasingMode.EaseOut }
+ };
+ HelpPanel.BeginAnimation(OpacityProperty, animation);
+ helpVisible = true;
+ }
+
+ private void HideHelpPanelWithAnimation()
+ {
+ var animation = new DoubleAnimation
+ {
+ From = 1,
+ To = 0,
+ Duration = TimeSpan.FromMilliseconds(300),
+ EasingFunction = new QuadraticEase { EasingMode = EasingMode.EaseIn }
+ };
+ HelpPanel.BeginAnimation(OpacityProperty, animation);
+ helpVisible = false;
+ }
+
+ private void OnOverlayKeyDown(object sender, KeyEventArgs e)
+ {
+ switch (e.Key)
+ {
+ case Key.Escape:
+ // Cancel selection
+ this.Hide();
+ DebugHelper.LogInfo("Overlay", "Selection cancelled by user (ESC)");
+ break;
+
+ case Key.Enter:
+ // Confirm selection
+ if (isSelecting)
+ {
+ CaptureScreenshot();
+ }
+ break;
+
+ case Key.F1:
+ // Toggle help
+ if (helpVisible)
+ HideHelpPanelWithAnimation();
+ else
+ ShowHelpPanelWithAnimation();
+ break;
+
+ case Key.Space:
+ // Capture full screen
+ CaptureFullScreen();
+ break;
+ }
+ }
+
+ private void CaptureFullScreen()
+ {
+ try
+ {
+ this.Hide();
+ System.Threading.Thread.Sleep(100);
+
+ var virtualBounds = ScreenshotHelper.GetVirtualScreenBounds();
+ var bitmapSource = ScreenshotHelper.CaptureScreenRegion(
+ virtualBounds.Left,
+ virtualBounds.Top,
+ virtualBounds.Width,
+ virtualBounds.Height);
+
+ if (SettingsManager.Instance.CopyToClipboard)
+ {
+ CopyBitmapToClipboard(bitmapSource);
+ }
+
+ ScreenshotManager.Instance.LastCapturedBitmap = bitmapSource;
+
+ if (TrayIconManager.Instance != null && SettingsManager.Instance.ShowNotifications)
+ {
+ TrayIconManager.Instance.ShowNotification(
+ LocalizationHelper.GetString("Notification_Title"),
+ "Przechwycono pełny ekran");
+ }
+
+ DebugHelper.LogInfo("Overlay", "Full screen captured");
+ }
+ catch (Exception ex)
+ {
+ DebugHelper.LogError("Overlay", "Error capturing full screen", ex);
+ }
+ }
+
+ private void OnCaptureClick(object sender, RoutedEventArgs e)
+ {
+ CaptureScreenshot();
+ }
+
+ private void OnCancelClick(object sender, RoutedEventArgs e)
+ {
+ this.Hide();
+ DebugHelper.LogInfo("Overlay", "Selection cancelled by user");
}
private void SetupMultiMonitor()
@@ -51,6 +185,7 @@ protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
base.OnMouseLeftButtonDown(e);
startPoint = e.GetPosition(this);
isSelecting = true;
+ InfoPanel.Visibility = Visibility.Visible;
}
protected override void OnMouseMove(System.Windows.Input.MouseEventArgs e)
@@ -59,6 +194,22 @@ protected override void OnMouseMove(System.Windows.Input.MouseEventArgs e)
if (isSelecting)
{
endPoint = e.GetPosition(this);
+
+ // Update info panel with selection dimensions
+ int width = (int)Math.Abs(endPoint.X - startPoint.X);
+ int height = (int)Math.Abs(endPoint.Y - startPoint.Y);
+ InfoText.Text = $"{width} x {height} px";
+
+ // Show quick toolbar if selection is large enough
+ if (width > 20 && height > 20)
+ {
+ QuickToolbar.Visibility = Visibility.Visible;
+ }
+ else
+ {
+ QuickToolbar.Visibility = Visibility.Collapsed;
+ }
+
InvalidateVisual();
}
}
@@ -66,27 +217,97 @@ protected override void OnMouseMove(System.Windows.Input.MouseEventArgs e)
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
{
base.OnMouseLeftButtonUp(e);
- isSelecting = false;
+ if (!isSelecting) return;
+
endPoint = e.GetPosition(this);
- CaptureScreenshot();
+
+ // Check if selection is valid
+ int width = (int)Math.Abs(endPoint.X - startPoint.X);
+ int height = (int)Math.Abs(endPoint.Y - startPoint.Y);
+
+ if (width > 5 && height > 5)
+ {
+ // Show quick toolbar for confirmation
+ QuickToolbar.Visibility = Visibility.Visible;
+ // Don't auto-capture, wait for user confirmation
+ }
+ else
+ {
+ // Too small, cancel
+ isSelecting = false;
+ InfoPanel.Visibility = Visibility.Collapsed;
+ QuickToolbar.Visibility = Visibility.Collapsed;
+ InvalidateVisual();
+ }
}
protected override void OnRender(DrawingContext drawingContext)
{
base.OnRender(drawingContext);
- // Black mask over entire virtual screen
- drawingContext.DrawRectangle(new SolidColorBrush(System.Windows.Media.Color.FromArgb(100, 0, 0, 0)), null,
- new Rect(0, 0, this.Width, this.Height));
+ // Draw mask over entire virtual screen with configurable color/opacity
+ var maskBrush = new SolidColorBrush(maskColor);
+ drawingContext.DrawRectangle(maskBrush, null, new Rect(0, 0, this.Width, this.Height));
if (isSelecting)
{
- // Bright selection rectangle
var rect = new Rect(startPoint, endPoint);
- drawingContext.DrawRectangle(null, new System.Windows.Media.Pen(new SolidColorBrush(System.Windows.Media.Colors.Cyan), 3), rect);
+
+ // Clear the selected area (no mask)
+ drawingContext.DrawRectangle(Brushes.Transparent, null, rect);
+
+ // Draw modern selection border
+ var borderPen = new Pen(new SolidColorBrush(Color.FromRgb(0, 120, 212)), 2); // Blue border
+ drawingContext.DrawRectangle(null, borderPen, rect);
+
+ // Draw corner handles
+ DrawCornerHandles(drawingContext, rect);
+
+ // Draw crosshair guides (optional, subtle)
+ DrawCrosshairGuides(drawingContext, rect);
}
}
+ private void DrawCornerHandles(DrawingContext drawingContext, Rect rect)
+ {
+ double handleSize = 8;
+ double handleThickness = 20;
+ var handleBrush = new SolidColorBrush(Color.FromRgb(0, 120, 212));
+ var handlePen = new Pen(handleBrush, 3);
+
+ // Top-left
+ drawingContext.DrawLine(handlePen, new Point(rect.Left, rect.Top), new Point(rect.Left + handleThickness, rect.Top));
+ drawingContext.DrawLine(handlePen, new Point(rect.Left, rect.Top), new Point(rect.Left, rect.Top + handleThickness));
+
+ // Top-right
+ drawingContext.DrawLine(handlePen, new Point(rect.Right, rect.Top), new Point(rect.Right - handleThickness, rect.Top));
+ drawingContext.DrawLine(handlePen, new Point(rect.Right, rect.Top), new Point(rect.Right, rect.Top + handleThickness));
+
+ // Bottom-left
+ drawingContext.DrawLine(handlePen, new Point(rect.Left, rect.Bottom), new Point(rect.Left + handleThickness, rect.Bottom));
+ drawingContext.DrawLine(handlePen, new Point(rect.Left, rect.Bottom), new Point(rect.Left, rect.Bottom - handleThickness));
+
+ // Bottom-right
+ drawingContext.DrawLine(handlePen, new Point(rect.Right, rect.Bottom), new Point(rect.Right - handleThickness, rect.Bottom));
+ drawingContext.DrawLine(handlePen, new Point(rect.Right, rect.Bottom), new Point(rect.Right, rect.Bottom - handleThickness));
+ }
+
+ private void DrawCrosshairGuides(DrawingContext drawingContext, Rect rect)
+ {
+ var guidePen = new Pen(new SolidColorBrush(Color.FromArgb(60, 255, 255, 255)), 1)
+ {
+ DashStyle = DashStyles.Dash
+ };
+
+ // Horizontal center line
+ double centerY = (rect.Top + rect.Bottom) / 2;
+ drawingContext.DrawLine(guidePen, new Point(0, centerY), new Point(this.Width, centerY));
+
+ // Vertical center line
+ double centerX = (rect.Left + rect.Right) / 2;
+ drawingContext.DrawLine(guidePen, new Point(centerX, 0), new Point(centerX, this.Height));
+ }
+
private void CaptureScreenshot()
{
// Convert window-relative coordinates to screen coordinates
@@ -106,33 +327,37 @@ private void CaptureScreenshot()
try
{
- // Hide overlay before taking screenshot
+ // Hide UI elements and overlay before taking screenshot
+ InfoPanel.Visibility = Visibility.Collapsed;
+ QuickToolbar.Visibility = Visibility.Collapsed;
+ HelpPanel.Opacity = 0;
+
this.Hide();
this.IsEnabled = false;
DebugHelper.LogInfo("Overlay", "Overlay hidden");
-
+
// Give system time to render
System.Threading.Thread.Sleep(100);
-
+
// Capture screenshot without overlay
System.Windows.Media.Imaging.BitmapSource? bitmapSource = null;
try
{
bitmapSource = ScreenshotHelper.CaptureScreenRegion(x, y, width, height);
DebugHelper.LogInfo("Overlay", "Screenshot captured");
-
+
if (SettingsManager.Instance.CopyToClipboard)
{
CopyBitmapToClipboard(bitmapSource);
DebugHelper.LogInfo("Overlay", "Screenshot copied to clipboard");
}
-
+
DebugHelper.LogDebug($"Screenshot captured: {width}x{height}px");
-
+
// Save screenshot
ScreenshotManager.Instance.LastCapturedBitmap = bitmapSource;
DebugHelper.LogInfo("Overlay", "Screenshot saved to manager");
-
+
// Show notification
if (TrayIconManager.Instance != null && SettingsManager.Instance.ShowNotifications)
{
@@ -156,6 +381,11 @@ private void CaptureScreenshot()
{
try
{
+ // Reset state
+ isSelecting = false;
+ InfoPanel.Visibility = Visibility.Collapsed;
+ QuickToolbar.Visibility = Visibility.Collapsed;
+
this.Hide();
DebugHelper.LogInfo("Overlay", "Capture completed - overlay hidden");
}
diff --git a/Views/Windows/ScreenshotEditorWindow.xaml b/Views/Windows/ScreenshotEditorWindow.xaml
index f24921b..101b0d7 100644
--- a/Views/Windows/ScreenshotEditorWindow.xaml
+++ b/Views/Windows/ScreenshotEditorWindow.xaml
@@ -14,103 +14,103 @@
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
-
+
+
-
-
+
+
+ Margin="0,0,8,0"/>
-
-
-
-
-
+ MinWidth="35"
+ Margin="8,0,0,0"/>
+
+
-
+
+
+
+
-
+
-
+
+
+
+
+
+
-
+
+
+
+
+
+
-
-
-
+
+
+
+
+
-
-
+
-
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+ MinWidth="50"
+ TextAlignment="Center"
+ FontWeight="SemiBold"/>
+
+
+
+
-
-
-
-
+
+
+
+
+
+
-
-
-
+
+
+
+
+
-
-
-
+
-
-
-
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Views/Windows/ScreenshotEditorWindow.xaml.cs b/Views/Windows/ScreenshotEditorWindow.xaml.cs
index 6b017fd..94338d1 100644
--- a/Views/Windows/ScreenshotEditorWindow.xaml.cs
+++ b/Views/Windows/ScreenshotEditorWindow.xaml.cs
@@ -35,10 +35,12 @@ public partial class ScreenshotEditorWindow : FluentWindow, IDisposable
private bool isDrawing = false;
private Color currentColor = Colors.Red;
private List drawingHistory = new();
+ private int historyIndex = -1; // For undo/redo
private RenderTargetBitmap? currentCanvasBitmap;
private ImageBrush? currentCanvasBrush;
private bool disposed = false;
- private System.Windows.Controls.Button? activeToolButton = null;
+ private Wpf.Ui.Controls.Button? activeToolButton = null;
+ private double currentZoom = 1.0;
public enum EditTool
{
@@ -103,22 +105,59 @@ private void SetupEditor()
if (originalBitmap == null) return;
EditorCanvas.Width = originalBitmap.PixelWidth;
EditorCanvas.Height = originalBitmap.PixelHeight;
+
+ // Update status bar with image dimensions
+ UpdateStatusBar();
+
RedrawCanvas();
}
+ private void UpdateStatusBar()
+ {
+ if (originalBitmap != null)
+ {
+ ImageSizeLabel.Text = $"{originalBitmap.PixelWidth} x {originalBitmap.PixelHeight} px";
+ }
+
+ // Update history info
+ int totalActions = drawingHistory.Count;
+ int currentPosition = historyIndex + 1;
+ StatusHistoryLabel.Text = $"Edycji: {totalActions}";
+ HistoryLabel.Text = $"Akcji: {currentPosition} / {totalActions}";
+
+ // Update undo/redo button states
+ if (BtnUndo != null)
+ BtnUndo.IsEnabled = historyIndex >= 0;
+ if (BtnRedo != null)
+ BtnRedo.IsEnabled = historyIndex < drawingHistory.Count - 1;
+
+ // Update tool label
+ CurrentToolLabel.Text = currentTool switch
+ {
+ EditTool.Marker => "Marker",
+ EditTool.Rectangle => "Prostokąt",
+ EditTool.Arrow => "Strzałka",
+ EditTool.Blur => "Rozmycie",
+ EditTool.Text => "Tekst",
+ _ => "Brak"
+ };
+
+ StatusModeLabel.Text = currentTool == EditTool.None ? "Tryb edycji" : $"Narzędzie: {CurrentToolLabel.Text}";
+ }
+
private void RedrawCanvas()
{
if (drawingVisual == null || originalBitmap == null) return;
var drawingContext = drawingVisual.RenderOpen();
var brush = new ImageBrush(originalBitmap);
drawingContext.DrawRectangle(brush, null, new Rect(0, 0, originalBitmap.PixelWidth, originalBitmap.PixelHeight));
-
- // Narysuj wszystkie wcześniejsze akcje
- foreach (var action in drawingHistory)
+
+ // Narysuj akcje tylko do aktualnego historyIndex (dla undo/redo)
+ for (int i = 0; i <= historyIndex && i < drawingHistory.Count; i++)
{
- DrawAction(drawingContext, action);
+ DrawAction(drawingContext, drawingHistory[i]);
}
-
+
drawingContext.Close();
if (originalBitmap == null || drawingVisual == null) return;
@@ -383,9 +422,9 @@ private void DrawArrow(DrawingContext drawingContext, Point start, Point end, Pe
private void OnToolButtonClick(object sender, RoutedEventArgs e)
{
- if (sender is System.Windows.Controls.Button btn)
+ if (sender is Wpf.Ui.Controls.Button btn)
{
- var newTool = btn.Tag switch
+ var newTool = btn.Tag?.ToString() switch
{
"marker" => EditTool.Marker,
"text" => EditTool.Text,
@@ -409,26 +448,24 @@ private void OnToolButtonClick(object sender, RoutedEventArgs e)
UpdateActiveToolButton(btn);
DebugHelper.LogDebug($"Narzędzie: {currentTool}");
}
+
+ UpdateStatusBar();
}
}
- private void UpdateActiveToolButton(System.Windows.Controls.Button? newActiveButton)
+ private void UpdateActiveToolButton(Wpf.Ui.Controls.Button? newActiveButton)
{
// Resetuj poprzedni aktywny przycisk
if (activeToolButton != null)
{
- activeToolButton.BorderThickness = new Thickness(0);
- activeToolButton.BorderBrush = new SolidColorBrush(Colors.Transparent);
- activeToolButton.Background = new SolidColorBrush(Color.FromRgb(0x3F, 0x3F, 0x3F));
+ activeToolButton.Appearance = Wpf.Ui.Controls.ControlAppearance.Secondary;
}
// Ustaw nowy aktywny przycisk
activeToolButton = newActiveButton;
if (activeToolButton != null)
{
- activeToolButton.BorderThickness = new Thickness(2);
- activeToolButton.BorderBrush = new SolidColorBrush(Colors.Yellow);
- activeToolButton.Background = new SolidColorBrush(Color.FromRgb(0x5F, 0x5F, 0x5F));
+ activeToolButton.Appearance = Wpf.Ui.Controls.ControlAppearance.Primary;
}
}
@@ -605,10 +642,10 @@ private void RedrawCanvasWithPreview()
var brush = new ImageBrush(originalBitmap);
drawingContext.DrawRectangle(brush, null, new Rect(0, 0, originalBitmap.PixelWidth, originalBitmap.PixelHeight));
- // Narysuj wszystkie wcześniejsze akcje
- foreach (var action in drawingHistory)
+ // Narysuj akcje tylko do aktualnego historyIndex
+ for (int i = 0; i <= historyIndex && i < drawingHistory.Count; i++)
{
- DrawAction(drawingContext, action);
+ DrawAction(drawingContext, drawingHistory[i]);
}
// Narysuj podgląd aktualnej akcji
@@ -725,6 +762,12 @@ private void OnEditorCanvasMouseUp(object sender, MouseButtonEventArgs e)
var userFontSize = inputWindow.FontSize;
DebugHelper.LogDebug($"Tekst wprowadzony: '{userText}', Rozmiar: {userFontSize}");
+ // Usuń wszystkie akcje po aktualnym historyIndex (redo stack)
+ if (historyIndex < drawingHistory.Count - 1)
+ {
+ drawingHistory.RemoveRange(historyIndex + 1, drawingHistory.Count - historyIndex - 1);
+ }
+
// Teraz dodaj akcję do historii z wprowadzonym tekstem
drawingHistory.Add(new DrawingAction
{
@@ -739,7 +782,9 @@ private void OnEditorCanvasMouseUp(object sender, MouseButtonEventArgs e)
TextDecorations = inputWindow.TextDecorations
});
+ historyIndex = drawingHistory.Count - 1;
RedrawCanvas();
+ UpdateStatusBar();
}
// Reset narzędzia po zakończeniu
@@ -753,6 +798,12 @@ private void OnEditorCanvasMouseUp(object sender, MouseButtonEventArgs e)
return;
}
+ // Usuń wszystkie akcje po aktualnym historyIndex (redo stack)
+ if (historyIndex < drawingHistory.Count - 1)
+ {
+ drawingHistory.RemoveRange(historyIndex + 1, drawingHistory.Count - historyIndex - 1);
+ }
+
drawingHistory.Add(new DrawingAction
{
Tool = currentTool,
@@ -763,7 +814,9 @@ private void OnEditorCanvasMouseUp(object sender, MouseButtonEventArgs e)
TextContent = null
});
+ historyIndex = drawingHistory.Count - 1;
RedrawCanvas();
+ UpdateStatusBar();
// Reset tylko dla narzędzi jednorazowych
if (currentTool == EditTool.Text)
@@ -783,19 +836,104 @@ private void SizeSlider_ValueChanged(object sender, RoutedPropertyChangedEventAr
public void Undo()
{
- if (drawingHistory.Count > 0)
+ if (historyIndex >= 0)
{
- drawingHistory.RemoveAt(drawingHistory.Count - 1);
+ historyIndex--;
RedrawCanvas();
- DebugHelper.LogDebug("Undo - ostatnia akcja usunięta");
+ UpdateStatusBar();
+ DebugHelper.LogDebug($"Undo - przywrócono stan {historyIndex + 1}");
+ }
+ }
+
+ private void OnRedoClick(object sender, RoutedEventArgs e)
+ {
+ Redo();
+ }
+
+ public void Redo()
+ {
+ if (historyIndex < drawingHistory.Count - 1)
+ {
+ historyIndex++;
+ RedrawCanvas();
+ UpdateStatusBar();
+ DebugHelper.LogDebug($"Redo - przywrócono stan {historyIndex + 1}");
+ }
+ }
+
+ // Zoom controls
+ private void OnZoomInClick(object sender, RoutedEventArgs e)
+ {
+ currentZoom = Math.Min(currentZoom + 0.1, 5.0);
+ ApplyZoom();
+ }
+
+ private void OnZoomOutClick(object sender, RoutedEventArgs e)
+ {
+ currentZoom = Math.Max(currentZoom - 0.1, 0.1);
+ ApplyZoom();
+ }
+
+ private void OnZoomFitClick(object sender, RoutedEventArgs e)
+ {
+ currentZoom = 1.0;
+ ApplyZoom();
+ }
+
+ private void ApplyZoom()
+ {
+ CanvasScaleTransform.ScaleX = currentZoom;
+ CanvasScaleTransform.ScaleY = currentZoom;
+ ZoomLabel.Text = $"{(int)(currentZoom * 100)}%";
+ UpdateStatusBar();
+ }
+
+ // Quick color selection
+ private void OnQuickColorClick(object sender, RoutedEventArgs e)
+ {
+ if (sender is System.Windows.Controls.Button btn && btn.Tag is string colorHex)
+ {
+ currentColor = (Color)ColorConverter.ConvertFromString(colorHex);
+ ColorButton.Background = new SolidColorBrush(currentColor);
+ DebugHelper.LogDebug($"Kolor szybki wybór: {colorHex}");
}
}
+ // Title bar actions
+ private void OnCopyClick(object sender, RoutedEventArgs e)
+ {
+ try
+ {
+ if (originalBitmap == null || drawingVisual == null) return;
+ var renderTargetBitmap = new RenderTargetBitmap(
+ originalBitmap.PixelWidth,
+ originalBitmap.PixelHeight,
+ 96, 96,
+ PixelFormats.Pbgra32);
+ renderTargetBitmap.Render(drawingVisual);
+
+ System.Windows.Clipboard.SetImage(renderTargetBitmap);
+ DebugHelper.ShowMessage("Skopiowano", "Screenshot skopiowany do schowka");
+ }
+ catch (Exception ex)
+ {
+ DebugHelper.LogError("Editor", "Error copying to clipboard", ex);
+ }
+ }
+
+ private void OnShareClick(object sender, RoutedEventArgs e)
+ {
+ // Placeholder for share functionality
+ DebugHelper.ShowMessage("Udostępnianie", "Funkcja udostępniania będzie dostępna wkrótce");
+ }
+
public void ClearAll()
{
drawingHistory.Clear();
+ historyIndex = -1;
RedrawCanvas();
- DebugHelper.LogDebug("Wszystkie zmiany usunięte");
+ UpdateStatusBar();
+ DebugHelper.LogDebug("Wszystkie zmiany usunięte");
}
public void SaveScreenshot()