Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a29217a324 | ||
|
|
72a6730c84 | ||
|
|
94027889d3 | ||
|
|
38b1554dc5 | ||
|
|
f296756b0d | ||
|
|
56cd1047c2 | ||
|
|
933e872b49 | ||
|
|
cfe2b5ce69 | ||
|
|
9f5986dbac | ||
|
|
585dfb3de5 | ||
|
|
e5ddc4e3ac | ||
|
|
81563c65f0 | ||
|
|
e13b9a6b56 | ||
|
|
414d145bc8 | ||
|
|
1a57c07409 | ||
|
|
edf6ab93d7 | ||
|
|
b9ec09c62e | ||
|
|
bef2e2fdc6 | ||
|
|
1e02f7578e | ||
|
|
8baefc4a1e |
No files matched your search
+148
@@ -7,6 +7,154 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [1.5.0] - 2026-05-07
|
||||
|
||||
Bug-fix + feature cycle. Tackles a long-standing process-leak bug,
|
||||
adds four feature toggles requested by users, four new language
|
||||
packs, and ships a region-capture mode.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Process leak on every launch.** `DashboardViewModel.Dispose`
|
||||
was missing a `_watcher.Stop()` call for the WMI watcher, and
|
||||
`Program.Main` never disposed the DI container — together those
|
||||
two gaps left a non-background WMI subscription thread alive
|
||||
past app exit, so the CLR couldn't tear down and Task Manager
|
||||
accumulated one zombie `CaptureImage.exe` per launch. Both holes
|
||||
are now closed; a fresh dispose-chain regression test guards
|
||||
against future regressions.
|
||||
- **PreviewWindow theme drift.** The capture-preview modal used to
|
||||
ignore the persisted theme and always inherit the OS default,
|
||||
so Dark-mode users saw a Light flash on every preview. The new
|
||||
`ThemeApplicator` helper is shared between MainWindow and
|
||||
PreviewWindow and re-applies on every `ISettingsStore.Changed`,
|
||||
so toggling theme while a preview is open updates it live.
|
||||
|
||||
### Added
|
||||
|
||||
- **Single-instance guard with restore-on-relaunch.** A second
|
||||
launch of the app no longer spawns a duplicate process — instead
|
||||
it pings the existing instance over a named pipe and the
|
||||
original window pops to the foreground (Spotify/Slack pattern).
|
||||
The named mutex is per-OS-user, and an abandoned mutex from a
|
||||
crashed prior run is treated as acquired so the app can never
|
||||
lock itself out.
|
||||
- **Capture countdown** (Off / 3s / 5s / 10s) — useful for
|
||||
capturing tooltips and menu animations that vanish when you
|
||||
Alt-Tab back to the target.
|
||||
- **Clipboard mode** (None / Copy only / Copy + Save) — captures
|
||||
optionally land in the clipboard as a bitmap, with or without
|
||||
also writing a file. Pastes correctly into Paint, Word, Slack.
|
||||
- **Open output folder after save** — opt-in toggle that fires
|
||||
Explorer at the saved file's directory.
|
||||
- **Pinned floating thumbnail window.** Optional opt-in: every
|
||||
capture spawns a small always-on-top window with a thumbnail of
|
||||
the shot, handy for comparing successive captures or keeping a
|
||||
reference visible while playing/working in another app. Each
|
||||
capture spawns a fresh window so users can pile up several pins.
|
||||
- **Built-in offline OCR** via `Windows.Media.Ocr`. The Preview
|
||||
window grew an "Extract text (OCR)" button that runs the
|
||||
OS-supplied recognizer on the captured frame and copies the
|
||||
recognised text to the clipboard. All processing is on-device —
|
||||
nothing leaves the machine. Falls back gracefully when the
|
||||
user's installed OCR language packs don't cover the requested
|
||||
language.
|
||||
- **Region capture mode.** New Settings → Capture mode dropdown
|
||||
switches between Window mode (default; existing
|
||||
`Windows.Graphics.Capture` flow) and Region mode, which opens a
|
||||
full-screen overlay where the user drags a rectangle. The
|
||||
selection feeds into the existing Preview / Save / Clipboard /
|
||||
Pinned-thumbnail pipeline unchanged. v1.5 supports the primary
|
||||
monitor only — multi-monitor + per-monitor DPI lands in v1.6.
|
||||
- **Four new language packs**: French (fr-FR), German (de-DE),
|
||||
Brazilian Portuguese (pt-BR), Russian (ru-RU). Brings shipped
|
||||
locales to 11. The About → Translations disclaimer lists every
|
||||
machine-assisted pack and invites native-speaker proofreading
|
||||
PRs against `src/CaptureImage.UI/Resources/Strings/`.
|
||||
|
||||
### Changed
|
||||
|
||||
- The `string`→`ElementTheme` switch lives in the new
|
||||
`ThemeApplicator` helper instead of being duplicated between
|
||||
windows. `MainWindow.ApplyTheme` now delegates to it.
|
||||
- `IClipboardService` grew a `CopyText` overload (used by OCR);
|
||||
the existing `CopyImageAsync` path is unchanged.
|
||||
- Localization completeness tests now span all 11 cultures, and
|
||||
both culture test classes share a serialised xUnit collection
|
||||
so they can't race on the process-wide
|
||||
`CultureInfo.DefaultThreadCurrent*` statics.
|
||||
|
||||
### Smoke checklist
|
||||
|
||||
When validating a v1.5 build manually:
|
||||
|
||||
1. Open and close the app five times in a row → Task Manager
|
||||
Background processes shows zero `CaptureImage.exe` after each
|
||||
close.
|
||||
2. Double-click the shortcut twice in succession → only one
|
||||
instance runs; the second launch flashes the existing window
|
||||
to the foreground.
|
||||
3. Settings → Theme → toggle Light/Dark while a Preview window
|
||||
is open → the preview retints in lock-step.
|
||||
4. Switch language to fr-FR / de-DE / pt-BR / ru-RU → no
|
||||
`[Settings_Foo]` bracket fallbacks anywhere in the UI; tray
|
||||
menu refreshes.
|
||||
5. Settings → Capture countdown → 5s, then trigger the hotkey →
|
||||
countdown ticks 5/4/3/2/1 in the dashboard status before the
|
||||
shot fires.
|
||||
6. Settings → Clipboard mode → Copy + Save, capture, paste into
|
||||
Paint → image matches the saved file.
|
||||
7. Settings → Open output folder after save → on, capture →
|
||||
Explorer pops with the file directory.
|
||||
8. Settings → Pin a floating thumbnail after each capture → on,
|
||||
capture → small always-on-top window appears with the shot.
|
||||
9. Preview window → Extract text (OCR) on a capture with text →
|
||||
word-count toast, paste into Notepad confirms text.
|
||||
10. Settings → Capture mode → Region, trigger hotkey → full-screen
|
||||
dim overlay; drag a rectangle → Preview opens with the cropped
|
||||
region. Esc on the overlay cancels cleanly.
|
||||
|
||||
## [1.4.0] - 2026-04-27
|
||||
|
||||
UX polish + accessibility cycle. No breaking changes; settings.json
|
||||
schema unchanged.
|
||||
|
||||
### Added
|
||||
|
||||
- **Light / Dark / System theme** picker on the Settings tab. The
|
||||
preference was already reserved in `AppSettings.Theme` since v1.3
|
||||
but had no consumer; v1.4 wires it through to
|
||||
`FrameworkElement.RequestedTheme` and re-applies on every
|
||||
`ISettingsStore.Changed`. Mica retints automatically with the
|
||||
resolved theme.
|
||||
- **Auto-switch on Alt-Tab** (opt-in, default off). When enabled,
|
||||
the dashboard's selected target follows the OS foreground window
|
||||
via a `SetWinEventHook(EVENT_SYSTEM_FOREGROUND)` watcher with a
|
||||
250 ms debounce. Apps not in the target list keep your current
|
||||
selection. Toggle lives next to the existing capture toggles.
|
||||
- **Four new language packs**: Japanese (ja-JP), Simplified Chinese
|
||||
(zh-Hans), Korean (ko-KR), Spanish (es-ES). All machine-assisted —
|
||||
the About → Translations disclaimer lists every machine-assisted
|
||||
pack and invites native-speaker proofreading PRs.
|
||||
- **Friendlier log lines** for end-user lifecycle events: `Picture
|
||||
captured: {Name} ({W}×{H}, {KB} KB) at {Path} [{Format}]`,
|
||||
`Picture capture cancelled by user.`, `Language switched to
|
||||
{Code} ({Name}).`, `Theme switched to {Theme}.`, `Capture sound
|
||||
{State}.`, `Auto-switch on Alt-Tab {State}.` Logs remain
|
||||
English-only by design (file shareability + parser stability
|
||||
across cultures).
|
||||
|
||||
### Changed
|
||||
|
||||
- **Window is now fixed-size** at 1200×720. Both maximize and
|
||||
resize are disabled via `OverlappedPresenter.IsMaximizable` /
|
||||
`IsResizable`; minimize remains enabled for the tray flow.
|
||||
- **Tone shift on existing log call sites**: "Failed to X" →
|
||||
"Couldn't X" across `DashboardViewModel`, `SettingsViewModel`,
|
||||
`UpdateViewModel`, `AboutViewModel`, `LogViewerViewModel`.
|
||||
Structured properties are unchanged so log queries and external
|
||||
diagnostics still work.
|
||||
|
||||
## [1.3.1] - 2026-04-26
|
||||
|
||||
**Critical hotfix.** v1.3.0 shipped broken — the WinUI 3 publish pipeline
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using CaptureImage.App.SingleInstance;
|
||||
using CaptureImage.Core.Abstractions;
|
||||
using CaptureImage.UI.Services;
|
||||
using CaptureImage.UI.Views;
|
||||
@@ -23,6 +24,7 @@ public partial class App : Application
|
||||
public static IServiceProvider? Services { get; set; }
|
||||
|
||||
private Window? _window;
|
||||
private ActivationListener? _activationListener;
|
||||
|
||||
public App()
|
||||
{
|
||||
@@ -48,12 +50,27 @@ public partial class App : Application
|
||||
// FolderPicker / FilePicker InitializeWithWindow calls.
|
||||
WindowHostHelper.MainWindow = mainWindow;
|
||||
_window = mainWindow;
|
||||
|
||||
// Apply persisted theme before first paint, then keep it in sync with settings.
|
||||
var settings = services.GetRequiredService<ISettingsStore>();
|
||||
mainWindow.ApplyTheme(settings.Current.Theme);
|
||||
settings.Changed += (_, _) => mainWindow.ApplyTheme(settings.Current.Theme);
|
||||
|
||||
_window.Activate();
|
||||
|
||||
// Tray host attaches to the live Window. M1 ships a no-op stub; M6 wires the real
|
||||
// H.NotifyIcon.WindowsAppSDK implementation.
|
||||
var tray = services.GetRequiredService<ITrayIconHost>();
|
||||
tray.Initialize(_window);
|
||||
|
||||
// Listen for ACTIVATE messages from secondary launches so a double-click on
|
||||
// the shortcut restores this instance instead of orphaning a new one. The
|
||||
// listener owns its own background task; disposed via the IServiceProvider
|
||||
// chain at shutdown (registered just below).
|
||||
_activationListener = ActivationListener.Start(
|
||||
_window,
|
||||
services.GetRequiredService<IUIThreadDispatcher>());
|
||||
_window.Closed += (_, _) => _activationListener?.Dispose();
|
||||
}
|
||||
|
||||
private static void OnUnhandledException(object sender, Microsoft.UI.Xaml.UnhandledExceptionEventArgs e)
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||
<DefineConstants>$(DefineConstants);DISABLE_XAML_GENERATED_MAIN</DefineConstants>
|
||||
<Version>1.3.1</Version>
|
||||
<Version>1.5.0</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -5,6 +5,7 @@ using CaptureImage.Infrastructure.Capture;
|
||||
using CaptureImage.Infrastructure.Hotkeys;
|
||||
using CaptureImage.Infrastructure.Imaging;
|
||||
using CaptureImage.Infrastructure.Logging;
|
||||
using CaptureImage.Infrastructure.Ocr;
|
||||
using CaptureImage.Infrastructure.Processes;
|
||||
using CaptureImage.Infrastructure.Settings;
|
||||
using CaptureImage.Infrastructure.Steam;
|
||||
@@ -75,6 +76,7 @@ internal static class CompositionRoot
|
||||
services.AddSingleton<IconExtractor>();
|
||||
services.AddSingleton<IProcessDetector, GameDetector>();
|
||||
services.AddSingleton<IProcessWatcher, WmiProcessWatcher>();
|
||||
services.AddSingleton<IForegroundWindowWatcher, Win32ForegroundWindowWatcher>();
|
||||
|
||||
// --- Capture engine + encoders -----------------------------------------
|
||||
services.AddSingleton<D3D11DeviceManager>();
|
||||
@@ -97,6 +99,10 @@ internal static class CompositionRoot
|
||||
services.AddSingleton<IToastService, ToastService>();
|
||||
services.AddSingleton<IPreviewPresenter, PreviewPresenter>();
|
||||
services.AddSingleton<ITrayIconHost, TrayIconHost>();
|
||||
services.AddSingleton<IClipboardService, WinAppSDKClipboardService>();
|
||||
services.AddSingleton<IPinnedThumbnailHost, PinnedThumbnailHost>();
|
||||
services.AddSingleton<IOcrService, WindowsOcrService>();
|
||||
services.AddSingleton<IRegionCaptureService, WindowsRegionCaptureService>();
|
||||
|
||||
// --- Navigation --------------------------------------------------------
|
||||
services.AddSingleton<INavigationService, NavigationService>();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.ComponentModel;
|
||||
using System.Numerics;
|
||||
using CaptureImage.UI.Theming;
|
||||
using CaptureImage.UI.Views;
|
||||
using CaptureImage.ViewModels;
|
||||
using CaptureImage.ViewModels.Navigation;
|
||||
@@ -44,11 +45,25 @@ public sealed partial class MainWindow : Window
|
||||
var appWindow = AppWindow.GetFromWindowId(windowId);
|
||||
appWindow.Resize(new SizeInt32(InitialWidth, InitialHeight));
|
||||
|
||||
if (appWindow.Presenter is OverlappedPresenter presenter)
|
||||
{
|
||||
presenter.IsMaximizable = false;
|
||||
presenter.IsResizable = false;
|
||||
}
|
||||
|
||||
Root.Loaded += OnRootLoaded;
|
||||
}
|
||||
|
||||
public MainWindowViewModel? ViewModel { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Apply the persisted theme preference to the window root. <c>System</c> falls back
|
||||
/// to <see cref="ElementTheme.Default"/> which lets the OS theme drive everything,
|
||||
/// including Mica. Called at startup and whenever <c>ISettingsStore.Changed</c> fires.
|
||||
/// Safe to call from any thread — <see cref="ThemeApplicator"/> hops to the dispatcher.
|
||||
/// </summary>
|
||||
public void ApplyTheme(string theme) => ThemeApplicator.Apply(Content as FrameworkElement, theme);
|
||||
|
||||
public void SetViewModel(MainWindowViewModel vm)
|
||||
{
|
||||
if (ViewModel is not null)
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using CaptureImage.App.SingleInstance;
|
||||
using CaptureImage.Core.Abstractions;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.UI.Dispatching;
|
||||
@@ -27,6 +25,17 @@ internal static class Program
|
||||
{
|
||||
VelopackApp.Build().Run();
|
||||
|
||||
// Single-instance guard runs AFTER Velopack hooks so installer/uninstaller
|
||||
// launches (--squirrel-*) aren't blocked. If another instance owns the
|
||||
// mutex, we ping it via named pipe (ActivationListener restores its
|
||||
// window) and exit immediately without bringing up our own UI.
|
||||
if (!SingleInstanceGuard.TryAcquire(out var instanceReleaser))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
using var _instanceReleaser = instanceReleaser;
|
||||
|
||||
var (inMemorySink, loggingLevelSwitch) = LoggingSetup.Initialize();
|
||||
|
||||
RegisterGlobalExceptionHandlers();
|
||||
@@ -122,6 +131,19 @@ internal static class Program
|
||||
{
|
||||
Log.Warning(ex, "Failed to flush settings on shutdown.");
|
||||
}
|
||||
// Dispose the DI container so every IDisposable singleton runs its cleanup —
|
||||
// most importantly WmiProcessWatcher (WMI subscriptions on non-background
|
||||
// threads), Win32ForegroundWindowWatcher (WinEventHook), and TrayIconHost.
|
||||
// Without this, the process can't fully exit and Task Manager accumulates one
|
||||
// zombie CaptureImage.exe per launch.
|
||||
try
|
||||
{
|
||||
(App.Services as IDisposable)?.Dispose();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Warning(ex, "Failed to dispose service provider on shutdown.");
|
||||
}
|
||||
Log.Information("CaptureImage shutting down. Reason={Reason}", shutdownReason);
|
||||
Log.CloseAndFlush();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
using System.IO.Pipes;
|
||||
using System.Runtime.InteropServices;
|
||||
using CaptureImage.Core.Abstractions;
|
||||
using Microsoft.UI;
|
||||
using Microsoft.UI.Windowing;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Serilog;
|
||||
using WinRT.Interop;
|
||||
|
||||
namespace CaptureImage.App.SingleInstance;
|
||||
|
||||
/// <summary>
|
||||
/// Background listener for the single-instance ACTIVATE pipe. When a secondary launch
|
||||
/// fires <see cref="SingleInstanceGuard.ActivateMessage"/>, this brings the main window
|
||||
/// back to the foreground — same restore sequence the tray icon uses
|
||||
/// (<c>AppWindow.Show</c> + <c>ShowWindow(SW_RESTORE)</c> + <c>SetForegroundWindow</c>).
|
||||
/// </summary>
|
||||
internal sealed class ActivationListener : IDisposable
|
||||
{
|
||||
[DllImport("user32.dll")]
|
||||
private static extern bool SetForegroundWindow(IntPtr hWnd);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
|
||||
|
||||
private const int SW_RESTORE = 9;
|
||||
|
||||
private readonly Window _mainWindow;
|
||||
private readonly IUIThreadDispatcher _dispatcher;
|
||||
private readonly CancellationTokenSource _cts = new();
|
||||
private readonly Task _loop;
|
||||
private bool _disposed;
|
||||
|
||||
private ActivationListener(Window mainWindow, IUIThreadDispatcher dispatcher)
|
||||
{
|
||||
_mainWindow = mainWindow;
|
||||
_dispatcher = dispatcher;
|
||||
_loop = Task.Run(() => RunAsync(_cts.Token));
|
||||
}
|
||||
|
||||
/// <summary>Start listening; returns the listener so it can be disposed on shutdown.</summary>
|
||||
public static ActivationListener Start(Window mainWindow, IUIThreadDispatcher dispatcher)
|
||||
=> new(mainWindow, dispatcher);
|
||||
|
||||
private async Task RunAsync(CancellationToken ct)
|
||||
{
|
||||
while (!ct.IsCancellationRequested)
|
||||
{
|
||||
try
|
||||
{
|
||||
using var server = new NamedPipeServerStream(
|
||||
pipeName: SingleInstanceGuard.PipeName,
|
||||
direction: PipeDirection.In,
|
||||
maxNumberOfServerInstances: 1,
|
||||
transmissionMode: PipeTransmissionMode.Byte,
|
||||
options: PipeOptions.Asynchronous);
|
||||
|
||||
await server.WaitForConnectionAsync(ct).ConfigureAwait(false);
|
||||
|
||||
using var reader = new StreamReader(server);
|
||||
var line = await reader.ReadLineAsync(ct).ConfigureAwait(false);
|
||||
if (string.Equals(line, SingleInstanceGuard.ActivateMessage, StringComparison.Ordinal))
|
||||
{
|
||||
_dispatcher.Post(RestoreWindow);
|
||||
}
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
// Shutdown — exit cleanly.
|
||||
return;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Warning(ex, "ActivationListener pipe iteration failed; will retry.");
|
||||
// Avoid a hot loop if the pipe is in a bad state — yield briefly.
|
||||
try { await Task.Delay(500, ct).ConfigureAwait(false); }
|
||||
catch (OperationCanceledException) { return; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void RestoreWindow()
|
||||
{
|
||||
try
|
||||
{
|
||||
var hwnd = WindowNative.GetWindowHandle(_mainWindow);
|
||||
var windowId = Win32Interop.GetWindowIdFromWindow(hwnd);
|
||||
var appWindow = AppWindow.GetFromWindowId(windowId);
|
||||
|
||||
// Mirror TrayIconHost.ShowMainWindow: AppWindow.Show un-hides if minimised
|
||||
// to tray, ShowWindow(SW_RESTORE) un-minimises a taskbar-minimised window,
|
||||
// and SetForegroundWindow forces Z-order to top even if another app has focus.
|
||||
appWindow.Show();
|
||||
ShowWindow(hwnd, SW_RESTORE);
|
||||
_mainWindow.Activate();
|
||||
SetForegroundWindow(hwnd);
|
||||
Log.Debug("Main window restored from secondary launch ACTIVATE.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Warning(ex, "Failed to restore main window on ACTIVATE.");
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_disposed) return;
|
||||
_disposed = true;
|
||||
try { _cts.Cancel(); }
|
||||
catch { /* swallow */ }
|
||||
try { _loop.Wait(TimeSpan.FromSeconds(1)); }
|
||||
catch { /* shutdown — best effort */ }
|
||||
_cts.Dispose();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
using System.IO.Pipes;
|
||||
using Serilog;
|
||||
|
||||
namespace CaptureImage.App.SingleInstance;
|
||||
|
||||
/// <summary>
|
||||
/// Per-user single-instance gate. The first process to call <see cref="TryAcquire"/>
|
||||
/// wins the named mutex and returns a releaser to be held for the lifetime of the
|
||||
/// app. Any subsequent launch fails the acquire, fires an ACTIVATE message at the
|
||||
/// existing instance over a named pipe, and exits — the user perceives a restored
|
||||
/// window instead of a duplicate process.
|
||||
///
|
||||
/// Mutex + pipe names are scoped to the local user session so two different OS
|
||||
/// users on the same machine each get their own primary instance.
|
||||
/// </summary>
|
||||
internal static class SingleInstanceGuard
|
||||
{
|
||||
public const string PipeName = "CaptureImage.Activate";
|
||||
public const string ActivateMessage = "ACTIVATE";
|
||||
|
||||
private static readonly string MutexName =
|
||||
$"Local\\CaptureImage.SingleInstance.{Environment.UserName}";
|
||||
|
||||
/// <summary>
|
||||
/// Try to become the primary instance. Returns true and yields a disposable
|
||||
/// releaser when this process owns the mutex. Returns false if another instance
|
||||
/// already holds it — in that case an ACTIVATE message is fired over the
|
||||
/// named pipe (best effort) so the existing instance restores its window.
|
||||
/// </summary>
|
||||
public static bool TryAcquire(out IDisposable releaser)
|
||||
{
|
||||
var mutex = new Mutex(initiallyOwned: false, name: MutexName);
|
||||
bool acquired;
|
||||
try
|
||||
{
|
||||
// Short timeout — if another instance is alive it should already own the
|
||||
// mutex; if it's hung we don't want to block startup waiting for it.
|
||||
acquired = mutex.WaitOne(TimeSpan.FromMilliseconds(100), exitContext: false);
|
||||
}
|
||||
catch (AbandonedMutexException)
|
||||
{
|
||||
// Previous instance exited without releasing (crash, kill, etc.). The
|
||||
// OS hands us ownership anyway — treat as acquired.
|
||||
Log.Warning("Single-instance mutex was abandoned by a previous process; taking ownership.");
|
||||
acquired = true;
|
||||
}
|
||||
|
||||
if (acquired)
|
||||
{
|
||||
releaser = new MutexReleaser(mutex);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Best-effort: poke the existing instance to restore its window. Failure
|
||||
// here is non-fatal — even if the pipe send fails, the user can still
|
||||
// click the tray icon to restore the running instance.
|
||||
try
|
||||
{
|
||||
using var client = new NamedPipeClientStream(
|
||||
serverName: ".",
|
||||
pipeName: PipeName,
|
||||
direction: PipeDirection.Out);
|
||||
client.Connect(timeout: 1000);
|
||||
using var writer = new StreamWriter(client) { AutoFlush = true };
|
||||
writer.WriteLine(ActivateMessage);
|
||||
Log.Information("Existing CaptureImage instance detected — sent ACTIVATE and exiting.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Warning(ex, "Failed to ping existing instance over named pipe; user must restore manually.");
|
||||
}
|
||||
|
||||
mutex.Dispose();
|
||||
releaser = NoopReleaser.Instance;
|
||||
return false;
|
||||
}
|
||||
|
||||
private sealed class MutexReleaser : IDisposable
|
||||
{
|
||||
private Mutex? _mutex;
|
||||
|
||||
public MutexReleaser(Mutex mutex) => _mutex = mutex;
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_mutex is null) return;
|
||||
try { _mutex.ReleaseMutex(); }
|
||||
catch (ApplicationException) { /* not owned — race on shutdown */ }
|
||||
_mutex.Dispose();
|
||||
_mutex = null;
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class NoopReleaser : IDisposable
|
||||
{
|
||||
public static readonly NoopReleaser Instance = new();
|
||||
public void Dispose() { }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace CaptureImage.Core.Abstractions;
|
||||
|
||||
/// <summary>
|
||||
/// Abstraction over the OS clipboard so portable code can copy a captured image
|
||||
/// without taking a Windows.* / WinAppSDK dependency. The UI project supplies the
|
||||
/// real implementation; tests can inject a fake.
|
||||
/// </summary>
|
||||
public interface IClipboardService
|
||||
{
|
||||
/// <summary>
|
||||
/// Copy the given PNG-encoded image bytes to the clipboard as a bitmap.
|
||||
/// Best-effort: returns <c>false</c> if the clipboard is locked or the data
|
||||
/// can't be set (the caller may surface a toast but should not crash).
|
||||
/// </summary>
|
||||
Task<bool> CopyImageAsync(byte[] pngBytes, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Copy plain text to the clipboard. Used by the OCR pipeline to deliver extracted
|
||||
/// text. Returns <c>false</c> on clipboard contention.
|
||||
/// </summary>
|
||||
bool CopyText(string text);
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
namespace CaptureImage.Core.Abstractions;
|
||||
|
||||
/// <summary>
|
||||
/// Watches the system-wide foreground window and reports changes. Used by the dashboard
|
||||
/// to auto-switch the selected target when the user Alt-Tabs to another app. Implementations
|
||||
/// must filter out the host process's own windows and debounce rapid switches so the UI
|
||||
/// only reacts after the user lands on a window.
|
||||
/// </summary>
|
||||
public interface IForegroundWindowWatcher : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Fires when the foreground window changes — after debouncing and self-process
|
||||
/// filtering. Subscribers may run on any thread; marshal to the UI thread before
|
||||
/// touching bindings.
|
||||
/// </summary>
|
||||
event EventHandler<nint>? ForegroundChanged;
|
||||
|
||||
/// <summary><c>true</c> while the underlying hook is registered.</summary>
|
||||
bool IsRunning { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Register the foreground hook. Idempotent — calling while already running is a
|
||||
/// no-op. Must be called from a thread with a message pump (the WinUI 3 UI thread)
|
||||
/// because SetWinEventHook with WINEVENT_OUTOFCONTEXT routes callbacks via posted
|
||||
/// messages.
|
||||
/// </summary>
|
||||
void Start();
|
||||
|
||||
/// <summary>Unhook and stop reporting events. Safe to call repeatedly.</summary>
|
||||
void Stop();
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
namespace CaptureImage.Core.Abstractions;
|
||||
|
||||
/// <summary>
|
||||
/// Result of an OCR pass over a captured image.
|
||||
/// </summary>
|
||||
/// <param name="Text">Extracted text in reading order. Empty if no glyphs were recognised.</param>
|
||||
/// <param name="AverageConfidence">0.0–1.0; 0 if no engine was available.</param>
|
||||
/// <param name="EngineAvailable">
|
||||
/// <c>false</c> when the OS has no recognizer pack installed for the requested language
|
||||
/// (and no usable fallback). UIs should disable the action and surface a hint.
|
||||
/// </param>
|
||||
public sealed record OcrResult(string Text, double AverageConfidence, bool EngineAvailable);
|
||||
|
||||
/// <summary>
|
||||
/// Offline OCR. Wraps the OS-supplied <c>Windows.Media.Ocr</c> engine on the
|
||||
/// implementation side; abstracted here so the portable VM layer can stay free of
|
||||
/// WinRT references and test fakes can stub it.
|
||||
/// </summary>
|
||||
public interface IOcrService
|
||||
{
|
||||
/// <summary>
|
||||
/// Recognise text from the given PNG-encoded image. <paramref name="languageTag"/>
|
||||
/// is a BCP-47 hint (e.g. <c>en-US</c>); <c>null</c> defers to the user's profile
|
||||
/// languages, falling back to en-US, then to <see cref="OcrResult.EngineAvailable"/>=false.
|
||||
/// </summary>
|
||||
Task<OcrResult> RecognizeAsync(byte[] pngBytes, string? languageTag, CancellationToken cancellationToken = default);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace CaptureImage.Core.Abstractions;
|
||||
|
||||
/// <summary>
|
||||
/// Spawns a small always-on-top window holding a thumbnail of the most recent capture.
|
||||
/// Each call creates a fresh window so users can keep multiple captures pinned and
|
||||
/// compare them side-by-side. Implementation lives in the UI project.
|
||||
/// </summary>
|
||||
public interface IPinnedThumbnailHost
|
||||
{
|
||||
/// <summary>
|
||||
/// Show a new pinned thumbnail. <paramref name="pngBytes"/> is the encoded image,
|
||||
/// <paramref name="filePath"/> is the file the capture was written to (may be null
|
||||
/// if clipboard-only mode skipped the save), and <paramref name="targetName"/> is
|
||||
/// the display name shown in the title for context.
|
||||
/// </summary>
|
||||
void Show(byte[] pngBytes, string? filePath, string targetName);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using CaptureImage.Core.Models;
|
||||
|
||||
namespace CaptureImage.Core.Abstractions;
|
||||
|
||||
/// <summary>
|
||||
/// Capture an arbitrary rectangular region of the desktop. Implementations show an
|
||||
/// overlay so the user can drag-select; <c>null</c> means the user cancelled (Esc /
|
||||
/// click outside / overlay closed).
|
||||
/// </summary>
|
||||
public interface IRegionCaptureService
|
||||
{
|
||||
Task<CapturedFrame?> SelectAndCaptureAsync(CancellationToken cancellationToken = default);
|
||||
}
|
||||
@@ -73,6 +73,36 @@ public sealed record CaptureSettings
|
||||
/// lands on disk. When <c>false</c>, captures are saved immediately.
|
||||
/// </summary>
|
||||
public bool PreviewBeforeSave { get; init; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// When <c>true</c>, the dashboard's selected target follows the OS foreground window —
|
||||
/// Alt-Tab to a target and CaptureImage re-selects it automatically. Off by default to
|
||||
/// keep behaviour predictable for users who curate the list manually.
|
||||
/// </summary>
|
||||
public bool AutoSwitchOnAltTab { get; init; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Optional countdown in seconds before the actual capture fires after the hotkey is
|
||||
/// pressed. <c>0</c> = disabled (default — capture immediately). Valid values are
|
||||
/// 0, 3, 5, 10. Useful for capturing tooltips, hover states, or menu open/close
|
||||
/// animations that disappear when you Alt-Tab back.
|
||||
/// </summary>
|
||||
public int CountdownSeconds { get; init; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Clipboard side-effect on save. Stored as a string for forward compatibility:
|
||||
/// <c>None</c> (default) = file only, <c>Copy</c> = clipboard only (no file written),
|
||||
/// <c>CopyAndSave</c> = both. Anything else falls back to <c>None</c>.
|
||||
/// </summary>
|
||||
public string ClipboardMode { get; init; } = "None";
|
||||
|
||||
/// <summary>
|
||||
/// Capture mode. <c>Window</c> (default) captures the dashboard's selected target via
|
||||
/// Windows.Graphics.Capture; <c>Region</c> opens a full-screen overlay so the user
|
||||
/// drags a rectangle. v1.5 supports the primary monitor only — multi-monitor lands
|
||||
/// in v1.6.
|
||||
/// </summary>
|
||||
public string Mode { get; init; } = "Window";
|
||||
}
|
||||
|
||||
/// <summary>UI / behaviour preferences not tied to a specific tab.</summary>
|
||||
@@ -85,4 +115,17 @@ public sealed record UiSettings
|
||||
public bool ShowLogViewer { get; init; } = false;
|
||||
|
||||
public bool SoundEnabled { get; init; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Open the output folder in Explorer after each successful save. Off by default —
|
||||
/// most users prefer not to be interrupted while gaming.
|
||||
/// </summary>
|
||||
public bool OpenFolderAfterSave { get; init; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Automatically spawn a pinned floating thumbnail window after each capture so the
|
||||
/// user can keep recent shots on top while continuing to work in other apps. Off by
|
||||
/// default — only the explicit Pin button on the preview window opens one otherwise.
|
||||
/// </summary>
|
||||
public bool AutoPinAfterCapture { get; init; } = false;
|
||||
}
|
||||
@@ -48,8 +48,8 @@ public sealed class CaptureOrchestrator
|
||||
$"No encoder registered for format {request.Format}.");
|
||||
|
||||
_logger.LogInformation(
|
||||
"Capturing target {Target} → {Format} at {Dir}.",
|
||||
request.Target.DisplayName, request.Format, request.OutputDirectory);
|
||||
"Starting picture capture of {Target} as {Format}...",
|
||||
request.Target.DisplayName, request.Format);
|
||||
|
||||
var frame = await _engine.CaptureAsync(request.Target, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
@@ -93,9 +93,12 @@ public sealed class CaptureOrchestrator
|
||||
}
|
||||
|
||||
stopwatch.Stop();
|
||||
var fileName = Path.GetFileName(finalPath);
|
||||
var directory = Path.GetDirectoryName(finalPath) ?? string.Empty;
|
||||
var sizeKb = fileSize / 1024d;
|
||||
_logger.LogInformation(
|
||||
"Capture OK → {Path} ({Width}x{Height}, {Size} bytes, {Ms}ms).",
|
||||
finalPath, frame.Width, frame.Height, fileSize, stopwatch.ElapsedMilliseconds);
|
||||
"Picture captured: {Name} ({Width}x{Height}, {SizeKb:F1} KB) at {Path} [{Format}].",
|
||||
fileName, frame.Width, frame.Height, sizeKb, directory, request.Format);
|
||||
|
||||
return new CaptureResult.Success(
|
||||
FilePath: finalPath,
|
||||
@@ -106,21 +109,29 @@ public sealed class CaptureOrchestrator
|
||||
}
|
||||
catch (CaptureException ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "Capture failed with known error {Code}.", ex.ErrorCode);
|
||||
if (ex.ErrorCode == CaptureError.Cancelled)
|
||||
{
|
||||
_logger.LogInformation("Picture capture cancelled by user.");
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.LogWarning(ex, "Picture capture failed: {Reason}", ex.Message);
|
||||
}
|
||||
return new CaptureResult.Failure(ex.ErrorCode, ex.Message, ex);
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
_logger.LogInformation("Picture capture cancelled by user.");
|
||||
return new CaptureResult.Failure(CaptureError.Cancelled, "Capture was cancelled.");
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
_logger.LogError(ex, "File write failed during capture.");
|
||||
_logger.LogError(ex, "Picture capture failed: couldn't write to {Path}.", request.OutputDirectory);
|
||||
return new CaptureResult.Failure(CaptureError.FileWriteFailure, ex.Message, ex);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Unexpected exception during capture.");
|
||||
_logger.LogError(ex, "Picture capture failed unexpectedly.");
|
||||
return new CaptureResult.Failure(CaptureError.Unknown, ex.Message, ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using System.Runtime.Versioning;
|
||||
using CaptureImage.Core.Abstractions;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Windows.Globalization;
|
||||
using Windows.Graphics.Imaging;
|
||||
using Windows.Media.Ocr;
|
||||
using Windows.Storage.Streams;
|
||||
using OcrResult = CaptureImage.Core.Abstractions.OcrResult;
|
||||
using WinOcrResult = Windows.Media.Ocr.OcrResult;
|
||||
|
||||
namespace CaptureImage.Infrastructure.Ocr;
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="IOcrService"/> backed by the OS-supplied <c>Windows.Media.Ocr</c> engine.
|
||||
/// All recognition runs on-device; nothing leaves the machine. Engine availability
|
||||
/// depends on the user's installed language packs (Settings → Time & language →
|
||||
/// Language & region → "Optional features" → "Basic typing"+"Optical character
|
||||
/// recognition").
|
||||
/// </summary>
|
||||
[SupportedOSPlatform("windows10.0.10240.0")]
|
||||
public sealed class WindowsOcrService : IOcrService
|
||||
{
|
||||
private readonly ILogger<WindowsOcrService> _logger;
|
||||
|
||||
public WindowsOcrService(ILogger<WindowsOcrService> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public async Task<OcrResult> RecognizeAsync(
|
||||
byte[] pngBytes,
|
||||
string? languageTag,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (pngBytes is null || pngBytes.Length == 0)
|
||||
{
|
||||
return new OcrResult(string.Empty, 0.0, EngineAvailable: false);
|
||||
}
|
||||
|
||||
var engine = ResolveEngine(languageTag);
|
||||
if (engine is null)
|
||||
{
|
||||
_logger.LogInformation(
|
||||
"No OCR engine available for language tag '{Tag}' or fallbacks; OCR disabled.",
|
||||
languageTag ?? "(auto)");
|
||||
return new OcrResult(string.Empty, 0.0, EngineAvailable: false);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
using var stream = new InMemoryRandomAccessStream();
|
||||
await stream.WriteAsync(pngBytes.AsBuffer()).AsTask(cancellationToken).ConfigureAwait(false);
|
||||
stream.Seek(0);
|
||||
|
||||
var decoder = await BitmapDecoder.CreateAsync(stream).AsTask(cancellationToken).ConfigureAwait(false);
|
||||
using var softwareBitmap = await decoder.GetSoftwareBitmapAsync().AsTask(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
WinOcrResult result = await engine.RecognizeAsync(softwareBitmap).AsTask(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
// Average per-line confidence — OcrResult on the WinRT side exposes per-word
|
||||
// confidence on each Word inside each Line. The library's own
|
||||
// OcrResult.Text already gives us reading-order text.
|
||||
double sum = 0;
|
||||
int count = 0;
|
||||
foreach (var line in result.Lines)
|
||||
{
|
||||
foreach (var word in line.Words)
|
||||
{
|
||||
// Word.Confidence is exposed in the BoundingRect overload only on newer
|
||||
// Windows versions. For broad compatibility we just count words and
|
||||
// report a coarse 0.85 if anything came back — UI consumers care about
|
||||
// "did we get text" more than calibrated probability.
|
||||
count++;
|
||||
sum += 0.85;
|
||||
}
|
||||
}
|
||||
var confidence = count > 0 ? sum / count : 0.0;
|
||||
|
||||
return new OcrResult(result.Text ?? string.Empty, confidence, EngineAvailable: true);
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "OCR recognition threw; returning empty result.");
|
||||
return new OcrResult(string.Empty, 0.0, EngineAvailable: true);
|
||||
}
|
||||
}
|
||||
|
||||
private OcrEngine? ResolveEngine(string? languageTag)
|
||||
{
|
||||
// 1. Explicit language tag if the caller passed one.
|
||||
if (!string.IsNullOrWhiteSpace(languageTag))
|
||||
{
|
||||
try
|
||||
{
|
||||
var lang = new Language(languageTag);
|
||||
if (OcrEngine.IsLanguageSupported(lang))
|
||||
{
|
||||
return OcrEngine.TryCreateFromLanguage(lang);
|
||||
}
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
// Unknown / malformed tag — fall through to user profile chain.
|
||||
}
|
||||
}
|
||||
|
||||
// 2. User profile languages (whatever the OS thinks the user types in).
|
||||
var profileEngine = OcrEngine.TryCreateFromUserProfileLanguages();
|
||||
if (profileEngine is not null) return profileEngine;
|
||||
|
||||
// 3. Hard fallback: en-US — the most likely pack to be installed on a Windows
|
||||
// machine, even one in a non-English region.
|
||||
try
|
||||
{
|
||||
var enUS = new Language("en-US");
|
||||
if (OcrEngine.IsLanguageSupported(enUS))
|
||||
{
|
||||
return OcrEngine.TryCreateFromLanguage(enUS);
|
||||
}
|
||||
}
|
||||
catch (ArgumentException) { /* shouldn't happen, but stay graceful */ }
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,9 @@ using System.Text;
|
||||
namespace CaptureImage.Infrastructure.Processes.Interop;
|
||||
|
||||
/// <summary>
|
||||
/// Minimal Win32 surface used by <see cref="WindowEnumerator"/>. Only the calls we actually
|
||||
/// make land here — do not grow this file into a general user32 wrapper.
|
||||
/// Minimal Win32 surface used by the Processes module (window enumeration + foreground
|
||||
/// hook). Only the calls we actually make land here — do not grow this file into a
|
||||
/// general user32 wrapper.
|
||||
/// </summary>
|
||||
internal static partial class User32
|
||||
{
|
||||
@@ -34,6 +35,35 @@ internal static partial class User32
|
||||
[LibraryImport("user32.dll", SetLastError = true)]
|
||||
public static partial IntPtr GetWindow(IntPtr hWnd, uint uCmd);
|
||||
|
||||
[LibraryImport("user32.dll", SetLastError = true)]
|
||||
public static partial IntPtr GetForegroundWindow();
|
||||
|
||||
// SetWinEventHook callback signature. Stays a classic [UnmanagedFunctionPointer]
|
||||
// delegate (not [LibraryImport]) because [LibraryImport] doesn't support delegate
|
||||
// parameters yet — the source generator won't marshal them.
|
||||
public delegate void WinEventDelegate(
|
||||
IntPtr hWinEventHook, uint eventType, IntPtr hwnd,
|
||||
int idObject, int idChild, uint dwEventThread, uint dwmsEventTime);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
public static extern IntPtr SetWinEventHook(
|
||||
uint eventMin, uint eventMax,
|
||||
IntPtr hmodWinEventProc,
|
||||
WinEventDelegate lpfnWinEventProc,
|
||||
uint idProcess, uint idThread,
|
||||
uint dwFlags);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static extern bool UnhookWinEvent(IntPtr hWinEventHook);
|
||||
|
||||
// SetWinEventHook event constants
|
||||
public const uint EVENT_SYSTEM_FOREGROUND = 0x0003;
|
||||
|
||||
// SetWinEventHook flags
|
||||
public const uint WINEVENT_OUTOFCONTEXT = 0x0000;
|
||||
public const uint WINEVENT_SKIPOWNPROCESS = 0x0002;
|
||||
|
||||
// GetWindowLongPtr indices
|
||||
public const int GWL_EXSTYLE = -20;
|
||||
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
using System.Threading;
|
||||
using CaptureImage.Core.Abstractions;
|
||||
using CaptureImage.Infrastructure.Processes.Interop;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace CaptureImage.Infrastructure.Processes;
|
||||
|
||||
/// <summary>
|
||||
/// Win32 implementation of <see cref="IForegroundWindowWatcher"/>. Wraps
|
||||
/// <c>SetWinEventHook(EVENT_SYSTEM_FOREGROUND, …)</c> and debounces rapid switches so
|
||||
/// the dashboard only re-selects the target after the user lands on a window.
|
||||
/// </summary>
|
||||
public sealed class Win32ForegroundWindowWatcher : IForegroundWindowWatcher
|
||||
{
|
||||
private static readonly TimeSpan DebounceDelay = TimeSpan.FromMilliseconds(250);
|
||||
|
||||
private readonly ILogger<Win32ForegroundWindowWatcher> _logger;
|
||||
private readonly object _gate = new();
|
||||
private readonly uint _ownProcessId;
|
||||
|
||||
private IntPtr _hookHandle;
|
||||
// Holding a strong reference to the delegate is mandatory: the callback is invoked
|
||||
// by the OS message loop, and a GC of the delegate while the hook is active
|
||||
// crashes with an AccessViolationException on the next foreground change.
|
||||
private User32.WinEventDelegate? _callback;
|
||||
|
||||
private readonly Timer _debounceTimer;
|
||||
private IntPtr _pendingHwnd;
|
||||
private bool _disposed;
|
||||
|
||||
public event EventHandler<nint>? ForegroundChanged;
|
||||
|
||||
public bool IsRunning { get; private set; }
|
||||
|
||||
public Win32ForegroundWindowWatcher(ILogger<Win32ForegroundWindowWatcher> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
_ownProcessId = (uint)Environment.ProcessId;
|
||||
_debounceTimer = new Timer(OnDebounceElapsed, null, Timeout.Infinite, Timeout.Infinite);
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
lock (_gate)
|
||||
{
|
||||
if (_disposed) return;
|
||||
if (IsRunning) return;
|
||||
|
||||
_callback = OnRawForegroundEvent;
|
||||
_hookHandle = User32.SetWinEventHook(
|
||||
User32.EVENT_SYSTEM_FOREGROUND, User32.EVENT_SYSTEM_FOREGROUND,
|
||||
IntPtr.Zero, _callback,
|
||||
idProcess: 0, idThread: 0,
|
||||
User32.WINEVENT_OUTOFCONTEXT | User32.WINEVENT_SKIPOWNPROCESS);
|
||||
|
||||
if (_hookHandle == IntPtr.Zero)
|
||||
{
|
||||
_logger.LogWarning("Foreground window watcher failed to register WinEvent hook.");
|
||||
_callback = null;
|
||||
return;
|
||||
}
|
||||
|
||||
IsRunning = true;
|
||||
_logger.LogDebug("Foreground window watcher started (hook=0x{Hook:X}).", _hookHandle);
|
||||
}
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
lock (_gate)
|
||||
{
|
||||
if (_hookHandle != IntPtr.Zero)
|
||||
{
|
||||
User32.UnhookWinEvent(_hookHandle);
|
||||
_hookHandle = IntPtr.Zero;
|
||||
}
|
||||
_callback = null;
|
||||
_pendingHwnd = IntPtr.Zero;
|
||||
_debounceTimer.Change(Timeout.Infinite, Timeout.Infinite);
|
||||
if (IsRunning)
|
||||
{
|
||||
_logger.LogDebug("Foreground window watcher stopped.");
|
||||
}
|
||||
IsRunning = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_disposed) return;
|
||||
_disposed = true;
|
||||
Stop();
|
||||
_debounceTimer.Dispose();
|
||||
}
|
||||
|
||||
private void OnRawForegroundEvent(
|
||||
IntPtr hWinEventHook, uint eventType, IntPtr hwnd,
|
||||
int idObject, int idChild, uint dwEventThread, uint dwmsEventTime)
|
||||
{
|
||||
// Use GetForegroundWindow() rather than the event's hwnd. On Win11 Alt-Tab the
|
||||
// event-supplied hwnd can be the modern Task View overlay (idObject != 0) or a
|
||||
// transient cloaked window — which got the original watcher to filter the event
|
||||
// out and miss the actual destination. Polling the OS at callback time always
|
||||
// returns the real foreground HWND. Mouse-click activations happened to ship a
|
||||
// single clean event so they worked under the old code; Alt-Tab didn't.
|
||||
var foreground = User32.GetForegroundWindow();
|
||||
if (foreground == IntPtr.Zero) return;
|
||||
|
||||
// WINEVENT_SKIPOWNPROCESS already filters most own-window events, but a defensive
|
||||
// pid check covers edge cases (e.g. a brokered window owned by another process).
|
||||
User32.GetWindowThreadProcessId(foreground, out var pid);
|
||||
if (pid == _ownProcessId) return;
|
||||
if (pid == 0) return;
|
||||
|
||||
_pendingHwnd = foreground;
|
||||
_debounceTimer.Change(DebounceDelay, Timeout.InfiniteTimeSpan);
|
||||
}
|
||||
|
||||
private void OnDebounceElapsed(object? state)
|
||||
{
|
||||
IntPtr hwnd;
|
||||
lock (_gate)
|
||||
{
|
||||
if (_disposed || !IsRunning) return;
|
||||
hwnd = _pendingHwnd;
|
||||
_pendingHwnd = IntPtr.Zero;
|
||||
}
|
||||
if (hwnd == IntPtr.Zero) return;
|
||||
|
||||
_logger.LogDebug("Foreground window watcher firing for HWND 0x{Hwnd:X}.", hwnd);
|
||||
|
||||
try
|
||||
{
|
||||
ForegroundChanged?.Invoke(this, hwnd);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "ForegroundChanged subscriber threw.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,14 @@ public sealed class ResxLocalizationService : ILocalizationService
|
||||
new("en-US"),
|
||||
new("vi-VN"),
|
||||
new("ar-SA"),
|
||||
new("ja-JP"),
|
||||
new("zh-Hans"),
|
||||
new("ko-KR"),
|
||||
new("es-ES"),
|
||||
new("fr-FR"),
|
||||
new("de-DE"),
|
||||
new("pt-BR"),
|
||||
new("ru-RU"),
|
||||
};
|
||||
|
||||
private readonly ResourceManager _resourceManager;
|
||||
|
||||
@@ -60,6 +60,10 @@
|
||||
<!-- Settings -->
|
||||
<data name="Settings_Title" xml:space="preserve"><value>الإعدادات</value></data>
|
||||
<data name="Settings_Language" xml:space="preserve"><value>اللغة</value></data>
|
||||
<data name="Settings_Theme" xml:space="preserve"><value>السمة</value></data>
|
||||
<data name="Settings_Theme_System" xml:space="preserve"><value>حسب النظام</value></data>
|
||||
<data name="Settings_Theme_Light" xml:space="preserve"><value>فاتح</value></data>
|
||||
<data name="Settings_Theme_Dark" xml:space="preserve"><value>داكن</value></data>
|
||||
<data name="Settings_Hotkey" xml:space="preserve"><value>مفتاح اختصار الالتقاط</value></data>
|
||||
<data name="Settings_HotkeyHint" xml:space="preserve"><value>انقر تسجيل ثم اضغط على مجموعة مفاتيح. Esc للإلغاء. إعادة التعيين تستعيد Ctrl+Shift+F12.</value></data>
|
||||
<data name="Settings_HotkeyRecord" xml:space="preserve"><value>تسجيل…</value></data>
|
||||
@@ -81,6 +85,8 @@
|
||||
<data name="Settings_BrowseTooltip" xml:space="preserve"><value>اختر مجلدًا بدلاً من كتابة المسار.</value></data>
|
||||
<data name="Settings_FileNameTemplate" xml:space="preserve"><value>قالب اسم الملف</value></data>
|
||||
<data name="Settings_PreviewBeforeSave" xml:space="preserve"><value>معاينة كل التقاط قبل الحفظ</value></data>
|
||||
<data name="Settings_AutoSwitchOnAltTab" xml:space="preserve"><value>التبديل التلقائي للهدف عند Alt-Tab</value></data>
|
||||
<data name="Settings_AutoSwitchOnAltTabHint" xml:space="preserve"><value>يتبع الهدف المحدد النافذة في المقدمة. التطبيقات غير المدرجة تترك تحديدك الحالي كما هو.</value></data>
|
||||
<data name="Settings_MinimizeToTray" xml:space="preserve"><value>زر الإغلاق يصغر إلى علبة النظام</value></data>
|
||||
<data name="Settings_SoundEnabled" xml:space="preserve"><value>تشغيل صوت الالتقاط</value></data>
|
||||
<data name="Settings_Import" xml:space="preserve"><value>استيراد…</value></data>
|
||||
@@ -112,7 +118,7 @@
|
||||
<data name="About_AiSection" xml:space="preserve"><value>التطوير بمساعدة الذكاء الاصطناعي</value></data>
|
||||
<data name="About_DisclaimersSection" xml:space="preserve"><value>إخلاءات المسؤولية</value></data>
|
||||
<data name="About_TranslationDisclaimer" xml:space="preserve"><value>الترجمات</value></data>
|
||||
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>حزم اللغة العربية والفيتنامية مترجمة بمساعدة الآلة. قد لا تتطابق المصطلحات مع العرف المحلي، وبعض الكلمات التقنية (hotkey، toast، frame، إلخ) تُركت بالإنجليزية عمداً. نرحب بمتحدثي اللغة الأم الراغبين في المراجعة لإرسال طلبات سحب على ملفات .resx في src/CaptureImage.UI/Resources/Strings/.</value></data>
|
||||
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>حزم لغة الفيتنامية والعربية واليابانية والصينية المبسطة والكورية والإسبانية والفرنسية والألمانية والبرتغالية البرازيلية والروسية مترجمة بمساعدة الآلة. قد لا تتطابق المصطلحات مع العرف المحلي، وبعض الكلمات التقنية (hotkey، toast، frame، إلخ) تُركت بالإنجليزية عمداً. نرحب بمتحدثي اللغة الأم الراغبين في المراجعة لإرسال طلبات سحب على ملفات .resx في src/CaptureImage.UI/Resources/Strings/.</value></data>
|
||||
<data name="About_CaptureDisclaimer" xml:space="preserve"><value>دعم الالتقاط</value></data>
|
||||
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>يمكن لـ CaptureImage التقاط معظم الألعاب النافذية وعديمة الحدود عبر Windows.Graphics.Capture، لكن ليست كل لعبة تعمل. الأسطح المحمية بـ DRM، وألعاب Direct3D 9 بالشاشة الكاملة الحصرية، والألعاب ذات خطافات anti-cheat قد تعيد إطارات سوداء أو ترفض الالتقاط. تُجرَّب آلية احتياطية GDI PrintWindow للتطبيقات القديمة. راجع docs/legal/DISCLAIMER.md §2 للقائمة الكاملة.</value></data>
|
||||
<data name="About_LiabilityDisclaimer" xml:space="preserve"><value>بدون ضمان</value></data>
|
||||
@@ -155,4 +161,36 @@
|
||||
<data name="Tray_OpenFolder" xml:space="preserve"><value>فتح مجلد اللقطات</value></data>
|
||||
<data name="Tray_Exit" xml:space="preserve"><value>خروج</value></data>
|
||||
|
||||
<!-- v1.5 quick wins -->
|
||||
<data name="Settings_Countdown" xml:space="preserve"><value>العد التنازلي قبل الالتقاط</value></data>
|
||||
<data name="Settings_CountdownOff" xml:space="preserve"><value>إيقاف (بدون تأخير)</value></data>
|
||||
<data name="Settings_Countdown3s" xml:space="preserve"><value>3 ثوانٍ</value></data>
|
||||
<data name="Settings_Countdown5s" xml:space="preserve"><value>5 ثوانٍ</value></data>
|
||||
<data name="Settings_Countdown10s" xml:space="preserve"><value>10 ثوانٍ</value></data>
|
||||
<data name="Settings_Clipboard" xml:space="preserve"><value>وضع الحافظة</value></data>
|
||||
<data name="Settings_ClipboardNone" xml:space="preserve"><value>إيقاف (ملف فقط)</value></data>
|
||||
<data name="Settings_ClipboardCopy" xml:space="preserve"><value>نسخ فقط (بدون ملف)</value></data>
|
||||
<data name="Settings_ClipboardCopySave" xml:space="preserve"><value>نسخ + حفظ الملف</value></data>
|
||||
<data name="Settings_OpenFolderAfterSave" xml:space="preserve"><value>فتح مجلد الإخراج بعد الحفظ</value></data>
|
||||
<data name="Toast_Countdown" xml:space="preserve"><value>الالتقاط خلال {0}…</value></data>
|
||||
<data name="Toast_ClipboardCopied" xml:space="preserve"><value>تم النسخ إلى الحافظة</value></data>
|
||||
|
||||
<!-- v1.5 pinned thumbnail -->
|
||||
<data name="Settings_AutoPinAfterCapture" xml:space="preserve"><value>تثبيت صورة مصغرة عائمة بعد كل لقطة</value></data>
|
||||
<data name="PinnedWindow_Open" xml:space="preserve"><value>إظهار في المستكشف</value></data>
|
||||
<data name="PinnedWindow_Close" xml:space="preserve"><value>إغلاق</value></data>
|
||||
|
||||
<!-- v1.5 OCR -->
|
||||
<data name="Preview_ExtractText" xml:space="preserve"><value>استخراج النص (OCR)</value></data>
|
||||
<data name="Toast_OcrSuccess" xml:space="preserve"><value>تم نسخ {0} كلمة</value></data>
|
||||
<data name="Toast_OcrEmpty" xml:space="preserve"><value>لم يُعثر على نص في الصورة</value></data>
|
||||
<data name="Toast_OcrUnavailable" xml:space="preserve"><value>محرك OCR غير متوفر لهذه اللغة</value></data>
|
||||
|
||||
<!-- v1.5 region capture -->
|
||||
<data name="Settings_CaptureMode" xml:space="preserve"><value>وضع الالتقاط</value></data>
|
||||
<data name="Settings_CaptureModeWindow" xml:space="preserve"><value>نافذة واحدة</value></data>
|
||||
<data name="Settings_CaptureModeRegion" xml:space="preserve"><value>منطقة (اسحب للتحديد)</value></data>
|
||||
<data name="Region_TargetName" xml:space="preserve"><value>منطقة</value></data>
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>اسحب مستطيلاً. اضغط Esc للإلغاء.</value></data>
|
||||
|
||||
</root>
|
||||
@@ -0,0 +1,196 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="xml:space" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
|
||||
<!-- Navigation -->
|
||||
<data name="Nav_Dashboard" xml:space="preserve"><value>Übersicht</value></data>
|
||||
<data name="Nav_Update" xml:space="preserve"><value>Aktualisierung</value></data>
|
||||
<data name="Nav_Settings" xml:space="preserve"><value>Einstellungen</value></data>
|
||||
<data name="Nav_About" xml:space="preserve"><value>Info</value></data>
|
||||
<data name="Nav_LogViewer" xml:space="preserve"><value>Protokoll</value></data>
|
||||
|
||||
<!-- Dashboard -->
|
||||
<data name="Dashboard_Title" xml:space="preserve"><value>Übersicht</value></data>
|
||||
<data name="Dashboard_Subtitle" xml:space="preserve"><value>Ziel auswählen und scharfschalten — Tastenkombination drücken zum Aufnehmen.</value></data>
|
||||
<data name="Dashboard_Refresh" xml:space="preserve"><value>Aktualisieren</value></data>
|
||||
<data name="Dashboard_Arm" xml:space="preserve"><value>Scharfschalten</value></data>
|
||||
<data name="Dashboard_Disarm" xml:space="preserve"><value>Deaktivieren</value></data>
|
||||
<data name="Dashboard_StatusIdle" xml:space="preserve"><value>Bereit — Ziel auswählen und scharfschalten zum Starten.</value></data>
|
||||
<data name="Dashboard_StatusArmed" xml:space="preserve"><value>Scharfgeschaltet: {0} drücken, um {1} aufzunehmen.</value></data>
|
||||
<data name="Dashboard_StatusCapturing" xml:space="preserve"><value>{0} wird aufgenommen…</value></data>
|
||||
<data name="Dashboard_StatusDisarmed" xml:space="preserve"><value>Deaktiviert.</value></data>
|
||||
<data name="Dashboard_StatusSaved" xml:space="preserve"><value>Gespeichert: {0} ({1}x{2}, {3} ms)</value></data>
|
||||
<data name="Dashboard_StatusFailed" xml:space="preserve"><value>Aufnahme fehlgeschlagen ({0}): {1}</value></data>
|
||||
<data name="Dashboard_TargetsCount" xml:space="preserve"><value>{0} Ziel(e) sichtbar</value></data>
|
||||
<data name="Dashboard_Loading" xml:space="preserve"><value>Wird geladen…</value></data>
|
||||
<data name="Dashboard_EmptyState" xml:space="preserve"><value>Keine sichtbaren Fenster zum Aufnehmen — Spiel oder App starten und dann auf Aktualisieren klicken.</value></data>
|
||||
<data name="Dashboard_LogToggle" xml:space="preserve"><value>Echtzeit-Protokollschublade umschalten</value></data>
|
||||
<data name="Dashboard_SteamBadge" xml:space="preserve"><value>STEAM</value></data>
|
||||
<data name="Dashboard_SteamBadgeTooltip" xml:space="preserve"><value>Steam-Spiel: {0} (AppId {1}). F12-Screenshot ist über das Steam-Overlay verfügbar. Manche Anti-Cheat-geschützte Spiele blockieren externe Aufnahmen.</value></data>
|
||||
|
||||
<!-- Settings -->
|
||||
<data name="Settings_Title" xml:space="preserve"><value>Einstellungen</value></data>
|
||||
<data name="Settings_Language" xml:space="preserve"><value>Sprache</value></data>
|
||||
<data name="Settings_Theme" xml:space="preserve"><value>Design</value></data>
|
||||
<data name="Settings_Theme_System" xml:space="preserve"><value>System</value></data>
|
||||
<data name="Settings_Theme_Light" xml:space="preserve"><value>Hell</value></data>
|
||||
<data name="Settings_Theme_Dark" xml:space="preserve"><value>Dunkel</value></data>
|
||||
<data name="Settings_Hotkey" xml:space="preserve"><value>Aufnahme-Tastenkombination</value></data>
|
||||
<data name="Settings_HotkeyHint" xml:space="preserve"><value>Auf Aufzeichnen klicken und eine Kombination drücken. Esc bricht ab. Zurücksetzen stellt Strg+Umschalt+F12 wieder her.</value></data>
|
||||
<data name="Settings_HotkeyRecord" xml:space="preserve"><value>Aufzeichnen…</value></data>
|
||||
<data name="Settings_HotkeyCancel" xml:space="preserve"><value>Abbrechen</value></data>
|
||||
<data name="Settings_HotkeyReset" xml:space="preserve"><value>Zurücksetzen</value></data>
|
||||
<data name="Settings_HotkeyRecorderPrompt" xml:space="preserve"><value>Tastenkombination drücken (Esc zum Abbrechen)…</value></data>
|
||||
<data name="Settings_HotkeyErrorNoPrimary" xml:space="preserve"><value>Wählen Sie eine Haupttaste (z. B. einen Buchstaben oder eine F-Taste).</value></data>
|
||||
<data name="Settings_HotkeyErrorModifierOnly" xml:space="preserve"><value>Eine Modifizierertaste allein reicht nicht — fügen Sie einen Buchstaben oder eine F-Taste hinzu.</value></data>
|
||||
<data name="Settings_HotkeyErrorNeedsModifier" xml:space="preserve"><value>Einfache Buchstaben und Ziffern benötigen mindestens einen Modifizierer (Strg/Alt/Umschalt/Win).</value></data>
|
||||
<data name="Settings_HotkeyErrorReserved" xml:space="preserve"><value>Diese Kombination ist von Windows reserviert und kann nicht erfasst werden.</value></data>
|
||||
<data name="Settings_HotkeyConflictWarning" xml:space="preserve"><value>Eine andere Anwendung beansprucht möglicherweise diese Kombination — sie wird eventuell nicht ausgelöst, solange diese App läuft.</value></data>
|
||||
<data name="Settings_Format" xml:space="preserve"><value>Standardformat</value></data>
|
||||
<data name="Settings_JpegQuality" xml:space="preserve"><value>JPEG-Qualität</value></data>
|
||||
<data name="Settings_WebpQuality" xml:space="preserve"><value>WebP-Qualität</value></data>
|
||||
<data name="Settings_OutputFolder" xml:space="preserve"><value>Ausgabeordner</value></data>
|
||||
<data name="Settings_OutputFolderDefault" xml:space="preserve"><value>(Standard: Bilder\CaptureImage)</value></data>
|
||||
<data name="Settings_Browse" xml:space="preserve"><value>Durchsuchen…</value></data>
|
||||
<data name="Settings_BrowseTitle" xml:space="preserve"><value>Ausgabeordner wählen</value></data>
|
||||
<data name="Settings_BrowseTooltip" xml:space="preserve"><value>Ordner auswählen anstatt den Pfad einzutippen.</value></data>
|
||||
<data name="Settings_FileNameTemplate" xml:space="preserve"><value>Dateinamenvorlage</value></data>
|
||||
<data name="Settings_PreviewBeforeSave" xml:space="preserve"><value>Jede Aufnahme vor dem Speichern in der Vorschau anzeigen</value></data>
|
||||
<data name="Settings_AutoSwitchOnAltTab" xml:space="preserve"><value>Ziel beim Alt-Tab automatisch umschalten</value></data>
|
||||
<data name="Settings_AutoSwitchOnAltTabHint" xml:space="preserve"><value>Das ausgewählte Ziel folgt dem Vordergrundfenster. Apps, die nicht in der Zielliste stehen, behalten Ihre aktuelle Auswahl bei.</value></data>
|
||||
<data name="Settings_MinimizeToTray" xml:space="preserve"><value>Schließen-Schaltfläche minimiert in die Taskleiste</value></data>
|
||||
<data name="Settings_SoundEnabled" xml:space="preserve"><value>Aufnahmegeräusch abspielen</value></data>
|
||||
<data name="Settings_Import" xml:space="preserve"><value>Importieren…</value></data>
|
||||
<data name="Settings_Export" xml:space="preserve"><value>Exportieren…</value></data>
|
||||
<data name="Settings_ImportTitle" xml:space="preserve"><value>Einstellungen importieren</value></data>
|
||||
<data name="Settings_ExportTitle" xml:space="preserve"><value>Einstellungen exportieren</value></data>
|
||||
<data name="Settings_OpenFile" xml:space="preserve"><value>Einstellungsdatei öffnen</value></data>
|
||||
<data name="Settings_Logging" xml:space="preserve"><value>Protokollierung</value></data>
|
||||
<data name="Settings_LogLevel" xml:space="preserve"><value>Mindestprotokollstufe</value></data>
|
||||
<data name="Settings_LogLevelHint" xml:space="preserve"><value>Filtert die rollierende Protokolldatei und die Anzeige. Debug für Diagnose, Information für den Alltag, Warning oder Error, um Logs ruhig zu halten.</value></data>
|
||||
|
||||
<!-- Update -->
|
||||
<data name="Update_Title" xml:space="preserve"><value>Aktualisierung</value></data>
|
||||
<data name="Update_Check" xml:space="preserve"><value>Nach Updates suchen</value></data>
|
||||
<data name="Update_Download" xml:space="preserve"><value>Herunterladen</value></data>
|
||||
<data name="Update_Install" xml:space="preserve"><value>Installieren und neu starten</value></data>
|
||||
<data name="Update_Status" xml:space="preserve"><value>Status</value></data>
|
||||
<data name="Update_Log" xml:space="preserve"><value>Protokoll</value></data>
|
||||
<data name="Update_NewVersion" xml:space="preserve"><value>Neue Version:</value></data>
|
||||
|
||||
<!-- About -->
|
||||
<data name="About_Title" xml:space="preserve"><value>Über CaptureImage</value></data>
|
||||
<data name="About_Tagline" xml:space="preserve"><value>Schlanke Windows-Bildschirmaufnahme für Spiele ohne integrierte Screenshot-Taste.</value></data>
|
||||
<data name="About_AppLabel" xml:space="preserve"><value>App</value></data>
|
||||
<data name="About_VersionLabel" xml:space="preserve"><value>Version</value></data>
|
||||
<data name="About_LicenseLabel" xml:space="preserve"><value>Lizenz</value></data>
|
||||
<data name="About_DeveloperLabel" xml:space="preserve"><value>Entwickler</value></data>
|
||||
<data name="About_RepositoryLabel" xml:space="preserve"><value>Repository</value></data>
|
||||
<data name="About_AiSection" xml:space="preserve"><value>KI-unterstützte Entwicklung</value></data>
|
||||
<data name="About_DisclaimersSection" xml:space="preserve"><value>Hinweise</value></data>
|
||||
<data name="About_TranslationDisclaimer" xml:space="preserve"><value>Übersetzungen</value></data>
|
||||
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>Die Sprachpakete Vietnamesisch, Arabisch, Japanisch, vereinfachtes Chinesisch, Koreanisch, Spanisch, Französisch, Deutsch, brasilianisches Portugiesisch und Russisch wurden maschinell unterstützt. Die Terminologie entspricht möglicherweise nicht den muttersprachlichen Konventionen, und einige Fachbegriffe (hotkey, toast, frame usw.) bleiben absichtlich auf Englisch. Muttersprachler, die Korrektur lesen möchten, sind herzlich eingeladen, Pull Requests gegen die .resx-Dateien in src/CaptureImage.UI/Resources/Strings/ einzureichen.</value></data>
|
||||
<data name="About_CaptureDisclaimer" xml:space="preserve"><value>Aufnahmeunterstützung</value></data>
|
||||
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage kann die meisten Spiele im Fenster- oder randlosen Modus über Windows.Graphics.Capture aufnehmen, jedoch nicht jeden Titel. DRM-geschützte Oberflächen, exklusive Vollbild-Direct3D-9-Spiele und Titel mit Anti-Cheat-Hooks können schwarze Frames liefern oder die Aufnahme verweigern. Für Legacy-Apps wird ein GDI-PrintWindow-Fallback versucht. Vollständige Liste in docs/legal/DISCLAIMER.md §2.</value></data>
|
||||
<data name="About_LiabilityDisclaimer" xml:space="preserve"><value>Keine Gewährleistung</value></data>
|
||||
<data name="About_LiabilityDisclaimerBody" xml:space="preserve"><value>CaptureImage wird unter GPL-3.0-or-later WIE BESEHEN ohne jegliche Gewährleistung verteilt. Die Autoren haften nicht für verlorene Screenshots, Spielabstürze, Anti-Cheat-Sanktionen oder Datenverluste. Verwendung auf eigene Gefahr. Vollständiger Text in docs/legal/DISCLAIMER.md.</value></data>
|
||||
<data name="About_LegalSection" xml:space="preserve"><value>Rechtliche Dokumente</value></data>
|
||||
<data name="About_ThirdPartySection" xml:space="preserve"><value>Drittanbieterkomponenten</value></data>
|
||||
<data name="About_ThirdPartyHint" xml:space="preserve"><value>Klicken Sie oben auf „Drittanbieterhinweise" für die vollständige Liste mit Upstream-URLs.</value></data>
|
||||
<data name="About_OpenDisclaimer" xml:space="preserve"><value>Haftungsausschluss</value></data>
|
||||
<data name="About_OpenPrivacy" xml:space="preserve"><value>Datenschutz</value></data>
|
||||
<data name="About_OpenTerms" xml:space="preserve"><value>Bedingungen</value></data>
|
||||
<data name="About_OpenLicense" xml:space="preserve"><value>Lizenz (GPL-3.0)</value></data>
|
||||
<data name="About_OpenThirdParty" xml:space="preserve"><value>Drittanbieterhinweise</value></data>
|
||||
<data name="About_OpenContributors" xml:space="preserve"><value>Mitwirkende</value></data>
|
||||
|
||||
<!-- Log viewer -->
|
||||
<data name="Log_Title" xml:space="preserve"><value>Echtzeit-Protokoll</value></data>
|
||||
<data name="Log_Pause" xml:space="preserve"><value>Pause</value></data>
|
||||
<data name="Log_Resume" xml:space="preserve"><value>Fortsetzen</value></data>
|
||||
<data name="Log_Clear" xml:space="preserve"><value>Leeren</value></data>
|
||||
<data name="Log_EventsCount" xml:space="preserve"><value>{0} Ereignisse</value></data>
|
||||
<data name="Log_EmptyState" xml:space="preserve"><value>Noch keine Protokollereignisse. Live-Ereignisse vom Aufnahme-Engine erscheinen hier.</value></data>
|
||||
<data name="Log_Filter" xml:space="preserve"><value>Mindeststufe:</value></data>
|
||||
<data name="Log_RevealFolder" xml:space="preserve"><value>Ordner öffnen</value></data>
|
||||
|
||||
<!-- Preview -->
|
||||
<data name="Preview_Title" xml:space="preserve"><value>Vorschau</value></data>
|
||||
<data name="Preview_Prompt" xml:space="preserve"><value>Diese Aufnahme speichern?</value></data>
|
||||
<data name="Preview_Save" xml:space="preserve"><value>Speichern</value></data>
|
||||
<data name="Preview_Discard" xml:space="preserve"><value>Verwerfen</value></data>
|
||||
|
||||
<!-- Toasts -->
|
||||
<data name="Toast_CaptureSaved" xml:space="preserve"><value>Aufnahme gespeichert</value></data>
|
||||
<data name="Toast_CaptureFailed" xml:space="preserve"><value>Aufnahme fehlgeschlagen</value></data>
|
||||
<data name="Toast_SettingsImported" xml:space="preserve"><value>Einstellungen importiert</value></data>
|
||||
<data name="Toast_SettingsExported" xml:space="preserve"><value>Einstellungen exportiert</value></data>
|
||||
<data name="Toast_Error" xml:space="preserve"><value>Fehler</value></data>
|
||||
|
||||
<!-- Tray menu -->
|
||||
<data name="Tray_ShowWindow" xml:space="preserve"><value>CaptureImage anzeigen</value></data>
|
||||
<data name="Tray_OpenFolder" xml:space="preserve"><value>Aufnahmeordner öffnen</value></data>
|
||||
<data name="Tray_Exit" xml:space="preserve"><value>Beenden</value></data>
|
||||
|
||||
<!-- v1.5 quick wins -->
|
||||
<data name="Settings_Countdown" xml:space="preserve"><value>Aufnahme-Countdown</value></data>
|
||||
<data name="Settings_CountdownOff" xml:space="preserve"><value>Aus (keine Verzögerung)</value></data>
|
||||
<data name="Settings_Countdown3s" xml:space="preserve"><value>3 Sekunden</value></data>
|
||||
<data name="Settings_Countdown5s" xml:space="preserve"><value>5 Sekunden</value></data>
|
||||
<data name="Settings_Countdown10s" xml:space="preserve"><value>10 Sekunden</value></data>
|
||||
<data name="Settings_Clipboard" xml:space="preserve"><value>Zwischenablage-Modus</value></data>
|
||||
<data name="Settings_ClipboardNone" xml:space="preserve"><value>Aus (nur Datei)</value></data>
|
||||
<data name="Settings_ClipboardCopy" xml:space="preserve"><value>Nur kopieren (keine Datei)</value></data>
|
||||
<data name="Settings_ClipboardCopySave" xml:space="preserve"><value>Kopieren + Datei speichern</value></data>
|
||||
<data name="Settings_OpenFolderAfterSave" xml:space="preserve"><value>Ausgabeordner nach dem Speichern öffnen</value></data>
|
||||
<data name="Toast_Countdown" xml:space="preserve"><value>Aufnahme in {0}…</value></data>
|
||||
<data name="Toast_ClipboardCopied" xml:space="preserve"><value>In Zwischenablage kopiert</value></data>
|
||||
|
||||
<!-- v1.5 pinned thumbnail -->
|
||||
<data name="Settings_AutoPinAfterCapture" xml:space="preserve"><value>Nach jeder Aufnahme ein schwebendes Vorschaubild anpinnen</value></data>
|
||||
<data name="PinnedWindow_Open" xml:space="preserve"><value>Im Explorer anzeigen</value></data>
|
||||
<data name="PinnedWindow_Close" xml:space="preserve"><value>Schließen</value></data>
|
||||
|
||||
<!-- v1.5 OCR -->
|
||||
<data name="Preview_ExtractText" xml:space="preserve"><value>Text extrahieren (OCR)</value></data>
|
||||
<data name="Toast_OcrSuccess" xml:space="preserve"><value>{0} Wörter kopiert</value></data>
|
||||
<data name="Toast_OcrEmpty" xml:space="preserve"><value>Kein Text im Bild gefunden</value></data>
|
||||
<data name="Toast_OcrUnavailable" xml:space="preserve"><value>OCR-Engine für diese Sprache nicht verfügbar</value></data>
|
||||
|
||||
<!-- v1.5 region capture -->
|
||||
<data name="Settings_CaptureMode" xml:space="preserve"><value>Aufnahmemodus</value></data>
|
||||
<data name="Settings_CaptureModeWindow" xml:space="preserve"><value>Einzelfenster</value></data>
|
||||
<data name="Settings_CaptureModeRegion" xml:space="preserve"><value>Bereich (Ziehen zum Auswählen)</value></data>
|
||||
<data name="Region_TargetName" xml:space="preserve"><value>Bereich</value></data>
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>Rechteck ziehen. Esc zum Abbrechen.</value></data>
|
||||
|
||||
</root>
|
||||
@@ -0,0 +1,196 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="xml:space" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
|
||||
<!-- Navigation -->
|
||||
<data name="Nav_Dashboard" xml:space="preserve"><value>Panel</value></data>
|
||||
<data name="Nav_Update" xml:space="preserve"><value>Actualización</value></data>
|
||||
<data name="Nav_Settings" xml:space="preserve"><value>Configuración</value></data>
|
||||
<data name="Nav_About" xml:space="preserve"><value>Acerca de</value></data>
|
||||
<data name="Nav_LogViewer" xml:space="preserve"><value>Registro</value></data>
|
||||
|
||||
<!-- Dashboard -->
|
||||
<data name="Dashboard_Title" xml:space="preserve"><value>Panel</value></data>
|
||||
<data name="Dashboard_Subtitle" xml:space="preserve"><value>Selecciona un objetivo y actívalo — pulsa la tecla rápida para capturar.</value></data>
|
||||
<data name="Dashboard_Refresh" xml:space="preserve"><value>Actualizar</value></data>
|
||||
<data name="Dashboard_Arm" xml:space="preserve"><value>Activar</value></data>
|
||||
<data name="Dashboard_Disarm" xml:space="preserve"><value>Desactivar</value></data>
|
||||
<data name="Dashboard_StatusIdle" xml:space="preserve"><value>Inactivo — selecciona un objetivo y actívalo para empezar.</value></data>
|
||||
<data name="Dashboard_StatusArmed" xml:space="preserve"><value>Activado: pulsa {0} para capturar {1}.</value></data>
|
||||
<data name="Dashboard_StatusCapturing" xml:space="preserve"><value>Capturando {0}…</value></data>
|
||||
<data name="Dashboard_StatusDisarmed" xml:space="preserve"><value>Desactivado.</value></data>
|
||||
<data name="Dashboard_StatusSaved" xml:space="preserve"><value>Guardado: {0} ({1}x{2}, {3} ms)</value></data>
|
||||
<data name="Dashboard_StatusFailed" xml:space="preserve"><value>Captura fallida ({0}): {1}</value></data>
|
||||
<data name="Dashboard_TargetsCount" xml:space="preserve"><value>{0} objetivo(s) visible(s)</value></data>
|
||||
<data name="Dashboard_Loading" xml:space="preserve"><value>Cargando…</value></data>
|
||||
<data name="Dashboard_EmptyState" xml:space="preserve"><value>No hay ventanas visibles para capturar — abre tu juego o aplicación y pulsa Actualizar.</value></data>
|
||||
<data name="Dashboard_LogToggle" xml:space="preserve"><value>Mostrar/ocultar el panel de registro en tiempo real</value></data>
|
||||
<data name="Dashboard_SteamBadge" xml:space="preserve"><value>STEAM</value></data>
|
||||
<data name="Dashboard_SteamBadgeTooltip" xml:space="preserve"><value>Juego de Steam: {0} (AppId {1}). La captura con F12 está disponible mediante la superposición de Steam. Algunos juegos protegidos por anticheat pueden bloquear la captura externa.</value></data>
|
||||
|
||||
<!-- Settings -->
|
||||
<data name="Settings_Title" xml:space="preserve"><value>Configuración</value></data>
|
||||
<data name="Settings_Language" xml:space="preserve"><value>Idioma</value></data>
|
||||
<data name="Settings_Theme" xml:space="preserve"><value>Tema</value></data>
|
||||
<data name="Settings_Theme_System" xml:space="preserve"><value>Sistema</value></data>
|
||||
<data name="Settings_Theme_Light" xml:space="preserve"><value>Claro</value></data>
|
||||
<data name="Settings_Theme_Dark" xml:space="preserve"><value>Oscuro</value></data>
|
||||
<data name="Settings_Hotkey" xml:space="preserve"><value>Tecla rápida de captura</value></data>
|
||||
<data name="Settings_HotkeyHint" xml:space="preserve"><value>Pulsa Grabar y luego una combinación de teclas. Esc cancela. Restablecer recupera Ctrl+Shift+F12.</value></data>
|
||||
<data name="Settings_HotkeyRecord" xml:space="preserve"><value>Grabar…</value></data>
|
||||
<data name="Settings_HotkeyCancel" xml:space="preserve"><value>Cancelar</value></data>
|
||||
<data name="Settings_HotkeyReset" xml:space="preserve"><value>Restablecer</value></data>
|
||||
<data name="Settings_HotkeyRecorderPrompt" xml:space="preserve"><value>Pulsa una combinación de teclas (Esc para cancelar)…</value></data>
|
||||
<data name="Settings_HotkeyErrorNoPrimary" xml:space="preserve"><value>Selecciona una tecla principal (por ejemplo, una letra o una tecla F).</value></data>
|
||||
<data name="Settings_HotkeyErrorModifierOnly" xml:space="preserve"><value>Una tecla modificadora sola no basta — añade una letra o una tecla F.</value></data>
|
||||
<data name="Settings_HotkeyErrorNeedsModifier" xml:space="preserve"><value>Las letras y dígitos sueltos requieren al menos un modificador (Ctrl/Alt/Shift/Win).</value></data>
|
||||
<data name="Settings_HotkeyErrorReserved" xml:space="preserve"><value>Esta combinación está reservada por Windows y no puede usarse.</value></data>
|
||||
<data name="Settings_HotkeyConflictWarning" xml:space="preserve"><value>Otra aplicación puede estar usando esta combinación — quizá no funcione mientras esa app esté abierta.</value></data>
|
||||
<data name="Settings_Format" xml:space="preserve"><value>Formato predeterminado</value></data>
|
||||
<data name="Settings_JpegQuality" xml:space="preserve"><value>Calidad JPEG</value></data>
|
||||
<data name="Settings_WebpQuality" xml:space="preserve"><value>Calidad WebP</value></data>
|
||||
<data name="Settings_OutputFolder" xml:space="preserve"><value>Carpeta de salida</value></data>
|
||||
<data name="Settings_OutputFolderDefault" xml:space="preserve"><value>(predeterminado: Pictures\CaptureImage)</value></data>
|
||||
<data name="Settings_Browse" xml:space="preserve"><value>Examinar…</value></data>
|
||||
<data name="Settings_BrowseTitle" xml:space="preserve"><value>Elegir carpeta de salida</value></data>
|
||||
<data name="Settings_BrowseTooltip" xml:space="preserve"><value>Elige una carpeta en lugar de escribir la ruta.</value></data>
|
||||
<data name="Settings_FileNameTemplate" xml:space="preserve"><value>Plantilla del nombre de archivo</value></data>
|
||||
<data name="Settings_PreviewBeforeSave" xml:space="preserve"><value>Previsualizar cada captura antes de guardar</value></data>
|
||||
<data name="Settings_AutoSwitchOnAltTab" xml:space="preserve"><value>Cambiar automáticamente de objetivo al usar Alt-Tab</value></data>
|
||||
<data name="Settings_AutoSwitchOnAltTabHint" xml:space="preserve"><value>El objetivo seleccionado sigue a la ventana en primer plano. Las apps que no estén en la lista mantienen tu selección actual.</value></data>
|
||||
<data name="Settings_MinimizeToTray" xml:space="preserve"><value>El botón Cerrar minimiza a la bandeja</value></data>
|
||||
<data name="Settings_SoundEnabled" xml:space="preserve"><value>Reproducir sonido al capturar</value></data>
|
||||
<data name="Settings_Import" xml:space="preserve"><value>Importar…</value></data>
|
||||
<data name="Settings_Export" xml:space="preserve"><value>Exportar…</value></data>
|
||||
<data name="Settings_ImportTitle" xml:space="preserve"><value>Importar configuración</value></data>
|
||||
<data name="Settings_ExportTitle" xml:space="preserve"><value>Exportar configuración</value></data>
|
||||
<data name="Settings_OpenFile" xml:space="preserve"><value>Abrir archivo de configuración</value></data>
|
||||
<data name="Settings_Logging" xml:space="preserve"><value>Registro</value></data>
|
||||
<data name="Settings_LogLevel" xml:space="preserve"><value>Nivel mínimo del registro</value></data>
|
||||
<data name="Settings_LogLevelHint" xml:space="preserve"><value>Filtra el archivo de registro rotativo y el visor. Elige Debug para diagnóstico, Information para uso diario, o Warning/Error para reducir el volumen.</value></data>
|
||||
|
||||
<!-- Update -->
|
||||
<data name="Update_Title" xml:space="preserve"><value>Actualización</value></data>
|
||||
<data name="Update_Check" xml:space="preserve"><value>Buscar actualizaciones</value></data>
|
||||
<data name="Update_Download" xml:space="preserve"><value>Descargar</value></data>
|
||||
<data name="Update_Install" xml:space="preserve"><value>Instalar y reiniciar</value></data>
|
||||
<data name="Update_Status" xml:space="preserve"><value>Estado</value></data>
|
||||
<data name="Update_Log" xml:space="preserve"><value>Registro</value></data>
|
||||
<data name="Update_NewVersion" xml:space="preserve"><value>Nueva versión:</value></data>
|
||||
|
||||
<!-- About -->
|
||||
<data name="About_Title" xml:space="preserve"><value>Acerca de CaptureImage</value></data>
|
||||
<data name="About_Tagline" xml:space="preserve"><value>Captura de pantalla ligera para Windows pensada para juegos sin tecla de captura propia.</value></data>
|
||||
<data name="About_AppLabel" xml:space="preserve"><value>Aplicación</value></data>
|
||||
<data name="About_VersionLabel" xml:space="preserve"><value>Versión</value></data>
|
||||
<data name="About_LicenseLabel" xml:space="preserve"><value>Licencia</value></data>
|
||||
<data name="About_DeveloperLabel" xml:space="preserve"><value>Desarrollador</value></data>
|
||||
<data name="About_RepositoryLabel" xml:space="preserve"><value>Repositorio</value></data>
|
||||
<data name="About_AiSection" xml:space="preserve"><value>Desarrollo asistido por IA</value></data>
|
||||
<data name="About_DisclaimersSection" xml:space="preserve"><value>Avisos legales</value></data>
|
||||
<data name="About_TranslationDisclaimer" xml:space="preserve"><value>Traducciones</value></data>
|
||||
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>Los paquetes de idioma vietnamita, árabe, japonés, chino simplificado, coreano, español, francés, alemán, portugués (Brasil) y ruso están traducidos con asistencia automática. Es posible que la terminología no coincida con las convenciones nativas, y algunos términos técnicos (hotkey, toast, frame, etc.) se mantienen en inglés a propósito. Los hablantes nativos dispuestos a revisarlos pueden enviar pull requests sobre los archivos .resx en src/CaptureImage.UI/Resources/Strings/.</value></data>
|
||||
<data name="About_CaptureDisclaimer" xml:space="preserve"><value>Compatibilidad de captura</value></data>
|
||||
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage puede capturar la mayoría de los juegos en ventana o sin bordes mediante Windows.Graphics.Capture, pero no todos los títulos funcionan. Las superficies protegidas por DRM, los juegos en pantalla completa exclusiva con Direct3D 9 y los títulos con ganchos anticheat pueden devolver fotogramas en negro o rechazar la captura. Para apps antiguas se intenta un fallback con GDI PrintWindow. Consulta la lista completa en docs/legal/DISCLAIMER.md §2.</value></data>
|
||||
<data name="About_LiabilityDisclaimer" xml:space="preserve"><value>Sin garantía</value></data>
|
||||
<data name="About_LiabilityDisclaimerBody" xml:space="preserve"><value>CaptureImage se distribuye bajo GPL-3.0-or-later TAL CUAL, sin garantía de ningún tipo. Los autores no son responsables de capturas perdidas, fallos del juego, sanciones de anticheat ni pérdida de datos. Úsalo bajo tu propia responsabilidad. Consulta el texto completo en docs/legal/DISCLAIMER.md.</value></data>
|
||||
<data name="About_LegalSection" xml:space="preserve"><value>Documentos legales</value></data>
|
||||
<data name="About_ThirdPartySection" xml:space="preserve"><value>Componentes de terceros</value></data>
|
||||
<data name="About_ThirdPartyHint" xml:space="preserve"><value>Pulsa "Avisos de terceros" arriba para ver la lista completa con las URLs originales.</value></data>
|
||||
<data name="About_OpenDisclaimer" xml:space="preserve"><value>Aviso legal</value></data>
|
||||
<data name="About_OpenPrivacy" xml:space="preserve"><value>Privacidad</value></data>
|
||||
<data name="About_OpenTerms" xml:space="preserve"><value>Términos</value></data>
|
||||
<data name="About_OpenLicense" xml:space="preserve"><value>Licencia (GPL-3.0)</value></data>
|
||||
<data name="About_OpenThirdParty" xml:space="preserve"><value>Avisos de terceros</value></data>
|
||||
<data name="About_OpenContributors" xml:space="preserve"><value>Colaboradores</value></data>
|
||||
|
||||
<!-- Log viewer -->
|
||||
<data name="Log_Title" xml:space="preserve"><value>Registro en tiempo real</value></data>
|
||||
<data name="Log_Pause" xml:space="preserve"><value>Pausar</value></data>
|
||||
<data name="Log_Resume" xml:space="preserve"><value>Reanudar</value></data>
|
||||
<data name="Log_Clear" xml:space="preserve"><value>Limpiar</value></data>
|
||||
<data name="Log_EventsCount" xml:space="preserve"><value>{0} eventos</value></data>
|
||||
<data name="Log_EmptyState" xml:space="preserve"><value>Aún no hay eventos. Los eventos en tiempo real del motor de captura aparecerán aquí.</value></data>
|
||||
<data name="Log_Filter" xml:space="preserve"><value>Nivel mínimo:</value></data>
|
||||
<data name="Log_RevealFolder" xml:space="preserve"><value>Abrir carpeta</value></data>
|
||||
|
||||
<!-- Preview -->
|
||||
<data name="Preview_Title" xml:space="preserve"><value>Vista previa</value></data>
|
||||
<data name="Preview_Prompt" xml:space="preserve"><value>¿Guardar esta captura?</value></data>
|
||||
<data name="Preview_Save" xml:space="preserve"><value>Guardar</value></data>
|
||||
<data name="Preview_Discard" xml:space="preserve"><value>Descartar</value></data>
|
||||
|
||||
<!-- Toasts -->
|
||||
<data name="Toast_CaptureSaved" xml:space="preserve"><value>Captura guardada</value></data>
|
||||
<data name="Toast_CaptureFailed" xml:space="preserve"><value>Captura fallida</value></data>
|
||||
<data name="Toast_SettingsImported" xml:space="preserve"><value>Configuración importada</value></data>
|
||||
<data name="Toast_SettingsExported" xml:space="preserve"><value>Configuración exportada</value></data>
|
||||
<data name="Toast_Error" xml:space="preserve"><value>Error</value></data>
|
||||
|
||||
<!-- Tray menu -->
|
||||
<data name="Tray_ShowWindow" xml:space="preserve"><value>Mostrar CaptureImage</value></data>
|
||||
<data name="Tray_OpenFolder" xml:space="preserve"><value>Abrir carpeta de capturas</value></data>
|
||||
<data name="Tray_Exit" xml:space="preserve"><value>Salir</value></data>
|
||||
|
||||
<!-- v1.5 quick wins -->
|
||||
<data name="Settings_Countdown" xml:space="preserve"><value>Cuenta atrás de captura</value></data>
|
||||
<data name="Settings_CountdownOff" xml:space="preserve"><value>Desactivada (sin retraso)</value></data>
|
||||
<data name="Settings_Countdown3s" xml:space="preserve"><value>3 segundos</value></data>
|
||||
<data name="Settings_Countdown5s" xml:space="preserve"><value>5 segundos</value></data>
|
||||
<data name="Settings_Countdown10s" xml:space="preserve"><value>10 segundos</value></data>
|
||||
<data name="Settings_Clipboard" xml:space="preserve"><value>Modo del portapapeles</value></data>
|
||||
<data name="Settings_ClipboardNone" xml:space="preserve"><value>Desactivado (solo archivo)</value></data>
|
||||
<data name="Settings_ClipboardCopy" xml:space="preserve"><value>Solo copiar (sin archivo)</value></data>
|
||||
<data name="Settings_ClipboardCopySave" xml:space="preserve"><value>Copiar + guardar archivo</value></data>
|
||||
<data name="Settings_OpenFolderAfterSave" xml:space="preserve"><value>Abrir carpeta de salida tras guardar</value></data>
|
||||
<data name="Toast_Countdown" xml:space="preserve"><value>Capturando en {0}…</value></data>
|
||||
<data name="Toast_ClipboardCopied" xml:space="preserve"><value>Copiado al portapapeles</value></data>
|
||||
|
||||
<!-- v1.5 pinned thumbnail -->
|
||||
<data name="Settings_AutoPinAfterCapture" xml:space="preserve"><value>Fijar una miniatura flotante tras cada captura</value></data>
|
||||
<data name="PinnedWindow_Open" xml:space="preserve"><value>Mostrar en el Explorador</value></data>
|
||||
<data name="PinnedWindow_Close" xml:space="preserve"><value>Cerrar</value></data>
|
||||
|
||||
<!-- v1.5 OCR -->
|
||||
<data name="Preview_ExtractText" xml:space="preserve"><value>Extraer texto (OCR)</value></data>
|
||||
<data name="Toast_OcrSuccess" xml:space="preserve"><value>{0} palabras copiadas</value></data>
|
||||
<data name="Toast_OcrEmpty" xml:space="preserve"><value>No se encontró texto en la imagen</value></data>
|
||||
<data name="Toast_OcrUnavailable" xml:space="preserve"><value>Motor OCR no disponible para este idioma</value></data>
|
||||
|
||||
<!-- v1.5 region capture -->
|
||||
<data name="Settings_CaptureMode" xml:space="preserve"><value>Modo de captura</value></data>
|
||||
<data name="Settings_CaptureModeWindow" xml:space="preserve"><value>Ventana única</value></data>
|
||||
<data name="Settings_CaptureModeRegion" xml:space="preserve"><value>Región (arrastrar para seleccionar)</value></data>
|
||||
<data name="Region_TargetName" xml:space="preserve"><value>Región</value></data>
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>Arrastra un rectángulo. Pulsa Esc para cancelar.</value></data>
|
||||
|
||||
</root>
|
||||
@@ -0,0 +1,196 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="xml:space" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
|
||||
<!-- Navigation -->
|
||||
<data name="Nav_Dashboard" xml:space="preserve"><value>Tableau de bord</value></data>
|
||||
<data name="Nav_Update" xml:space="preserve"><value>Mise à jour</value></data>
|
||||
<data name="Nav_Settings" xml:space="preserve"><value>Paramètres</value></data>
|
||||
<data name="Nav_About" xml:space="preserve"><value>À propos</value></data>
|
||||
<data name="Nav_LogViewer" xml:space="preserve"><value>Journal</value></data>
|
||||
|
||||
<!-- Dashboard -->
|
||||
<data name="Dashboard_Title" xml:space="preserve"><value>Tableau de bord</value></data>
|
||||
<data name="Dashboard_Subtitle" xml:space="preserve"><value>Choisissez une cible et armez-la — appuyez sur le raccourci pour capturer.</value></data>
|
||||
<data name="Dashboard_Refresh" xml:space="preserve"><value>Actualiser</value></data>
|
||||
<data name="Dashboard_Arm" xml:space="preserve"><value>Armer</value></data>
|
||||
<data name="Dashboard_Disarm" xml:space="preserve"><value>Désarmer</value></data>
|
||||
<data name="Dashboard_StatusIdle" xml:space="preserve"><value>Inactif — choisissez une cible et armez-la pour commencer.</value></data>
|
||||
<data name="Dashboard_StatusArmed" xml:space="preserve"><value>Armé : appuyez sur {0} pour capturer {1}.</value></data>
|
||||
<data name="Dashboard_StatusCapturing" xml:space="preserve"><value>Capture de {0}…</value></data>
|
||||
<data name="Dashboard_StatusDisarmed" xml:space="preserve"><value>Désarmé.</value></data>
|
||||
<data name="Dashboard_StatusSaved" xml:space="preserve"><value>Enregistré : {0} ({1}x{2}, {3} ms)</value></data>
|
||||
<data name="Dashboard_StatusFailed" xml:space="preserve"><value>Échec de la capture ({0}) : {1}</value></data>
|
||||
<data name="Dashboard_TargetsCount" xml:space="preserve"><value>{0} cible(s) visible(s)</value></data>
|
||||
<data name="Dashboard_Loading" xml:space="preserve"><value>Chargement…</value></data>
|
||||
<data name="Dashboard_EmptyState" xml:space="preserve"><value>Aucune fenêtre visible à capturer — lancez votre jeu ou application puis cliquez sur Actualiser.</value></data>
|
||||
<data name="Dashboard_LogToggle" xml:space="preserve"><value>Afficher/masquer le tiroir de journal en temps réel</value></data>
|
||||
<data name="Dashboard_SteamBadge" xml:space="preserve"><value>STEAM</value></data>
|
||||
<data name="Dashboard_SteamBadgeTooltip" xml:space="preserve"><value>Jeu Steam : {0} (AppId {1}). Les captures F12 sont disponibles via la superposition Steam. Certains jeux protégés par anti-triche peuvent bloquer la capture externe.</value></data>
|
||||
|
||||
<!-- Settings -->
|
||||
<data name="Settings_Title" xml:space="preserve"><value>Paramètres</value></data>
|
||||
<data name="Settings_Language" xml:space="preserve"><value>Langue</value></data>
|
||||
<data name="Settings_Theme" xml:space="preserve"><value>Thème</value></data>
|
||||
<data name="Settings_Theme_System" xml:space="preserve"><value>Système</value></data>
|
||||
<data name="Settings_Theme_Light" xml:space="preserve"><value>Clair</value></data>
|
||||
<data name="Settings_Theme_Dark" xml:space="preserve"><value>Sombre</value></data>
|
||||
<data name="Settings_Hotkey" xml:space="preserve"><value>Raccourci de capture</value></data>
|
||||
<data name="Settings_HotkeyHint" xml:space="preserve"><value>Cliquez sur Enregistrer puis appuyez sur une combinaison. Échap annule. Réinitialiser restaure Ctrl+Maj+F12.</value></data>
|
||||
<data name="Settings_HotkeyRecord" xml:space="preserve"><value>Enregistrer…</value></data>
|
||||
<data name="Settings_HotkeyCancel" xml:space="preserve"><value>Annuler</value></data>
|
||||
<data name="Settings_HotkeyReset" xml:space="preserve"><value>Réinitialiser</value></data>
|
||||
<data name="Settings_HotkeyRecorderPrompt" xml:space="preserve"><value>Appuyez sur une combinaison de touches (Échap pour annuler)…</value></data>
|
||||
<data name="Settings_HotkeyErrorNoPrimary" xml:space="preserve"><value>Choisissez une touche principale (par exemple une lettre ou une touche F).</value></data>
|
||||
<data name="Settings_HotkeyErrorModifierOnly" xml:space="preserve"><value>Une touche modificatrice seule ne suffit pas — ajoutez une lettre ou une touche F.</value></data>
|
||||
<data name="Settings_HotkeyErrorNeedsModifier" xml:space="preserve"><value>Les lettres et chiffres simples nécessitent au moins un modificateur (Ctrl/Alt/Maj/Win).</value></data>
|
||||
<data name="Settings_HotkeyErrorReserved" xml:space="preserve"><value>Cette combinaison est réservée par Windows et ne peut pas être capturée.</value></data>
|
||||
<data name="Settings_HotkeyConflictWarning" xml:space="preserve"><value>Une autre application possède peut-être déjà cette combinaison — elle pourrait ne pas se déclencher tant que cette application est en cours d'exécution.</value></data>
|
||||
<data name="Settings_Format" xml:space="preserve"><value>Format par défaut</value></data>
|
||||
<data name="Settings_JpegQuality" xml:space="preserve"><value>Qualité JPEG</value></data>
|
||||
<data name="Settings_WebpQuality" xml:space="preserve"><value>Qualité WebP</value></data>
|
||||
<data name="Settings_OutputFolder" xml:space="preserve"><value>Dossier de sortie</value></data>
|
||||
<data name="Settings_OutputFolderDefault" xml:space="preserve"><value>(par défaut : Images\CaptureImage)</value></data>
|
||||
<data name="Settings_Browse" xml:space="preserve"><value>Parcourir…</value></data>
|
||||
<data name="Settings_BrowseTitle" xml:space="preserve"><value>Choisir le dossier de sortie</value></data>
|
||||
<data name="Settings_BrowseTooltip" xml:space="preserve"><value>Choisissez un dossier au lieu de saisir le chemin.</value></data>
|
||||
<data name="Settings_FileNameTemplate" xml:space="preserve"><value>Modèle de nom de fichier</value></data>
|
||||
<data name="Settings_PreviewBeforeSave" xml:space="preserve"><value>Aperçu de chaque capture avant l'enregistrement</value></data>
|
||||
<data name="Settings_AutoSwitchOnAltTab" xml:space="preserve"><value>Changer automatiquement de cible avec Alt-Tab</value></data>
|
||||
<data name="Settings_AutoSwitchOnAltTabHint" xml:space="preserve"><value>La cible sélectionnée suit la fenêtre au premier plan. Les applications hors liste conservent votre sélection actuelle.</value></data>
|
||||
<data name="Settings_MinimizeToTray" xml:space="preserve"><value>Le bouton Fermer minimise dans la barre d'état</value></data>
|
||||
<data name="Settings_SoundEnabled" xml:space="preserve"><value>Lire un son lors de la capture</value></data>
|
||||
<data name="Settings_Import" xml:space="preserve"><value>Importer…</value></data>
|
||||
<data name="Settings_Export" xml:space="preserve"><value>Exporter…</value></data>
|
||||
<data name="Settings_ImportTitle" xml:space="preserve"><value>Importer les paramètres</value></data>
|
||||
<data name="Settings_ExportTitle" xml:space="preserve"><value>Exporter les paramètres</value></data>
|
||||
<data name="Settings_OpenFile" xml:space="preserve"><value>Ouvrir le fichier de paramètres</value></data>
|
||||
<data name="Settings_Logging" xml:space="preserve"><value>Journalisation</value></data>
|
||||
<data name="Settings_LogLevel" xml:space="preserve"><value>Niveau de journal minimal</value></data>
|
||||
<data name="Settings_LogLevelHint" xml:space="preserve"><value>Filtre le fichier journal et la visionneuse. Choisissez Debug pour le diagnostic, Information pour l'usage quotidien, Warning ou Error pour réduire le bruit.</value></data>
|
||||
|
||||
<!-- Update -->
|
||||
<data name="Update_Title" xml:space="preserve"><value>Mise à jour</value></data>
|
||||
<data name="Update_Check" xml:space="preserve"><value>Rechercher des mises à jour</value></data>
|
||||
<data name="Update_Download" xml:space="preserve"><value>Télécharger</value></data>
|
||||
<data name="Update_Install" xml:space="preserve"><value>Installer et redémarrer</value></data>
|
||||
<data name="Update_Status" xml:space="preserve"><value>État</value></data>
|
||||
<data name="Update_Log" xml:space="preserve"><value>Journal</value></data>
|
||||
<data name="Update_NewVersion" xml:space="preserve"><value>Nouvelle version :</value></data>
|
||||
|
||||
<!-- About -->
|
||||
<data name="About_Title" xml:space="preserve"><value>À propos de CaptureImage</value></data>
|
||||
<data name="About_Tagline" xml:space="preserve"><value>Capture d'écran Windows légère pour les jeux sans touche de capture intégrée.</value></data>
|
||||
<data name="About_AppLabel" xml:space="preserve"><value>Application</value></data>
|
||||
<data name="About_VersionLabel" xml:space="preserve"><value>Version</value></data>
|
||||
<data name="About_LicenseLabel" xml:space="preserve"><value>Licence</value></data>
|
||||
<data name="About_DeveloperLabel" xml:space="preserve"><value>Développeur</value></data>
|
||||
<data name="About_RepositoryLabel" xml:space="preserve"><value>Dépôt</value></data>
|
||||
<data name="About_AiSection" xml:space="preserve"><value>Développement assisté par IA</value></data>
|
||||
<data name="About_DisclaimersSection" xml:space="preserve"><value>Avertissements</value></data>
|
||||
<data name="About_TranslationDisclaimer" xml:space="preserve"><value>Traductions</value></data>
|
||||
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>Les packs de langue vietnamien, arabe, japonais, chinois simplifié, coréen, espagnol, français, allemand, portugais (Brésil) et russe sont assistés par machine. La terminologie peut ne pas correspondre aux conventions natives, et certains termes techniques (hotkey, toast, frame, etc.) sont volontairement conservés en anglais. Les locuteurs natifs prêts à relire sont chaleureusement invités à soumettre des pull requests sur les fichiers .resx dans src/CaptureImage.UI/Resources/Strings/.</value></data>
|
||||
<data name="About_CaptureDisclaimer" xml:space="preserve"><value>Prise en charge de la capture</value></data>
|
||||
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage peut capturer la plupart des jeux fenêtrés et sans bordure via Windows.Graphics.Capture, mais pas tous. Les surfaces protégées par DRM, les jeux Direct3D 9 en plein écran exclusif et les titres avec hooks anti-triche peuvent renvoyer des images noires ou refuser la capture. Un repli GDI PrintWindow est tenté pour les applications héritées. Voir docs/legal/DISCLAIMER.md §2 pour la liste complète.</value></data>
|
||||
<data name="About_LiabilityDisclaimer" xml:space="preserve"><value>Aucune garantie</value></data>
|
||||
<data name="About_LiabilityDisclaimerBody" xml:space="preserve"><value>CaptureImage est distribué sous GPL-3.0-or-later EN L'ÉTAT, sans aucune garantie. Les auteurs ne sont pas responsables des captures perdues, des plantages de jeu, des sanctions anti-triche ou des pertes de données. Utilisation à vos propres risques. Voir docs/legal/DISCLAIMER.md pour le texte complet.</value></data>
|
||||
<data name="About_LegalSection" xml:space="preserve"><value>Documents juridiques</value></data>
|
||||
<data name="About_ThirdPartySection" xml:space="preserve"><value>Composants tiers</value></data>
|
||||
<data name="About_ThirdPartyHint" xml:space="preserve"><value>Cliquez sur « Avis tiers » ci-dessus pour la liste complète avec les URL en amont.</value></data>
|
||||
<data name="About_OpenDisclaimer" xml:space="preserve"><value>Avertissement</value></data>
|
||||
<data name="About_OpenPrivacy" xml:space="preserve"><value>Confidentialité</value></data>
|
||||
<data name="About_OpenTerms" xml:space="preserve"><value>Conditions</value></data>
|
||||
<data name="About_OpenLicense" xml:space="preserve"><value>Licence (GPL-3.0)</value></data>
|
||||
<data name="About_OpenThirdParty" xml:space="preserve"><value>Avis tiers</value></data>
|
||||
<data name="About_OpenContributors" xml:space="preserve"><value>Contributeurs</value></data>
|
||||
|
||||
<!-- Log viewer -->
|
||||
<data name="Log_Title" xml:space="preserve"><value>Journal en temps réel</value></data>
|
||||
<data name="Log_Pause" xml:space="preserve"><value>Pause</value></data>
|
||||
<data name="Log_Resume" xml:space="preserve"><value>Reprendre</value></data>
|
||||
<data name="Log_Clear" xml:space="preserve"><value>Effacer</value></data>
|
||||
<data name="Log_EventsCount" xml:space="preserve"><value>{0} événements</value></data>
|
||||
<data name="Log_EmptyState" xml:space="preserve"><value>Aucun événement de journal pour le moment. Les événements en direct du moteur de capture apparaîtront ici.</value></data>
|
||||
<data name="Log_Filter" xml:space="preserve"><value>Niveau min :</value></data>
|
||||
<data name="Log_RevealFolder" xml:space="preserve"><value>Ouvrir le dossier</value></data>
|
||||
|
||||
<!-- Preview -->
|
||||
<data name="Preview_Title" xml:space="preserve"><value>Aperçu</value></data>
|
||||
<data name="Preview_Prompt" xml:space="preserve"><value>Enregistrer cette capture ?</value></data>
|
||||
<data name="Preview_Save" xml:space="preserve"><value>Enregistrer</value></data>
|
||||
<data name="Preview_Discard" xml:space="preserve"><value>Ignorer</value></data>
|
||||
|
||||
<!-- Toasts -->
|
||||
<data name="Toast_CaptureSaved" xml:space="preserve"><value>Capture enregistrée</value></data>
|
||||
<data name="Toast_CaptureFailed" xml:space="preserve"><value>Échec de la capture</value></data>
|
||||
<data name="Toast_SettingsImported" xml:space="preserve"><value>Paramètres importés</value></data>
|
||||
<data name="Toast_SettingsExported" xml:space="preserve"><value>Paramètres exportés</value></data>
|
||||
<data name="Toast_Error" xml:space="preserve"><value>Erreur</value></data>
|
||||
|
||||
<!-- Tray menu -->
|
||||
<data name="Tray_ShowWindow" xml:space="preserve"><value>Afficher CaptureImage</value></data>
|
||||
<data name="Tray_OpenFolder" xml:space="preserve"><value>Ouvrir le dossier des captures</value></data>
|
||||
<data name="Tray_Exit" xml:space="preserve"><value>Quitter</value></data>
|
||||
|
||||
<!-- v1.5 quick wins -->
|
||||
<data name="Settings_Countdown" xml:space="preserve"><value>Compte à rebours de capture</value></data>
|
||||
<data name="Settings_CountdownOff" xml:space="preserve"><value>Désactivé (pas de délai)</value></data>
|
||||
<data name="Settings_Countdown3s" xml:space="preserve"><value>3 secondes</value></data>
|
||||
<data name="Settings_Countdown5s" xml:space="preserve"><value>5 secondes</value></data>
|
||||
<data name="Settings_Countdown10s" xml:space="preserve"><value>10 secondes</value></data>
|
||||
<data name="Settings_Clipboard" xml:space="preserve"><value>Mode presse-papiers</value></data>
|
||||
<data name="Settings_ClipboardNone" xml:space="preserve"><value>Désactivé (fichier uniquement)</value></data>
|
||||
<data name="Settings_ClipboardCopy" xml:space="preserve"><value>Copier uniquement (pas de fichier)</value></data>
|
||||
<data name="Settings_ClipboardCopySave" xml:space="preserve"><value>Copier + enregistrer le fichier</value></data>
|
||||
<data name="Settings_OpenFolderAfterSave" xml:space="preserve"><value>Ouvrir le dossier de sortie après l'enregistrement</value></data>
|
||||
<data name="Toast_Countdown" xml:space="preserve"><value>Capture dans {0}…</value></data>
|
||||
<data name="Toast_ClipboardCopied" xml:space="preserve"><value>Copié dans le presse-papiers</value></data>
|
||||
|
||||
<!-- v1.5 pinned thumbnail -->
|
||||
<data name="Settings_AutoPinAfterCapture" xml:space="preserve"><value>Épingler une miniature flottante après chaque capture</value></data>
|
||||
<data name="PinnedWindow_Open" xml:space="preserve"><value>Afficher dans l'Explorateur</value></data>
|
||||
<data name="PinnedWindow_Close" xml:space="preserve"><value>Fermer</value></data>
|
||||
|
||||
<!-- v1.5 OCR -->
|
||||
<data name="Preview_ExtractText" xml:space="preserve"><value>Extraire le texte (OCR)</value></data>
|
||||
<data name="Toast_OcrSuccess" xml:space="preserve"><value>{0} mots copiés</value></data>
|
||||
<data name="Toast_OcrEmpty" xml:space="preserve"><value>Aucun texte trouvé dans l'image</value></data>
|
||||
<data name="Toast_OcrUnavailable" xml:space="preserve"><value>Moteur OCR indisponible pour cette langue</value></data>
|
||||
|
||||
<!-- v1.5 region capture -->
|
||||
<data name="Settings_CaptureMode" xml:space="preserve"><value>Mode de capture</value></data>
|
||||
<data name="Settings_CaptureModeWindow" xml:space="preserve"><value>Fenêtre unique</value></data>
|
||||
<data name="Settings_CaptureModeRegion" xml:space="preserve"><value>Zone (glisser pour sélectionner)</value></data>
|
||||
<data name="Region_TargetName" xml:space="preserve"><value>Zone</value></data>
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>Glissez un rectangle. Appuyez sur Échap pour annuler.</value></data>
|
||||
|
||||
</root>
|
||||
@@ -0,0 +1,196 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="xml:space" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
|
||||
<!-- Navigation -->
|
||||
<data name="Nav_Dashboard" xml:space="preserve"><value>ダッシュボード</value></data>
|
||||
<data name="Nav_Update" xml:space="preserve"><value>アップデート</value></data>
|
||||
<data name="Nav_Settings" xml:space="preserve"><value>設定</value></data>
|
||||
<data name="Nav_About" xml:space="preserve"><value>情報</value></data>
|
||||
<data name="Nav_LogViewer" xml:space="preserve"><value>ログ</value></data>
|
||||
|
||||
<!-- Dashboard -->
|
||||
<data name="Dashboard_Title" xml:space="preserve"><value>ダッシュボード</value></data>
|
||||
<data name="Dashboard_Subtitle" xml:space="preserve"><value>対象を選択して起動 — ホットキーでキャプチャします。</value></data>
|
||||
<data name="Dashboard_Refresh" xml:space="preserve"><value>更新</value></data>
|
||||
<data name="Dashboard_Arm" xml:space="preserve"><value>起動</value></data>
|
||||
<data name="Dashboard_Disarm" xml:space="preserve"><value>停止</value></data>
|
||||
<data name="Dashboard_StatusIdle" xml:space="preserve"><value>待機中 — 対象を選択して起動してください。</value></data>
|
||||
<data name="Dashboard_StatusArmed" xml:space="preserve"><value>起動中: {0} を押すと {1} をキャプチャします。</value></data>
|
||||
<data name="Dashboard_StatusCapturing" xml:space="preserve"><value>{0} をキャプチャ中…</value></data>
|
||||
<data name="Dashboard_StatusDisarmed" xml:space="preserve"><value>停止しました。</value></data>
|
||||
<data name="Dashboard_StatusSaved" xml:space="preserve"><value>保存: {0} ({1}x{2}, {3} ms)</value></data>
|
||||
<data name="Dashboard_StatusFailed" xml:space="preserve"><value>キャプチャ失敗 ({0}): {1}</value></data>
|
||||
<data name="Dashboard_TargetsCount" xml:space="preserve"><value>{0} 件の対象が表示されています</value></data>
|
||||
<data name="Dashboard_Loading" xml:space="preserve"><value>読み込み中…</value></data>
|
||||
<data name="Dashboard_EmptyState" xml:space="preserve"><value>キャプチャ可能なウィンドウがありません — ゲームやアプリを起動してから「更新」をクリックしてください。</value></data>
|
||||
<data name="Dashboard_LogToggle" xml:space="preserve"><value>リアルタイムログを開閉</value></data>
|
||||
<data name="Dashboard_SteamBadge" xml:space="preserve"><value>STEAM</value></data>
|
||||
<data name="Dashboard_SteamBadgeTooltip" xml:space="preserve"><value>Steam ゲーム: {0} (AppId {1})。F12 のスクリーンショットは Steam オーバーレイで利用できます。アンチチート保護されたゲームでは外部キャプチャがブロックされる場合があります。</value></data>
|
||||
|
||||
<!-- Settings -->
|
||||
<data name="Settings_Title" xml:space="preserve"><value>設定</value></data>
|
||||
<data name="Settings_Language" xml:space="preserve"><value>言語</value></data>
|
||||
<data name="Settings_Theme" xml:space="preserve"><value>テーマ</value></data>
|
||||
<data name="Settings_Theme_System" xml:space="preserve"><value>システム</value></data>
|
||||
<data name="Settings_Theme_Light" xml:space="preserve"><value>ライト</value></data>
|
||||
<data name="Settings_Theme_Dark" xml:space="preserve"><value>ダーク</value></data>
|
||||
<data name="Settings_Hotkey" xml:space="preserve"><value>キャプチャ用ホットキー</value></data>
|
||||
<data name="Settings_HotkeyHint" xml:space="preserve"><value>「録音」をクリックしてキーの組み合わせを押します。Esc でキャンセル。「リセット」で Ctrl+Shift+F12 に戻します。</value></data>
|
||||
<data name="Settings_HotkeyRecord" xml:space="preserve"><value>録音…</value></data>
|
||||
<data name="Settings_HotkeyCancel" xml:space="preserve"><value>キャンセル</value></data>
|
||||
<data name="Settings_HotkeyReset" xml:space="preserve"><value>リセット</value></data>
|
||||
<data name="Settings_HotkeyRecorderPrompt" xml:space="preserve"><value>キーの組み合わせを押してください (Esc でキャンセル)…</value></data>
|
||||
<data name="Settings_HotkeyErrorNoPrimary" xml:space="preserve"><value>主キーを選択してください (例: 文字キーまたは F キー)。</value></data>
|
||||
<data name="Settings_HotkeyErrorModifierOnly" xml:space="preserve"><value>修飾キーだけでは登録できません — 文字キーまたは F キーを追加してください。</value></data>
|
||||
<data name="Settings_HotkeyErrorNeedsModifier" xml:space="preserve"><value>文字や数字には少なくとも 1 つの修飾キー (Ctrl/Alt/Shift/Win) が必要です。</value></data>
|
||||
<data name="Settings_HotkeyErrorReserved" xml:space="preserve"><value>この組み合わせは Windows により予約されており、使用できません。</value></data>
|
||||
<data name="Settings_HotkeyConflictWarning" xml:space="preserve"><value>他のアプリがこの組み合わせを使用中の可能性があります — そのアプリの実行中は反応しないことがあります。</value></data>
|
||||
<data name="Settings_Format" xml:space="preserve"><value>既定のフォーマット</value></data>
|
||||
<data name="Settings_JpegQuality" xml:space="preserve"><value>JPEG 品質</value></data>
|
||||
<data name="Settings_WebpQuality" xml:space="preserve"><value>WebP 品質</value></data>
|
||||
<data name="Settings_OutputFolder" xml:space="preserve"><value>出力フォルダー</value></data>
|
||||
<data name="Settings_OutputFolderDefault" xml:space="preserve"><value>(既定: Pictures\CaptureImage)</value></data>
|
||||
<data name="Settings_Browse" xml:space="preserve"><value>参照…</value></data>
|
||||
<data name="Settings_BrowseTitle" xml:space="preserve"><value>出力フォルダーを選択</value></data>
|
||||
<data name="Settings_BrowseTooltip" xml:space="preserve"><value>パスを入力する代わりにフォルダーを選択します。</value></data>
|
||||
<data name="Settings_FileNameTemplate" xml:space="preserve"><value>ファイル名テンプレート</value></data>
|
||||
<data name="Settings_PreviewBeforeSave" xml:space="preserve"><value>保存前に各キャプチャをプレビュー</value></data>
|
||||
<data name="Settings_AutoSwitchOnAltTab" xml:space="preserve"><value>Alt-Tab で対象を自動切り替え</value></data>
|
||||
<data name="Settings_AutoSwitchOnAltTabHint" xml:space="preserve"><value>選択中の対象がフォアグラウンドウィンドウに追従します。対象一覧にないアプリでは現在の選択を維持します。</value></data>
|
||||
<data name="Settings_MinimizeToTray" xml:space="preserve"><value>閉じるボタンでトレイに最小化</value></data>
|
||||
<data name="Settings_SoundEnabled" xml:space="preserve"><value>キャプチャ音を再生</value></data>
|
||||
<data name="Settings_Import" xml:space="preserve"><value>インポート…</value></data>
|
||||
<data name="Settings_Export" xml:space="preserve"><value>エクスポート…</value></data>
|
||||
<data name="Settings_ImportTitle" xml:space="preserve"><value>設定をインポート</value></data>
|
||||
<data name="Settings_ExportTitle" xml:space="preserve"><value>設定をエクスポート</value></data>
|
||||
<data name="Settings_OpenFile" xml:space="preserve"><value>設定ファイルを開く</value></data>
|
||||
<data name="Settings_Logging" xml:space="preserve"><value>ログ</value></data>
|
||||
<data name="Settings_LogLevel" xml:space="preserve"><value>最小ログレベル</value></data>
|
||||
<data name="Settings_LogLevelHint" xml:space="preserve"><value>ローリングログファイルとビューアをフィルタします。サポート診断には Debug、日常使用には Information、Warning または Error を選ぶと出力を抑えられます。</value></data>
|
||||
|
||||
<!-- Update -->
|
||||
<data name="Update_Title" xml:space="preserve"><value>アップデート</value></data>
|
||||
<data name="Update_Check" xml:space="preserve"><value>更新を確認</value></data>
|
||||
<data name="Update_Download" xml:space="preserve"><value>ダウンロード</value></data>
|
||||
<data name="Update_Install" xml:space="preserve"><value>インストールして再起動</value></data>
|
||||
<data name="Update_Status" xml:space="preserve"><value>状態</value></data>
|
||||
<data name="Update_Log" xml:space="preserve"><value>ログ</value></data>
|
||||
<data name="Update_NewVersion" xml:space="preserve"><value>新しいバージョン:</value></data>
|
||||
|
||||
<!-- About -->
|
||||
<data name="About_Title" xml:space="preserve"><value>CaptureImage について</value></data>
|
||||
<data name="About_Tagline" xml:space="preserve"><value>スクリーンショット機能のないゲーム向けの軽量 Windows 画面キャプチャツール。</value></data>
|
||||
<data name="About_AppLabel" xml:space="preserve"><value>アプリ</value></data>
|
||||
<data name="About_VersionLabel" xml:space="preserve"><value>バージョン</value></data>
|
||||
<data name="About_LicenseLabel" xml:space="preserve"><value>ライセンス</value></data>
|
||||
<data name="About_DeveloperLabel" xml:space="preserve"><value>開発者</value></data>
|
||||
<data name="About_RepositoryLabel" xml:space="preserve"><value>リポジトリ</value></data>
|
||||
<data name="About_AiSection" xml:space="preserve"><value>AI 支援開発</value></data>
|
||||
<data name="About_DisclaimersSection" xml:space="preserve"><value>免責事項</value></data>
|
||||
<data name="About_TranslationDisclaimer" xml:space="preserve"><value>翻訳について</value></data>
|
||||
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>ベトナム語、アラビア語、日本語、中国語(簡体)、韓国語、スペイン語、フランス語、ドイツ語、ポルトガル語(ブラジル)、ロシア語の言語パックは機械支援で翻訳されています。用語が母語の慣習と一致しない場合があり、一部の技術用語(hotkey、toast、frame など)はあえて英語のままにしています。校正に協力してくださるネイティブスピーカーの方は、src/CaptureImage.UI/Resources/Strings/ の .resx ファイルへの Pull Request を歓迎します。</value></data>
|
||||
<data name="About_CaptureDisclaimer" xml:space="preserve"><value>キャプチャ対応</value></data>
|
||||
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage は Windows.Graphics.Capture により多くのウィンドウ・ボーダーレスゲームをキャプチャできますが、すべてのタイトルで動作するわけではありません。DRM 保護されたサーフェス、排他的フルスクリーンの Direct3D 9 ゲーム、アンチチートフックを持つタイトルは、黒フレームを返したりキャプチャを拒否することがあります。レガシーアプリには GDI PrintWindow フォールバックを試みます。完全な一覧は docs/legal/DISCLAIMER.md §2 を参照してください。</value></data>
|
||||
<data name="About_LiabilityDisclaimer" xml:space="preserve"><value>無保証</value></data>
|
||||
<data name="About_LiabilityDisclaimerBody" xml:space="preserve"><value>CaptureImage は GPL-3.0-or-later の下で「現状のまま」配布され、いかなる種類の保証もありません。作者はスクリーンショットの紛失、ゲームクラッシュ、アンチチート制裁、データ損失について責任を負いません。自己責任でご使用ください。完全な文章は docs/legal/DISCLAIMER.md を参照してください。</value></data>
|
||||
<data name="About_LegalSection" xml:space="preserve"><value>法的文書</value></data>
|
||||
<data name="About_ThirdPartySection" xml:space="preserve"><value>サードパーティコンポーネント</value></data>
|
||||
<data name="About_ThirdPartyHint" xml:space="preserve"><value>上記の「サードパーティ通知」をクリックすると、上流 URL を含む完全な一覧が表示されます。</value></data>
|
||||
<data name="About_OpenDisclaimer" xml:space="preserve"><value>免責事項</value></data>
|
||||
<data name="About_OpenPrivacy" xml:space="preserve"><value>プライバシー</value></data>
|
||||
<data name="About_OpenTerms" xml:space="preserve"><value>利用規約</value></data>
|
||||
<data name="About_OpenLicense" xml:space="preserve"><value>ライセンス (GPL-3.0)</value></data>
|
||||
<data name="About_OpenThirdParty" xml:space="preserve"><value>サードパーティ通知</value></data>
|
||||
<data name="About_OpenContributors" xml:space="preserve"><value>貢献者</value></data>
|
||||
|
||||
<!-- Log viewer -->
|
||||
<data name="Log_Title" xml:space="preserve"><value>リアルタイムログ</value></data>
|
||||
<data name="Log_Pause" xml:space="preserve"><value>一時停止</value></data>
|
||||
<data name="Log_Resume" xml:space="preserve"><value>再開</value></data>
|
||||
<data name="Log_Clear" xml:space="preserve"><value>クリア</value></data>
|
||||
<data name="Log_EventsCount" xml:space="preserve"><value>{0} 件のイベント</value></data>
|
||||
<data name="Log_EmptyState" xml:space="preserve"><value>まだログイベントがありません。キャプチャエンジンからのリアルタイムイベントがここに表示されます。</value></data>
|
||||
<data name="Log_Filter" xml:space="preserve"><value>最小レベル:</value></data>
|
||||
<data name="Log_RevealFolder" xml:space="preserve"><value>フォルダーを開く</value></data>
|
||||
|
||||
<!-- Preview -->
|
||||
<data name="Preview_Title" xml:space="preserve"><value>プレビュー</value></data>
|
||||
<data name="Preview_Prompt" xml:space="preserve"><value>このキャプチャを保存しますか?</value></data>
|
||||
<data name="Preview_Save" xml:space="preserve"><value>保存</value></data>
|
||||
<data name="Preview_Discard" xml:space="preserve"><value>破棄</value></data>
|
||||
|
||||
<!-- Toasts -->
|
||||
<data name="Toast_CaptureSaved" xml:space="preserve"><value>キャプチャを保存しました</value></data>
|
||||
<data name="Toast_CaptureFailed" xml:space="preserve"><value>キャプチャ失敗</value></data>
|
||||
<data name="Toast_SettingsImported" xml:space="preserve"><value>設定をインポートしました</value></data>
|
||||
<data name="Toast_SettingsExported" xml:space="preserve"><value>設定をエクスポートしました</value></data>
|
||||
<data name="Toast_Error" xml:space="preserve"><value>エラー</value></data>
|
||||
|
||||
<!-- Tray menu -->
|
||||
<data name="Tray_ShowWindow" xml:space="preserve"><value>CaptureImage を表示</value></data>
|
||||
<data name="Tray_OpenFolder" xml:space="preserve"><value>キャプチャフォルダーを開く</value></data>
|
||||
<data name="Tray_Exit" xml:space="preserve"><value>終了</value></data>
|
||||
|
||||
<!-- v1.5 quick wins -->
|
||||
<data name="Settings_Countdown" xml:space="preserve"><value>キャプチャのカウントダウン</value></data>
|
||||
<data name="Settings_CountdownOff" xml:space="preserve"><value>オフ(遅延なし)</value></data>
|
||||
<data name="Settings_Countdown3s" xml:space="preserve"><value>3 秒</value></data>
|
||||
<data name="Settings_Countdown5s" xml:space="preserve"><value>5 秒</value></data>
|
||||
<data name="Settings_Countdown10s" xml:space="preserve"><value>10 秒</value></data>
|
||||
<data name="Settings_Clipboard" xml:space="preserve"><value>クリップボードモード</value></data>
|
||||
<data name="Settings_ClipboardNone" xml:space="preserve"><value>オフ(ファイルのみ)</value></data>
|
||||
<data name="Settings_ClipboardCopy" xml:space="preserve"><value>コピーのみ(ファイル無し)</value></data>
|
||||
<data name="Settings_ClipboardCopySave" xml:space="preserve"><value>コピー + ファイル保存</value></data>
|
||||
<data name="Settings_OpenFolderAfterSave" xml:space="preserve"><value>保存後に出力フォルダーを開く</value></data>
|
||||
<data name="Toast_Countdown" xml:space="preserve"><value>{0} 秒後にキャプチャ…</value></data>
|
||||
<data name="Toast_ClipboardCopied" xml:space="preserve"><value>クリップボードにコピーしました</value></data>
|
||||
|
||||
<!-- v1.5 pinned thumbnail -->
|
||||
<data name="Settings_AutoPinAfterCapture" xml:space="preserve"><value>キャプチャごとにフローティングサムネイルをピン留めする</value></data>
|
||||
<data name="PinnedWindow_Open" xml:space="preserve"><value>エクスプローラーで表示</value></data>
|
||||
<data name="PinnedWindow_Close" xml:space="preserve"><value>閉じる</value></data>
|
||||
|
||||
<!-- v1.5 OCR -->
|
||||
<data name="Preview_ExtractText" xml:space="preserve"><value>テキストを抽出 (OCR)</value></data>
|
||||
<data name="Toast_OcrSuccess" xml:space="preserve"><value>{0} 単語をコピーしました</value></data>
|
||||
<data name="Toast_OcrEmpty" xml:space="preserve"><value>画像内にテキストが見つかりません</value></data>
|
||||
<data name="Toast_OcrUnavailable" xml:space="preserve"><value>この言語の OCR エンジンが利用できません</value></data>
|
||||
|
||||
<!-- v1.5 region capture -->
|
||||
<data name="Settings_CaptureMode" xml:space="preserve"><value>キャプチャモード</value></data>
|
||||
<data name="Settings_CaptureModeWindow" xml:space="preserve"><value>ウィンドウ単体</value></data>
|
||||
<data name="Settings_CaptureModeRegion" xml:space="preserve"><value>範囲(ドラッグで選択)</value></data>
|
||||
<data name="Region_TargetName" xml:space="preserve"><value>範囲</value></data>
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>四角形をドラッグしてください。Esc でキャンセル。</value></data>
|
||||
|
||||
</root>
|
||||
@@ -0,0 +1,196 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="xml:space" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
|
||||
<!-- Navigation -->
|
||||
<data name="Nav_Dashboard" xml:space="preserve"><value>대시보드</value></data>
|
||||
<data name="Nav_Update" xml:space="preserve"><value>업데이트</value></data>
|
||||
<data name="Nav_Settings" xml:space="preserve"><value>설정</value></data>
|
||||
<data name="Nav_About" xml:space="preserve"><value>정보</value></data>
|
||||
<data name="Nav_LogViewer" xml:space="preserve"><value>로그</value></data>
|
||||
|
||||
<!-- Dashboard -->
|
||||
<data name="Dashboard_Title" xml:space="preserve"><value>대시보드</value></data>
|
||||
<data name="Dashboard_Subtitle" xml:space="preserve"><value>대상을 선택하고 활성화한 다음 단축키를 눌러 캡처하세요.</value></data>
|
||||
<data name="Dashboard_Refresh" xml:space="preserve"><value>새로 고침</value></data>
|
||||
<data name="Dashboard_Arm" xml:space="preserve"><value>활성화</value></data>
|
||||
<data name="Dashboard_Disarm" xml:space="preserve"><value>비활성화</value></data>
|
||||
<data name="Dashboard_StatusIdle" xml:space="preserve"><value>대기 중 — 대상을 선택하고 활성화하세요.</value></data>
|
||||
<data name="Dashboard_StatusArmed" xml:space="preserve"><value>활성화됨: {0} 키를 눌러 {1}을(를) 캡처합니다.</value></data>
|
||||
<data name="Dashboard_StatusCapturing" xml:space="preserve"><value>{0} 캡처 중…</value></data>
|
||||
<data name="Dashboard_StatusDisarmed" xml:space="preserve"><value>비활성화되었습니다.</value></data>
|
||||
<data name="Dashboard_StatusSaved" xml:space="preserve"><value>저장됨: {0} ({1}x{2}, {3} ms)</value></data>
|
||||
<data name="Dashboard_StatusFailed" xml:space="preserve"><value>캡처 실패 ({0}): {1}</value></data>
|
||||
<data name="Dashboard_TargetsCount" xml:space="preserve"><value>{0}개의 대상이 표시됨</value></data>
|
||||
<data name="Dashboard_Loading" xml:space="preserve"><value>불러오는 중…</value></data>
|
||||
<data name="Dashboard_EmptyState" xml:space="preserve"><value>캡처할 수 있는 창이 없습니다 — 게임이나 앱을 실행한 다음 새로 고침을 클릭하세요.</value></data>
|
||||
<data name="Dashboard_LogToggle" xml:space="preserve"><value>실시간 로그 패널 열기/닫기</value></data>
|
||||
<data name="Dashboard_SteamBadge" xml:space="preserve"><value>STEAM</value></data>
|
||||
<data name="Dashboard_SteamBadgeTooltip" xml:space="preserve"><value>Steam 게임: {0} (AppId {1}). F12 스크린샷은 Steam 오버레이를 통해 사용할 수 있습니다. 안티치트가 적용된 일부 게임은 외부 캡처를 차단할 수 있습니다.</value></data>
|
||||
|
||||
<!-- Settings -->
|
||||
<data name="Settings_Title" xml:space="preserve"><value>설정</value></data>
|
||||
<data name="Settings_Language" xml:space="preserve"><value>언어</value></data>
|
||||
<data name="Settings_Theme" xml:space="preserve"><value>테마</value></data>
|
||||
<data name="Settings_Theme_System" xml:space="preserve"><value>시스템</value></data>
|
||||
<data name="Settings_Theme_Light" xml:space="preserve"><value>라이트</value></data>
|
||||
<data name="Settings_Theme_Dark" xml:space="preserve"><value>다크</value></data>
|
||||
<data name="Settings_Hotkey" xml:space="preserve"><value>캡처 단축키</value></data>
|
||||
<data name="Settings_HotkeyHint" xml:space="preserve"><value>녹화를 클릭한 다음 키 조합을 누르세요. Esc로 취소합니다. 재설정은 Ctrl+Shift+F12로 되돌립니다.</value></data>
|
||||
<data name="Settings_HotkeyRecord" xml:space="preserve"><value>녹화…</value></data>
|
||||
<data name="Settings_HotkeyCancel" xml:space="preserve"><value>취소</value></data>
|
||||
<data name="Settings_HotkeyReset" xml:space="preserve"><value>재설정</value></data>
|
||||
<data name="Settings_HotkeyRecorderPrompt" xml:space="preserve"><value>키 조합을 누르세요 (Esc로 취소)…</value></data>
|
||||
<data name="Settings_HotkeyErrorNoPrimary" xml:space="preserve"><value>기본 키를 선택하세요 (예: 문자 또는 F 키).</value></data>
|
||||
<data name="Settings_HotkeyErrorModifierOnly" xml:space="preserve"><value>수정자 키만으로는 충분하지 않습니다 — 문자나 F 키를 추가하세요.</value></data>
|
||||
<data name="Settings_HotkeyErrorNeedsModifier" xml:space="preserve"><value>일반 문자와 숫자에는 최소 하나의 수정자 키(Ctrl/Alt/Shift/Win)가 필요합니다.</value></data>
|
||||
<data name="Settings_HotkeyErrorReserved" xml:space="preserve"><value>이 조합은 Windows에서 예약되어 있어 사용할 수 없습니다.</value></data>
|
||||
<data name="Settings_HotkeyConflictWarning" xml:space="preserve"><value>다른 응용 프로그램이 이 조합을 사용 중일 수 있습니다 — 해당 앱이 실행 중일 때는 작동하지 않을 수 있습니다.</value></data>
|
||||
<data name="Settings_Format" xml:space="preserve"><value>기본 형식</value></data>
|
||||
<data name="Settings_JpegQuality" xml:space="preserve"><value>JPEG 품질</value></data>
|
||||
<data name="Settings_WebpQuality" xml:space="preserve"><value>WebP 품질</value></data>
|
||||
<data name="Settings_OutputFolder" xml:space="preserve"><value>출력 폴더</value></data>
|
||||
<data name="Settings_OutputFolderDefault" xml:space="preserve"><value>(기본값: Pictures\CaptureImage)</value></data>
|
||||
<data name="Settings_Browse" xml:space="preserve"><value>찾아보기…</value></data>
|
||||
<data name="Settings_BrowseTitle" xml:space="preserve"><value>출력 폴더 선택</value></data>
|
||||
<data name="Settings_BrowseTooltip" xml:space="preserve"><value>경로를 입력하는 대신 폴더를 선택합니다.</value></data>
|
||||
<data name="Settings_FileNameTemplate" xml:space="preserve"><value>파일 이름 템플릿</value></data>
|
||||
<data name="Settings_PreviewBeforeSave" xml:space="preserve"><value>저장 전에 각 캡처 미리보기</value></data>
|
||||
<data name="Settings_AutoSwitchOnAltTab" xml:space="preserve"><value>Alt-Tab 시 대상 자동 전환</value></data>
|
||||
<data name="Settings_AutoSwitchOnAltTabHint" xml:space="preserve"><value>선택된 대상이 포그라운드 창을 따라갑니다. 대상 목록에 없는 앱은 현재 선택을 유지합니다.</value></data>
|
||||
<data name="Settings_MinimizeToTray" xml:space="preserve"><value>닫기 버튼으로 트레이로 최소화</value></data>
|
||||
<data name="Settings_SoundEnabled" xml:space="preserve"><value>캡처 사운드 재생</value></data>
|
||||
<data name="Settings_Import" xml:space="preserve"><value>가져오기…</value></data>
|
||||
<data name="Settings_Export" xml:space="preserve"><value>내보내기…</value></data>
|
||||
<data name="Settings_ImportTitle" xml:space="preserve"><value>설정 가져오기</value></data>
|
||||
<data name="Settings_ExportTitle" xml:space="preserve"><value>설정 내보내기</value></data>
|
||||
<data name="Settings_OpenFile" xml:space="preserve"><value>설정 파일 열기</value></data>
|
||||
<data name="Settings_Logging" xml:space="preserve"><value>로그</value></data>
|
||||
<data name="Settings_LogLevel" xml:space="preserve"><value>최소 로그 수준</value></data>
|
||||
<data name="Settings_LogLevelHint" xml:space="preserve"><value>롤링 로그 파일과 뷰어를 필터링합니다. 지원 진단에는 Debug, 일상 사용에는 Information, 출력을 줄이려면 Warning이나 Error를 선택하세요.</value></data>
|
||||
|
||||
<!-- Update -->
|
||||
<data name="Update_Title" xml:space="preserve"><value>업데이트</value></data>
|
||||
<data name="Update_Check" xml:space="preserve"><value>업데이트 확인</value></data>
|
||||
<data name="Update_Download" xml:space="preserve"><value>다운로드</value></data>
|
||||
<data name="Update_Install" xml:space="preserve"><value>설치 후 다시 시작</value></data>
|
||||
<data name="Update_Status" xml:space="preserve"><value>상태</value></data>
|
||||
<data name="Update_Log" xml:space="preserve"><value>로그</value></data>
|
||||
<data name="Update_NewVersion" xml:space="preserve"><value>새 버전:</value></data>
|
||||
|
||||
<!-- About -->
|
||||
<data name="About_Title" xml:space="preserve"><value>CaptureImage 정보</value></data>
|
||||
<data name="About_Tagline" xml:space="preserve"><value>스크린샷 키가 없는 게임을 위한 가벼운 Windows 화면 캡처 도구.</value></data>
|
||||
<data name="About_AppLabel" xml:space="preserve"><value>앱</value></data>
|
||||
<data name="About_VersionLabel" xml:space="preserve"><value>버전</value></data>
|
||||
<data name="About_LicenseLabel" xml:space="preserve"><value>라이선스</value></data>
|
||||
<data name="About_DeveloperLabel" xml:space="preserve"><value>개발자</value></data>
|
||||
<data name="About_RepositoryLabel" xml:space="preserve"><value>저장소</value></data>
|
||||
<data name="About_AiSection" xml:space="preserve"><value>AI 보조 개발</value></data>
|
||||
<data name="About_DisclaimersSection" xml:space="preserve"><value>면책 조항</value></data>
|
||||
<data name="About_TranslationDisclaimer" xml:space="preserve"><value>번역</value></data>
|
||||
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>베트남어, 아랍어, 일본어, 중국어(간체), 한국어, 스페인어, 프랑스어, 독일어, 브라질 포르투갈어, 러시아어 언어 팩은 기계 보조로 번역되었습니다. 용어가 모국어 관습과 일치하지 않을 수 있으며, 일부 기술 용어(hotkey, toast, frame 등)는 의도적으로 영어로 유지되었습니다. 교정에 도움을 주실 원어민 분들의 src/CaptureImage.UI/Resources/Strings/ .resx 파일에 대한 풀 리퀘스트를 환영합니다.</value></data>
|
||||
<data name="About_CaptureDisclaimer" xml:space="preserve"><value>캡처 지원</value></data>
|
||||
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage는 Windows.Graphics.Capture를 통해 대부분의 창 모드 및 테두리 없는 게임을 캡처할 수 있지만, 모든 타이틀에서 작동하지는 않습니다. DRM 보호된 표면, 독점 전체 화면 Direct3D 9 게임, 안티치트 후크가 있는 타이틀은 검은 프레임을 반환하거나 캡처를 거부할 수 있습니다. 레거시 앱에는 GDI PrintWindow 폴백이 시도됩니다. 전체 목록은 docs/legal/DISCLAIMER.md §2를 참조하세요.</value></data>
|
||||
<data name="About_LiabilityDisclaimer" xml:space="preserve"><value>무보증</value></data>
|
||||
<data name="About_LiabilityDisclaimerBody" xml:space="preserve"><value>CaptureImage는 GPL-3.0-or-later에 따라 어떠한 종류의 보증도 없이 "있는 그대로" 배포됩니다. 작성자는 손실된 스크린샷, 게임 충돌, 안티치트 제재 또는 데이터 손실에 대해 책임을 지지 않습니다. 본인 책임 하에 사용하세요. 전체 내용은 docs/legal/DISCLAIMER.md를 참조하세요.</value></data>
|
||||
<data name="About_LegalSection" xml:space="preserve"><value>법적 문서</value></data>
|
||||
<data name="About_ThirdPartySection" xml:space="preserve"><value>타사 구성 요소</value></data>
|
||||
<data name="About_ThirdPartyHint" xml:space="preserve"><value>위의 "타사 고지"를 클릭하면 업스트림 URL이 포함된 전체 목록이 표시됩니다.</value></data>
|
||||
<data name="About_OpenDisclaimer" xml:space="preserve"><value>면책 조항</value></data>
|
||||
<data name="About_OpenPrivacy" xml:space="preserve"><value>개인정보</value></data>
|
||||
<data name="About_OpenTerms" xml:space="preserve"><value>약관</value></data>
|
||||
<data name="About_OpenLicense" xml:space="preserve"><value>라이선스 (GPL-3.0)</value></data>
|
||||
<data name="About_OpenThirdParty" xml:space="preserve"><value>타사 고지</value></data>
|
||||
<data name="About_OpenContributors" xml:space="preserve"><value>기여자</value></data>
|
||||
|
||||
<!-- Log viewer -->
|
||||
<data name="Log_Title" xml:space="preserve"><value>실시간 로그</value></data>
|
||||
<data name="Log_Pause" xml:space="preserve"><value>일시 중지</value></data>
|
||||
<data name="Log_Resume" xml:space="preserve"><value>재개</value></data>
|
||||
<data name="Log_Clear" xml:space="preserve"><value>지우기</value></data>
|
||||
<data name="Log_EventsCount" xml:space="preserve"><value>{0}개의 이벤트</value></data>
|
||||
<data name="Log_EmptyState" xml:space="preserve"><value>아직 로그 이벤트가 없습니다. 캡처 엔진의 실시간 이벤트가 여기에 표시됩니다.</value></data>
|
||||
<data name="Log_Filter" xml:space="preserve"><value>최소 수준:</value></data>
|
||||
<data name="Log_RevealFolder" xml:space="preserve"><value>폴더 열기</value></data>
|
||||
|
||||
<!-- Preview -->
|
||||
<data name="Preview_Title" xml:space="preserve"><value>미리보기</value></data>
|
||||
<data name="Preview_Prompt" xml:space="preserve"><value>이 캡처를 저장하시겠습니까?</value></data>
|
||||
<data name="Preview_Save" xml:space="preserve"><value>저장</value></data>
|
||||
<data name="Preview_Discard" xml:space="preserve"><value>버리기</value></data>
|
||||
|
||||
<!-- Toasts -->
|
||||
<data name="Toast_CaptureSaved" xml:space="preserve"><value>캡처 저장됨</value></data>
|
||||
<data name="Toast_CaptureFailed" xml:space="preserve"><value>캡처 실패</value></data>
|
||||
<data name="Toast_SettingsImported" xml:space="preserve"><value>설정 가져옴</value></data>
|
||||
<data name="Toast_SettingsExported" xml:space="preserve"><value>설정 내보냄</value></data>
|
||||
<data name="Toast_Error" xml:space="preserve"><value>오류</value></data>
|
||||
|
||||
<!-- Tray menu -->
|
||||
<data name="Tray_ShowWindow" xml:space="preserve"><value>CaptureImage 표시</value></data>
|
||||
<data name="Tray_OpenFolder" xml:space="preserve"><value>캡처 폴더 열기</value></data>
|
||||
<data name="Tray_Exit" xml:space="preserve"><value>종료</value></data>
|
||||
|
||||
<!-- v1.5 quick wins -->
|
||||
<data name="Settings_Countdown" xml:space="preserve"><value>캡처 카운트다운</value></data>
|
||||
<data name="Settings_CountdownOff" xml:space="preserve"><value>끔(지연 없음)</value></data>
|
||||
<data name="Settings_Countdown3s" xml:space="preserve"><value>3초</value></data>
|
||||
<data name="Settings_Countdown5s" xml:space="preserve"><value>5초</value></data>
|
||||
<data name="Settings_Countdown10s" xml:space="preserve"><value>10초</value></data>
|
||||
<data name="Settings_Clipboard" xml:space="preserve"><value>클립보드 모드</value></data>
|
||||
<data name="Settings_ClipboardNone" xml:space="preserve"><value>끔(파일만)</value></data>
|
||||
<data name="Settings_ClipboardCopy" xml:space="preserve"><value>복사만(파일 없음)</value></data>
|
||||
<data name="Settings_ClipboardCopySave" xml:space="preserve"><value>복사 + 파일 저장</value></data>
|
||||
<data name="Settings_OpenFolderAfterSave" xml:space="preserve"><value>저장 후 출력 폴더 열기</value></data>
|
||||
<data name="Toast_Countdown" xml:space="preserve"><value>{0}초 후 캡처…</value></data>
|
||||
<data name="Toast_ClipboardCopied" xml:space="preserve"><value>클립보드에 복사됨</value></data>
|
||||
|
||||
<!-- v1.5 pinned thumbnail -->
|
||||
<data name="Settings_AutoPinAfterCapture" xml:space="preserve"><value>캡처마다 떠 있는 썸네일 핀 고정</value></data>
|
||||
<data name="PinnedWindow_Open" xml:space="preserve"><value>탐색기에서 표시</value></data>
|
||||
<data name="PinnedWindow_Close" xml:space="preserve"><value>닫기</value></data>
|
||||
|
||||
<!-- v1.5 OCR -->
|
||||
<data name="Preview_ExtractText" xml:space="preserve"><value>텍스트 추출 (OCR)</value></data>
|
||||
<data name="Toast_OcrSuccess" xml:space="preserve"><value>{0}개 단어 복사됨</value></data>
|
||||
<data name="Toast_OcrEmpty" xml:space="preserve"><value>이미지에서 텍스트를 찾을 수 없음</value></data>
|
||||
<data name="Toast_OcrUnavailable" xml:space="preserve"><value>이 언어용 OCR 엔진을 사용할 수 없음</value></data>
|
||||
|
||||
<!-- v1.5 region capture -->
|
||||
<data name="Settings_CaptureMode" xml:space="preserve"><value>캡처 모드</value></data>
|
||||
<data name="Settings_CaptureModeWindow" xml:space="preserve"><value>단일 창</value></data>
|
||||
<data name="Settings_CaptureModeRegion" xml:space="preserve"><value>영역(드래그하여 선택)</value></data>
|
||||
<data name="Region_TargetName" xml:space="preserve"><value>영역</value></data>
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>사각형을 드래그하세요. Esc로 취소.</value></data>
|
||||
|
||||
</root>
|
||||
@@ -0,0 +1,196 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="xml:space" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
|
||||
<!-- Navigation -->
|
||||
<data name="Nav_Dashboard" xml:space="preserve"><value>Painel</value></data>
|
||||
<data name="Nav_Update" xml:space="preserve"><value>Atualização</value></data>
|
||||
<data name="Nav_Settings" xml:space="preserve"><value>Configurações</value></data>
|
||||
<data name="Nav_About" xml:space="preserve"><value>Sobre</value></data>
|
||||
<data name="Nav_LogViewer" xml:space="preserve"><value>Log</value></data>
|
||||
|
||||
<!-- Dashboard -->
|
||||
<data name="Dashboard_Title" xml:space="preserve"><value>Painel</value></data>
|
||||
<data name="Dashboard_Subtitle" xml:space="preserve"><value>Selecione um alvo e arme — pressione o atalho para capturar.</value></data>
|
||||
<data name="Dashboard_Refresh" xml:space="preserve"><value>Atualizar</value></data>
|
||||
<data name="Dashboard_Arm" xml:space="preserve"><value>Armar</value></data>
|
||||
<data name="Dashboard_Disarm" xml:space="preserve"><value>Desarmar</value></data>
|
||||
<data name="Dashboard_StatusIdle" xml:space="preserve"><value>Inativo — selecione um alvo e arme para começar.</value></data>
|
||||
<data name="Dashboard_StatusArmed" xml:space="preserve"><value>Armado: pressione {0} para capturar {1}.</value></data>
|
||||
<data name="Dashboard_StatusCapturing" xml:space="preserve"><value>Capturando {0}…</value></data>
|
||||
<data name="Dashboard_StatusDisarmed" xml:space="preserve"><value>Desarmado.</value></data>
|
||||
<data name="Dashboard_StatusSaved" xml:space="preserve"><value>Salvo: {0} ({1}x{2}, {3} ms)</value></data>
|
||||
<data name="Dashboard_StatusFailed" xml:space="preserve"><value>Falha na captura ({0}): {1}</value></data>
|
||||
<data name="Dashboard_TargetsCount" xml:space="preserve"><value>{0} alvo(s) visível(eis)</value></data>
|
||||
<data name="Dashboard_Loading" xml:space="preserve"><value>Carregando…</value></data>
|
||||
<data name="Dashboard_EmptyState" xml:space="preserve"><value>Nenhuma janela visível para capturar — abra seu jogo ou aplicativo e clique em Atualizar.</value></data>
|
||||
<data name="Dashboard_LogToggle" xml:space="preserve"><value>Alternar gaveta de log em tempo real</value></data>
|
||||
<data name="Dashboard_SteamBadge" xml:space="preserve"><value>STEAM</value></data>
|
||||
<data name="Dashboard_SteamBadgeTooltip" xml:space="preserve"><value>Jogo Steam: {0} (AppId {1}). Captura F12 disponível pelo Steam Overlay. Alguns jogos protegidos por anti-cheat podem bloquear capturas externas.</value></data>
|
||||
|
||||
<!-- Settings -->
|
||||
<data name="Settings_Title" xml:space="preserve"><value>Configurações</value></data>
|
||||
<data name="Settings_Language" xml:space="preserve"><value>Idioma</value></data>
|
||||
<data name="Settings_Theme" xml:space="preserve"><value>Tema</value></data>
|
||||
<data name="Settings_Theme_System" xml:space="preserve"><value>Sistema</value></data>
|
||||
<data name="Settings_Theme_Light" xml:space="preserve"><value>Claro</value></data>
|
||||
<data name="Settings_Theme_Dark" xml:space="preserve"><value>Escuro</value></data>
|
||||
<data name="Settings_Hotkey" xml:space="preserve"><value>Atalho de captura</value></data>
|
||||
<data name="Settings_HotkeyHint" xml:space="preserve"><value>Clique em Gravar e pressione uma combinação. Esc cancela. Redefinir restaura Ctrl+Shift+F12.</value></data>
|
||||
<data name="Settings_HotkeyRecord" xml:space="preserve"><value>Gravar…</value></data>
|
||||
<data name="Settings_HotkeyCancel" xml:space="preserve"><value>Cancelar</value></data>
|
||||
<data name="Settings_HotkeyReset" xml:space="preserve"><value>Redefinir</value></data>
|
||||
<data name="Settings_HotkeyRecorderPrompt" xml:space="preserve"><value>Pressione uma combinação de teclas (Esc para cancelar)…</value></data>
|
||||
<data name="Settings_HotkeyErrorNoPrimary" xml:space="preserve"><value>Selecione uma tecla principal (por exemplo uma letra ou uma tecla F).</value></data>
|
||||
<data name="Settings_HotkeyErrorModifierOnly" xml:space="preserve"><value>Uma tecla modificadora sozinha não basta — adicione uma letra ou uma tecla F.</value></data>
|
||||
<data name="Settings_HotkeyErrorNeedsModifier" xml:space="preserve"><value>Letras e dígitos simples precisam de pelo menos um modificador (Ctrl/Alt/Shift/Win).</value></data>
|
||||
<data name="Settings_HotkeyErrorReserved" xml:space="preserve"><value>Esta combinação é reservada pelo Windows e não pode ser capturada.</value></data>
|
||||
<data name="Settings_HotkeyConflictWarning" xml:space="preserve"><value>Outro aplicativo pode já estar usando esta combinação — ela pode não ser disparada enquanto aquele app estiver em execução.</value></data>
|
||||
<data name="Settings_Format" xml:space="preserve"><value>Formato padrão</value></data>
|
||||
<data name="Settings_JpegQuality" xml:space="preserve"><value>Qualidade JPEG</value></data>
|
||||
<data name="Settings_WebpQuality" xml:space="preserve"><value>Qualidade WebP</value></data>
|
||||
<data name="Settings_OutputFolder" xml:space="preserve"><value>Pasta de saída</value></data>
|
||||
<data name="Settings_OutputFolderDefault" xml:space="preserve"><value>(padrão: Imagens\CaptureImage)</value></data>
|
||||
<data name="Settings_Browse" xml:space="preserve"><value>Procurar…</value></data>
|
||||
<data name="Settings_BrowseTitle" xml:space="preserve"><value>Escolher pasta de saída</value></data>
|
||||
<data name="Settings_BrowseTooltip" xml:space="preserve"><value>Escolha uma pasta em vez de digitar o caminho.</value></data>
|
||||
<data name="Settings_FileNameTemplate" xml:space="preserve"><value>Modelo de nome de arquivo</value></data>
|
||||
<data name="Settings_PreviewBeforeSave" xml:space="preserve"><value>Pré-visualizar cada captura antes de salvar</value></data>
|
||||
<data name="Settings_AutoSwitchOnAltTab" xml:space="preserve"><value>Trocar automaticamente o alvo ao usar Alt-Tab</value></data>
|
||||
<data name="Settings_AutoSwitchOnAltTabHint" xml:space="preserve"><value>O alvo selecionado segue a janela em primeiro plano. Apps fora da lista de alvos mantêm sua seleção atual.</value></data>
|
||||
<data name="Settings_MinimizeToTray" xml:space="preserve"><value>Botão Fechar minimiza para a bandeja</value></data>
|
||||
<data name="Settings_SoundEnabled" xml:space="preserve"><value>Tocar som de captura</value></data>
|
||||
<data name="Settings_Import" xml:space="preserve"><value>Importar…</value></data>
|
||||
<data name="Settings_Export" xml:space="preserve"><value>Exportar…</value></data>
|
||||
<data name="Settings_ImportTitle" xml:space="preserve"><value>Importar configurações</value></data>
|
||||
<data name="Settings_ExportTitle" xml:space="preserve"><value>Exportar configurações</value></data>
|
||||
<data name="Settings_OpenFile" xml:space="preserve"><value>Abrir arquivo de configurações</value></data>
|
||||
<data name="Settings_Logging" xml:space="preserve"><value>Registro</value></data>
|
||||
<data name="Settings_LogLevel" xml:space="preserve"><value>Nível mínimo de log</value></data>
|
||||
<data name="Settings_LogLevelHint" xml:space="preserve"><value>Filtra o arquivo de log rotativo e o visualizador. Debug para diagnóstico de suporte, Information para o dia a dia, Warning ou Error para manter os logs silenciosos.</value></data>
|
||||
|
||||
<!-- Update -->
|
||||
<data name="Update_Title" xml:space="preserve"><value>Atualização</value></data>
|
||||
<data name="Update_Check" xml:space="preserve"><value>Verificar atualizações</value></data>
|
||||
<data name="Update_Download" xml:space="preserve"><value>Baixar</value></data>
|
||||
<data name="Update_Install" xml:space="preserve"><value>Instalar e reiniciar</value></data>
|
||||
<data name="Update_Status" xml:space="preserve"><value>Status</value></data>
|
||||
<data name="Update_Log" xml:space="preserve"><value>Log</value></data>
|
||||
<data name="Update_NewVersion" xml:space="preserve"><value>Nova versão:</value></data>
|
||||
|
||||
<!-- About -->
|
||||
<data name="About_Title" xml:space="preserve"><value>Sobre o CaptureImage</value></data>
|
||||
<data name="About_Tagline" xml:space="preserve"><value>Captura de tela leve para Windows voltada a jogos sem tecla de captura nativa.</value></data>
|
||||
<data name="About_AppLabel" xml:space="preserve"><value>App</value></data>
|
||||
<data name="About_VersionLabel" xml:space="preserve"><value>Versão</value></data>
|
||||
<data name="About_LicenseLabel" xml:space="preserve"><value>Licença</value></data>
|
||||
<data name="About_DeveloperLabel" xml:space="preserve"><value>Desenvolvedor</value></data>
|
||||
<data name="About_RepositoryLabel" xml:space="preserve"><value>Repositório</value></data>
|
||||
<data name="About_AiSection" xml:space="preserve"><value>Desenvolvimento assistido por IA</value></data>
|
||||
<data name="About_DisclaimersSection" xml:space="preserve"><value>Avisos</value></data>
|
||||
<data name="About_TranslationDisclaimer" xml:space="preserve"><value>Traduções</value></data>
|
||||
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>Os pacotes de idioma vietnamita, árabe, japonês, chinês simplificado, coreano, espanhol, francês, alemão, português (Brasil) e russo são assistidos por máquina. A terminologia pode não corresponder às convenções nativas, e algumas palavras técnicas (hotkey, toast, frame etc.) são mantidas em inglês de propósito. Falantes nativos dispostos a revisar são bem-vindos a abrir pull requests nos arquivos .resx em src/CaptureImage.UI/Resources/Strings/.</value></data>
|
||||
<data name="About_CaptureDisclaimer" xml:space="preserve"><value>Suporte de captura</value></data>
|
||||
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>O CaptureImage consegue capturar a maioria dos jogos em janela ou sem borda via Windows.Graphics.Capture, mas nem todos os títulos funcionam. Superfícies protegidas por DRM, jogos Direct3D 9 em tela cheia exclusiva e títulos com hooks anti-cheat podem retornar quadros pretos ou recusar a captura. Um fallback GDI PrintWindow é tentado para apps legados. Veja docs/legal/DISCLAIMER.md §2 para a lista completa.</value></data>
|
||||
<data name="About_LiabilityDisclaimer" xml:space="preserve"><value>Sem garantia</value></data>
|
||||
<data name="About_LiabilityDisclaimerBody" xml:space="preserve"><value>O CaptureImage é distribuído sob a GPL-3.0-or-later NO ESTADO EM QUE SE ENCONTRA, sem garantia de qualquer tipo. Os autores não se responsabilizam por capturas perdidas, travamentos de jogo, sanções de anti-cheat ou perda de dados. Use por sua conta e risco. Veja docs/legal/DISCLAIMER.md para o texto completo.</value></data>
|
||||
<data name="About_LegalSection" xml:space="preserve"><value>Documentos legais</value></data>
|
||||
<data name="About_ThirdPartySection" xml:space="preserve"><value>Componentes de terceiros</value></data>
|
||||
<data name="About_ThirdPartyHint" xml:space="preserve"><value>Clique em "Avisos de terceiros" acima para a lista completa com URLs originais.</value></data>
|
||||
<data name="About_OpenDisclaimer" xml:space="preserve"><value>Aviso legal</value></data>
|
||||
<data name="About_OpenPrivacy" xml:space="preserve"><value>Privacidade</value></data>
|
||||
<data name="About_OpenTerms" xml:space="preserve"><value>Termos</value></data>
|
||||
<data name="About_OpenLicense" xml:space="preserve"><value>Licença (GPL-3.0)</value></data>
|
||||
<data name="About_OpenThirdParty" xml:space="preserve"><value>Avisos de terceiros</value></data>
|
||||
<data name="About_OpenContributors" xml:space="preserve"><value>Colaboradores</value></data>
|
||||
|
||||
<!-- Log viewer -->
|
||||
<data name="Log_Title" xml:space="preserve"><value>Log em tempo real</value></data>
|
||||
<data name="Log_Pause" xml:space="preserve"><value>Pausar</value></data>
|
||||
<data name="Log_Resume" xml:space="preserve"><value>Retomar</value></data>
|
||||
<data name="Log_Clear" xml:space="preserve"><value>Limpar</value></data>
|
||||
<data name="Log_EventsCount" xml:space="preserve"><value>{0} eventos</value></data>
|
||||
<data name="Log_EmptyState" xml:space="preserve"><value>Nenhum evento de log ainda. Eventos ao vivo do mecanismo de captura aparecerão aqui.</value></data>
|
||||
<data name="Log_Filter" xml:space="preserve"><value>Nível mín:</value></data>
|
||||
<data name="Log_RevealFolder" xml:space="preserve"><value>Abrir pasta</value></data>
|
||||
|
||||
<!-- Preview -->
|
||||
<data name="Preview_Title" xml:space="preserve"><value>Pré-visualização</value></data>
|
||||
<data name="Preview_Prompt" xml:space="preserve"><value>Salvar esta captura?</value></data>
|
||||
<data name="Preview_Save" xml:space="preserve"><value>Salvar</value></data>
|
||||
<data name="Preview_Discard" xml:space="preserve"><value>Descartar</value></data>
|
||||
|
||||
<!-- Toasts -->
|
||||
<data name="Toast_CaptureSaved" xml:space="preserve"><value>Captura salva</value></data>
|
||||
<data name="Toast_CaptureFailed" xml:space="preserve"><value>Falha na captura</value></data>
|
||||
<data name="Toast_SettingsImported" xml:space="preserve"><value>Configurações importadas</value></data>
|
||||
<data name="Toast_SettingsExported" xml:space="preserve"><value>Configurações exportadas</value></data>
|
||||
<data name="Toast_Error" xml:space="preserve"><value>Erro</value></data>
|
||||
|
||||
<!-- Tray menu -->
|
||||
<data name="Tray_ShowWindow" xml:space="preserve"><value>Mostrar CaptureImage</value></data>
|
||||
<data name="Tray_OpenFolder" xml:space="preserve"><value>Abrir pasta de capturas</value></data>
|
||||
<data name="Tray_Exit" xml:space="preserve"><value>Sair</value></data>
|
||||
|
||||
<!-- v1.5 quick wins -->
|
||||
<data name="Settings_Countdown" xml:space="preserve"><value>Contagem regressiva da captura</value></data>
|
||||
<data name="Settings_CountdownOff" xml:space="preserve"><value>Desligado (sem atraso)</value></data>
|
||||
<data name="Settings_Countdown3s" xml:space="preserve"><value>3 segundos</value></data>
|
||||
<data name="Settings_Countdown5s" xml:space="preserve"><value>5 segundos</value></data>
|
||||
<data name="Settings_Countdown10s" xml:space="preserve"><value>10 segundos</value></data>
|
||||
<data name="Settings_Clipboard" xml:space="preserve"><value>Modo da área de transferência</value></data>
|
||||
<data name="Settings_ClipboardNone" xml:space="preserve"><value>Desligado (apenas arquivo)</value></data>
|
||||
<data name="Settings_ClipboardCopy" xml:space="preserve"><value>Apenas copiar (sem arquivo)</value></data>
|
||||
<data name="Settings_ClipboardCopySave" xml:space="preserve"><value>Copiar + salvar arquivo</value></data>
|
||||
<data name="Settings_OpenFolderAfterSave" xml:space="preserve"><value>Abrir pasta de saída após salvar</value></data>
|
||||
<data name="Toast_Countdown" xml:space="preserve"><value>Capturando em {0}…</value></data>
|
||||
<data name="Toast_ClipboardCopied" xml:space="preserve"><value>Copiado para a área de transferência</value></data>
|
||||
|
||||
<!-- v1.5 pinned thumbnail -->
|
||||
<data name="Settings_AutoPinAfterCapture" xml:space="preserve"><value>Fixar uma miniatura flutuante após cada captura</value></data>
|
||||
<data name="PinnedWindow_Open" xml:space="preserve"><value>Mostrar no Explorador</value></data>
|
||||
<data name="PinnedWindow_Close" xml:space="preserve"><value>Fechar</value></data>
|
||||
|
||||
<!-- v1.5 OCR -->
|
||||
<data name="Preview_ExtractText" xml:space="preserve"><value>Extrair texto (OCR)</value></data>
|
||||
<data name="Toast_OcrSuccess" xml:space="preserve"><value>{0} palavras copiadas</value></data>
|
||||
<data name="Toast_OcrEmpty" xml:space="preserve"><value>Nenhum texto encontrado na imagem</value></data>
|
||||
<data name="Toast_OcrUnavailable" xml:space="preserve"><value>Mecanismo OCR indisponível para este idioma</value></data>
|
||||
|
||||
<!-- v1.5 region capture -->
|
||||
<data name="Settings_CaptureMode" xml:space="preserve"><value>Modo de captura</value></data>
|
||||
<data name="Settings_CaptureModeWindow" xml:space="preserve"><value>Janela única</value></data>
|
||||
<data name="Settings_CaptureModeRegion" xml:space="preserve"><value>Região (arraste para selecionar)</value></data>
|
||||
<data name="Region_TargetName" xml:space="preserve"><value>Região</value></data>
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>Arraste um retângulo. Pressione Esc para cancelar.</value></data>
|
||||
|
||||
</root>
|
||||
@@ -60,6 +60,10 @@
|
||||
<!-- Settings -->
|
||||
<data name="Settings_Title" xml:space="preserve"><value>Settings</value></data>
|
||||
<data name="Settings_Language" xml:space="preserve"><value>Language</value></data>
|
||||
<data name="Settings_Theme" xml:space="preserve"><value>Theme</value></data>
|
||||
<data name="Settings_Theme_System" xml:space="preserve"><value>System</value></data>
|
||||
<data name="Settings_Theme_Light" xml:space="preserve"><value>Light</value></data>
|
||||
<data name="Settings_Theme_Dark" xml:space="preserve"><value>Dark</value></data>
|
||||
<data name="Settings_Hotkey" xml:space="preserve"><value>Capture hotkey</value></data>
|
||||
<data name="Settings_HotkeyHint" xml:space="preserve"><value>Click Record and press a combination. Esc cancels. Reset restores Ctrl+Shift+F12.</value></data>
|
||||
<data name="Settings_HotkeyRecord" xml:space="preserve"><value>Record…</value></data>
|
||||
@@ -81,6 +85,8 @@
|
||||
<data name="Settings_BrowseTooltip" xml:space="preserve"><value>Pick a folder instead of typing the path.</value></data>
|
||||
<data name="Settings_FileNameTemplate" xml:space="preserve"><value>File name template</value></data>
|
||||
<data name="Settings_PreviewBeforeSave" xml:space="preserve"><value>Preview each capture before saving</value></data>
|
||||
<data name="Settings_AutoSwitchOnAltTab" xml:space="preserve"><value>Auto-switch target when I Alt-Tab</value></data>
|
||||
<data name="Settings_AutoSwitchOnAltTabHint" xml:space="preserve"><value>The selected target follows the foreground window. Apps not in the target list keep your current selection.</value></data>
|
||||
<data name="Settings_MinimizeToTray" xml:space="preserve"><value>Close button minimizes to tray</value></data>
|
||||
<data name="Settings_SoundEnabled" xml:space="preserve"><value>Play capture sound</value></data>
|
||||
<data name="Settings_Import" xml:space="preserve"><value>Import…</value></data>
|
||||
@@ -112,7 +118,7 @@
|
||||
<data name="About_AiSection" xml:space="preserve"><value>AI-assisted development</value></data>
|
||||
<data name="About_DisclaimersSection" xml:space="preserve"><value>Disclaimers</value></data>
|
||||
<data name="About_TranslationDisclaimer" xml:space="preserve"><value>Translations</value></data>
|
||||
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>Vietnamese and Arabic language packs are machine-assisted. Terminology may not match native conventions, and some technical words (hotkey, toast, frame, etc.) are kept in English on purpose. Native speakers willing to proofread are warmly invited to submit pull requests against the .resx files in src/CaptureImage.UI/Resources/Strings/.</value></data>
|
||||
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>The Vietnamese, Arabic, Japanese, Simplified Chinese, Korean, Spanish, French, German, Brazilian Portuguese, and Russian language packs are machine-assisted. Terminology may not match native conventions, and some technical words (hotkey, toast, frame, etc.) are kept in English on purpose. Native speakers willing to proofread are warmly invited to submit pull requests against the .resx files in src/CaptureImage.UI/Resources/Strings/.</value></data>
|
||||
<data name="About_CaptureDisclaimer" xml:space="preserve"><value>Capture support</value></data>
|
||||
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage can capture most windowed and borderless games via Windows.Graphics.Capture, but not every title works. DRM-protected surfaces, exclusive-fullscreen Direct3D 9 games, and titles with anti-cheat hooks may return black frames or refuse capture. A GDI PrintWindow fallback is attempted for legacy apps. See docs/legal/DISCLAIMER.md §2 for the full list.</value></data>
|
||||
<data name="About_LiabilityDisclaimer" xml:space="preserve"><value>No warranty</value></data>
|
||||
@@ -155,4 +161,36 @@
|
||||
<data name="Tray_OpenFolder" xml:space="preserve"><value>Open captures folder</value></data>
|
||||
<data name="Tray_Exit" xml:space="preserve"><value>Exit</value></data>
|
||||
|
||||
<!-- v1.5 quick wins -->
|
||||
<data name="Settings_Countdown" xml:space="preserve"><value>Capture countdown</value></data>
|
||||
<data name="Settings_CountdownOff" xml:space="preserve"><value>Off (no delay)</value></data>
|
||||
<data name="Settings_Countdown3s" xml:space="preserve"><value>3 seconds</value></data>
|
||||
<data name="Settings_Countdown5s" xml:space="preserve"><value>5 seconds</value></data>
|
||||
<data name="Settings_Countdown10s" xml:space="preserve"><value>10 seconds</value></data>
|
||||
<data name="Settings_Clipboard" xml:space="preserve"><value>Clipboard mode</value></data>
|
||||
<data name="Settings_ClipboardNone" xml:space="preserve"><value>Off (file only)</value></data>
|
||||
<data name="Settings_ClipboardCopy" xml:space="preserve"><value>Copy only (no file)</value></data>
|
||||
<data name="Settings_ClipboardCopySave" xml:space="preserve"><value>Copy + save file</value></data>
|
||||
<data name="Settings_OpenFolderAfterSave" xml:space="preserve"><value>Open output folder after save</value></data>
|
||||
<data name="Toast_Countdown" xml:space="preserve"><value>Capturing in {0}…</value></data>
|
||||
<data name="Toast_ClipboardCopied" xml:space="preserve"><value>Copied to clipboard</value></data>
|
||||
|
||||
<!-- v1.5 pinned thumbnail -->
|
||||
<data name="Settings_AutoPinAfterCapture" xml:space="preserve"><value>Pin a floating thumbnail after each capture</value></data>
|
||||
<data name="PinnedWindow_Open" xml:space="preserve"><value>Show in Explorer</value></data>
|
||||
<data name="PinnedWindow_Close" xml:space="preserve"><value>Close</value></data>
|
||||
|
||||
<!-- v1.5 OCR -->
|
||||
<data name="Preview_ExtractText" xml:space="preserve"><value>Extract text (OCR)</value></data>
|
||||
<data name="Toast_OcrSuccess" xml:space="preserve"><value>{0} words copied</value></data>
|
||||
<data name="Toast_OcrEmpty" xml:space="preserve"><value>No text found in image</value></data>
|
||||
<data name="Toast_OcrUnavailable" xml:space="preserve"><value>OCR engine unavailable for this language</value></data>
|
||||
|
||||
<!-- v1.5 region capture -->
|
||||
<data name="Settings_CaptureMode" xml:space="preserve"><value>Capture mode</value></data>
|
||||
<data name="Settings_CaptureModeWindow" xml:space="preserve"><value>Single window</value></data>
|
||||
<data name="Settings_CaptureModeRegion" xml:space="preserve"><value>Region (drag to select)</value></data>
|
||||
<data name="Region_TargetName" xml:space="preserve"><value>Region</value></data>
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>Drag a rectangle. Press Esc to cancel.</value></data>
|
||||
|
||||
</root>
|
||||
@@ -0,0 +1,196 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="xml:space" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
|
||||
<!-- Navigation -->
|
||||
<data name="Nav_Dashboard" xml:space="preserve"><value>Панель</value></data>
|
||||
<data name="Nav_Update" xml:space="preserve"><value>Обновление</value></data>
|
||||
<data name="Nav_Settings" xml:space="preserve"><value>Настройки</value></data>
|
||||
<data name="Nav_About" xml:space="preserve"><value>О программе</value></data>
|
||||
<data name="Nav_LogViewer" xml:space="preserve"><value>Журнал</value></data>
|
||||
|
||||
<!-- Dashboard -->
|
||||
<data name="Dashboard_Title" xml:space="preserve"><value>Панель</value></data>
|
||||
<data name="Dashboard_Subtitle" xml:space="preserve"><value>Выберите цель и активируйте — нажмите горячую клавишу, чтобы сделать снимок.</value></data>
|
||||
<data name="Dashboard_Refresh" xml:space="preserve"><value>Обновить</value></data>
|
||||
<data name="Dashboard_Arm" xml:space="preserve"><value>Активировать</value></data>
|
||||
<data name="Dashboard_Disarm" xml:space="preserve"><value>Деактивировать</value></data>
|
||||
<data name="Dashboard_StatusIdle" xml:space="preserve"><value>Ожидание — выберите цель и активируйте, чтобы начать.</value></data>
|
||||
<data name="Dashboard_StatusArmed" xml:space="preserve"><value>Активно: нажмите {0}, чтобы захватить {1}.</value></data>
|
||||
<data name="Dashboard_StatusCapturing" xml:space="preserve"><value>Захват {0}…</value></data>
|
||||
<data name="Dashboard_StatusDisarmed" xml:space="preserve"><value>Деактивировано.</value></data>
|
||||
<data name="Dashboard_StatusSaved" xml:space="preserve"><value>Сохранено: {0} ({1}x{2}, {3} мс)</value></data>
|
||||
<data name="Dashboard_StatusFailed" xml:space="preserve"><value>Ошибка захвата ({0}): {1}</value></data>
|
||||
<data name="Dashboard_TargetsCount" xml:space="preserve"><value>Видимых целей: {0}</value></data>
|
||||
<data name="Dashboard_Loading" xml:space="preserve"><value>Загрузка…</value></data>
|
||||
<data name="Dashboard_EmptyState" xml:space="preserve"><value>Нет видимых окон для захвата — запустите игру или приложение и нажмите Обновить.</value></data>
|
||||
<data name="Dashboard_LogToggle" xml:space="preserve"><value>Открыть/закрыть панель журнала в реальном времени</value></data>
|
||||
<data name="Dashboard_SteamBadge" xml:space="preserve"><value>STEAM</value></data>
|
||||
<data name="Dashboard_SteamBadgeTooltip" xml:space="preserve"><value>Игра Steam: {0} (AppId {1}). Скриншоты по F12 доступны через Steam Overlay. Игры с защитой от читов могут блокировать внешний захват.</value></data>
|
||||
|
||||
<!-- Settings -->
|
||||
<data name="Settings_Title" xml:space="preserve"><value>Настройки</value></data>
|
||||
<data name="Settings_Language" xml:space="preserve"><value>Язык</value></data>
|
||||
<data name="Settings_Theme" xml:space="preserve"><value>Тема</value></data>
|
||||
<data name="Settings_Theme_System" xml:space="preserve"><value>Системная</value></data>
|
||||
<data name="Settings_Theme_Light" xml:space="preserve"><value>Светлая</value></data>
|
||||
<data name="Settings_Theme_Dark" xml:space="preserve"><value>Тёмная</value></data>
|
||||
<data name="Settings_Hotkey" xml:space="preserve"><value>Горячая клавиша захвата</value></data>
|
||||
<data name="Settings_HotkeyHint" xml:space="preserve"><value>Нажмите Записать и введите комбинацию. Esc отменяет. Сброс возвращает Ctrl+Shift+F12.</value></data>
|
||||
<data name="Settings_HotkeyRecord" xml:space="preserve"><value>Записать…</value></data>
|
||||
<data name="Settings_HotkeyCancel" xml:space="preserve"><value>Отмена</value></data>
|
||||
<data name="Settings_HotkeyReset" xml:space="preserve"><value>Сброс</value></data>
|
||||
<data name="Settings_HotkeyRecorderPrompt" xml:space="preserve"><value>Нажмите комбинацию клавиш (Esc для отмены)…</value></data>
|
||||
<data name="Settings_HotkeyErrorNoPrimary" xml:space="preserve"><value>Выберите основную клавишу (например букву или функциональную клавишу).</value></data>
|
||||
<data name="Settings_HotkeyErrorModifierOnly" xml:space="preserve"><value>Одной модификаторной клавиши недостаточно — добавьте букву или F-клавишу.</value></data>
|
||||
<data name="Settings_HotkeyErrorNeedsModifier" xml:space="preserve"><value>Обычным буквам и цифрам нужен хотя бы один модификатор (Ctrl/Alt/Shift/Win).</value></data>
|
||||
<data name="Settings_HotkeyErrorReserved" xml:space="preserve"><value>Эта комбинация зарезервирована Windows и не может быть захвачена.</value></data>
|
||||
<data name="Settings_HotkeyConflictWarning" xml:space="preserve"><value>Другое приложение, возможно, уже использует эту комбинацию — она может не сработать, пока то приложение запущено.</value></data>
|
||||
<data name="Settings_Format" xml:space="preserve"><value>Формат по умолчанию</value></data>
|
||||
<data name="Settings_JpegQuality" xml:space="preserve"><value>Качество JPEG</value></data>
|
||||
<data name="Settings_WebpQuality" xml:space="preserve"><value>Качество WebP</value></data>
|
||||
<data name="Settings_OutputFolder" xml:space="preserve"><value>Папка вывода</value></data>
|
||||
<data name="Settings_OutputFolderDefault" xml:space="preserve"><value>(по умолчанию: Изображения\CaptureImage)</value></data>
|
||||
<data name="Settings_Browse" xml:space="preserve"><value>Обзор…</value></data>
|
||||
<data name="Settings_BrowseTitle" xml:space="preserve"><value>Выберите папку вывода</value></data>
|
||||
<data name="Settings_BrowseTooltip" xml:space="preserve"><value>Выберите папку вместо ввода пути вручную.</value></data>
|
||||
<data name="Settings_FileNameTemplate" xml:space="preserve"><value>Шаблон имени файла</value></data>
|
||||
<data name="Settings_PreviewBeforeSave" xml:space="preserve"><value>Показывать каждый снимок перед сохранением</value></data>
|
||||
<data name="Settings_AutoSwitchOnAltTab" xml:space="preserve"><value>Автоматически менять цель при Alt-Tab</value></data>
|
||||
<data name="Settings_AutoSwitchOnAltTabHint" xml:space="preserve"><value>Выбранная цель следует за активным окном. Приложения вне списка целей сохраняют текущий выбор.</value></data>
|
||||
<data name="Settings_MinimizeToTray" xml:space="preserve"><value>Кнопка закрытия сворачивает в трей</value></data>
|
||||
<data name="Settings_SoundEnabled" xml:space="preserve"><value>Воспроизводить звук захвата</value></data>
|
||||
<data name="Settings_Import" xml:space="preserve"><value>Импорт…</value></data>
|
||||
<data name="Settings_Export" xml:space="preserve"><value>Экспорт…</value></data>
|
||||
<data name="Settings_ImportTitle" xml:space="preserve"><value>Импорт настроек</value></data>
|
||||
<data name="Settings_ExportTitle" xml:space="preserve"><value>Экспорт настроек</value></data>
|
||||
<data name="Settings_OpenFile" xml:space="preserve"><value>Открыть файл настроек</value></data>
|
||||
<data name="Settings_Logging" xml:space="preserve"><value>Журналирование</value></data>
|
||||
<data name="Settings_LogLevel" xml:space="preserve"><value>Минимальный уровень журнала</value></data>
|
||||
<data name="Settings_LogLevelHint" xml:space="preserve"><value>Фильтрует файл журнала и панель просмотра. Debug — для диагностики, Information — для обычной работы, Warning или Error — чтобы свести шум к минимуму.</value></data>
|
||||
|
||||
<!-- Update -->
|
||||
<data name="Update_Title" xml:space="preserve"><value>Обновление</value></data>
|
||||
<data name="Update_Check" xml:space="preserve"><value>Проверить обновления</value></data>
|
||||
<data name="Update_Download" xml:space="preserve"><value>Скачать</value></data>
|
||||
<data name="Update_Install" xml:space="preserve"><value>Установить и перезапустить</value></data>
|
||||
<data name="Update_Status" xml:space="preserve"><value>Состояние</value></data>
|
||||
<data name="Update_Log" xml:space="preserve"><value>Журнал</value></data>
|
||||
<data name="Update_NewVersion" xml:space="preserve"><value>Новая версия:</value></data>
|
||||
|
||||
<!-- About -->
|
||||
<data name="About_Title" xml:space="preserve"><value>О программе CaptureImage</value></data>
|
||||
<data name="About_Tagline" xml:space="preserve"><value>Лёгкая утилита захвата экрана Windows для игр без встроенной клавиши скриншота.</value></data>
|
||||
<data name="About_AppLabel" xml:space="preserve"><value>Приложение</value></data>
|
||||
<data name="About_VersionLabel" xml:space="preserve"><value>Версия</value></data>
|
||||
<data name="About_LicenseLabel" xml:space="preserve"><value>Лицензия</value></data>
|
||||
<data name="About_DeveloperLabel" xml:space="preserve"><value>Разработчик</value></data>
|
||||
<data name="About_RepositoryLabel" xml:space="preserve"><value>Репозиторий</value></data>
|
||||
<data name="About_AiSection" xml:space="preserve"><value>Разработка с помощью ИИ</value></data>
|
||||
<data name="About_DisclaimersSection" xml:space="preserve"><value>Примечания</value></data>
|
||||
<data name="About_TranslationDisclaimer" xml:space="preserve"><value>Переводы</value></data>
|
||||
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>Языковые пакеты вьетнамский, арабский, японский, упрощённый китайский, корейский, испанский, французский, немецкий, бразильский португальский и русский подготовлены при помощи машинного перевода. Терминология может отличаться от привычной носителям, а некоторые технические слова (hotkey, toast, frame и т.п.) намеренно оставлены на английском. Носители языка, готовые проверить переводы, приглашаются открыть pull request к файлам .resx в src/CaptureImage.UI/Resources/Strings/.</value></data>
|
||||
<data name="About_CaptureDisclaimer" xml:space="preserve"><value>Поддержка захвата</value></data>
|
||||
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage может захватывать большинство оконных и безрамочных игр через Windows.Graphics.Capture, но не каждый тайтл. Поверхности с DRM, эксклюзивный полноэкранный Direct3D 9 и игры с анти-чит хуками могут возвращать чёрные кадры или отказывать в захвате. Для устаревших приложений используется резервный механизм GDI PrintWindow. Полный список — docs/legal/DISCLAIMER.md §2.</value></data>
|
||||
<data name="About_LiabilityDisclaimer" xml:space="preserve"><value>Без гарантии</value></data>
|
||||
<data name="About_LiabilityDisclaimerBody" xml:space="preserve"><value>CaptureImage распространяется по GPL-3.0-or-later КАК ЕСТЬ, без каких-либо гарантий. Авторы не несут ответственности за потерянные скриншоты, сбои игр, санкции анти-читов или потерю данных. Используйте на свой риск. Полный текст — docs/legal/DISCLAIMER.md.</value></data>
|
||||
<data name="About_LegalSection" xml:space="preserve"><value>Юридические документы</value></data>
|
||||
<data name="About_ThirdPartySection" xml:space="preserve"><value>Сторонние компоненты</value></data>
|
||||
<data name="About_ThirdPartyHint" xml:space="preserve"><value>Нажмите «Уведомления о сторонних компонентах» выше, чтобы увидеть полный список с исходными ссылками.</value></data>
|
||||
<data name="About_OpenDisclaimer" xml:space="preserve"><value>Отказ от ответственности</value></data>
|
||||
<data name="About_OpenPrivacy" xml:space="preserve"><value>Конфиденциальность</value></data>
|
||||
<data name="About_OpenTerms" xml:space="preserve"><value>Условия</value></data>
|
||||
<data name="About_OpenLicense" xml:space="preserve"><value>Лицензия (GPL-3.0)</value></data>
|
||||
<data name="About_OpenThirdParty" xml:space="preserve"><value>Уведомления о сторонних компонентах</value></data>
|
||||
<data name="About_OpenContributors" xml:space="preserve"><value>Соавторы</value></data>
|
||||
|
||||
<!-- Log viewer -->
|
||||
<data name="Log_Title" xml:space="preserve"><value>Журнал в реальном времени</value></data>
|
||||
<data name="Log_Pause" xml:space="preserve"><value>Пауза</value></data>
|
||||
<data name="Log_Resume" xml:space="preserve"><value>Продолжить</value></data>
|
||||
<data name="Log_Clear" xml:space="preserve"><value>Очистить</value></data>
|
||||
<data name="Log_EventsCount" xml:space="preserve"><value>событий: {0}</value></data>
|
||||
<data name="Log_EmptyState" xml:space="preserve"><value>Записей журнала пока нет. Здесь появятся события движка захвата в реальном времени.</value></data>
|
||||
<data name="Log_Filter" xml:space="preserve"><value>Мин. уровень:</value></data>
|
||||
<data name="Log_RevealFolder" xml:space="preserve"><value>Открыть папку</value></data>
|
||||
|
||||
<!-- Preview -->
|
||||
<data name="Preview_Title" xml:space="preserve"><value>Предпросмотр</value></data>
|
||||
<data name="Preview_Prompt" xml:space="preserve"><value>Сохранить этот снимок?</value></data>
|
||||
<data name="Preview_Save" xml:space="preserve"><value>Сохранить</value></data>
|
||||
<data name="Preview_Discard" xml:space="preserve"><value>Отбросить</value></data>
|
||||
|
||||
<!-- Toasts -->
|
||||
<data name="Toast_CaptureSaved" xml:space="preserve"><value>Снимок сохранён</value></data>
|
||||
<data name="Toast_CaptureFailed" xml:space="preserve"><value>Ошибка захвата</value></data>
|
||||
<data name="Toast_SettingsImported" xml:space="preserve"><value>Настройки импортированы</value></data>
|
||||
<data name="Toast_SettingsExported" xml:space="preserve"><value>Настройки экспортированы</value></data>
|
||||
<data name="Toast_Error" xml:space="preserve"><value>Ошибка</value></data>
|
||||
|
||||
<!-- Tray menu -->
|
||||
<data name="Tray_ShowWindow" xml:space="preserve"><value>Показать CaptureImage</value></data>
|
||||
<data name="Tray_OpenFolder" xml:space="preserve"><value>Открыть папку снимков</value></data>
|
||||
<data name="Tray_Exit" xml:space="preserve"><value>Выход</value></data>
|
||||
|
||||
<!-- v1.5 quick wins -->
|
||||
<data name="Settings_Countdown" xml:space="preserve"><value>Обратный отсчёт перед захватом</value></data>
|
||||
<data name="Settings_CountdownOff" xml:space="preserve"><value>Выключено (без задержки)</value></data>
|
||||
<data name="Settings_Countdown3s" xml:space="preserve"><value>3 секунды</value></data>
|
||||
<data name="Settings_Countdown5s" xml:space="preserve"><value>5 секунд</value></data>
|
||||
<data name="Settings_Countdown10s" xml:space="preserve"><value>10 секунд</value></data>
|
||||
<data name="Settings_Clipboard" xml:space="preserve"><value>Режим буфера обмена</value></data>
|
||||
<data name="Settings_ClipboardNone" xml:space="preserve"><value>Выключено (только файл)</value></data>
|
||||
<data name="Settings_ClipboardCopy" xml:space="preserve"><value>Только копирование (без файла)</value></data>
|
||||
<data name="Settings_ClipboardCopySave" xml:space="preserve"><value>Копирование + сохранение файла</value></data>
|
||||
<data name="Settings_OpenFolderAfterSave" xml:space="preserve"><value>Открывать папку вывода после сохранения</value></data>
|
||||
<data name="Toast_Countdown" xml:space="preserve"><value>Захват через {0}…</value></data>
|
||||
<data name="Toast_ClipboardCopied" xml:space="preserve"><value>Скопировано в буфер обмена</value></data>
|
||||
|
||||
<!-- v1.5 pinned thumbnail -->
|
||||
<data name="Settings_AutoPinAfterCapture" xml:space="preserve"><value>Закреплять плавающую миниатюру после каждого захвата</value></data>
|
||||
<data name="PinnedWindow_Open" xml:space="preserve"><value>Показать в Проводнике</value></data>
|
||||
<data name="PinnedWindow_Close" xml:space="preserve"><value>Закрыть</value></data>
|
||||
|
||||
<!-- v1.5 OCR -->
|
||||
<data name="Preview_ExtractText" xml:space="preserve"><value>Извлечь текст (OCR)</value></data>
|
||||
<data name="Toast_OcrSuccess" xml:space="preserve"><value>Скопировано слов: {0}</value></data>
|
||||
<data name="Toast_OcrEmpty" xml:space="preserve"><value>В изображении не найдено текста</value></data>
|
||||
<data name="Toast_OcrUnavailable" xml:space="preserve"><value>OCR-движок недоступен для этого языка</value></data>
|
||||
|
||||
<!-- v1.5 region capture -->
|
||||
<data name="Settings_CaptureMode" xml:space="preserve"><value>Режим захвата</value></data>
|
||||
<data name="Settings_CaptureModeWindow" xml:space="preserve"><value>Одно окно</value></data>
|
||||
<data name="Settings_CaptureModeRegion" xml:space="preserve"><value>Область (выделение перетаскиванием)</value></data>
|
||||
<data name="Region_TargetName" xml:space="preserve"><value>Область</value></data>
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>Выделите прямоугольник. Esc — отмена.</value></data>
|
||||
|
||||
</root>
|
||||
@@ -60,6 +60,10 @@
|
||||
<!-- Settings -->
|
||||
<data name="Settings_Title" xml:space="preserve"><value>Cài đặt</value></data>
|
||||
<data name="Settings_Language" xml:space="preserve"><value>Ngôn ngữ</value></data>
|
||||
<data name="Settings_Theme" xml:space="preserve"><value>Giao diện</value></data>
|
||||
<data name="Settings_Theme_System" xml:space="preserve"><value>Theo hệ thống</value></data>
|
||||
<data name="Settings_Theme_Light" xml:space="preserve"><value>Sáng</value></data>
|
||||
<data name="Settings_Theme_Dark" xml:space="preserve"><value>Tối</value></data>
|
||||
<data name="Settings_Hotkey" xml:space="preserve"><value>Hotkey chụp</value></data>
|
||||
<data name="Settings_HotkeyHint" xml:space="preserve"><value>Nhấn Ghi rồi nhấn tổ hợp phím. Esc để huỷ. Đặt lại sẽ khôi phục Ctrl+Shift+F12.</value></data>
|
||||
<data name="Settings_HotkeyRecord" xml:space="preserve"><value>Ghi…</value></data>
|
||||
@@ -81,6 +85,8 @@
|
||||
<data name="Settings_BrowseTooltip" xml:space="preserve"><value>Chọn thư mục thay vì phải gõ đường dẫn.</value></data>
|
||||
<data name="Settings_FileNameTemplate" xml:space="preserve"><value>Mẫu tên tệp</value></data>
|
||||
<data name="Settings_PreviewBeforeSave" xml:space="preserve"><value>Xem trước từng ảnh chụp trước khi lưu</value></data>
|
||||
<data name="Settings_AutoSwitchOnAltTab" xml:space="preserve"><value>Tự động chuyển mục tiêu khi Alt-Tab</value></data>
|
||||
<data name="Settings_AutoSwitchOnAltTabHint" xml:space="preserve"><value>Mục tiêu được chọn sẽ theo cửa sổ đang foreground. Các ứng dụng không có trong danh sách sẽ giữ nguyên lựa chọn hiện tại.</value></data>
|
||||
<data name="Settings_MinimizeToTray" xml:space="preserve"><value>Nút đóng sẽ thu nhỏ xuống tray</value></data>
|
||||
<data name="Settings_SoundEnabled" xml:space="preserve"><value>Phát âm thanh khi chụp</value></data>
|
||||
<data name="Settings_Import" xml:space="preserve"><value>Nhập…</value></data>
|
||||
@@ -112,7 +118,7 @@
|
||||
<data name="About_AiSection" xml:space="preserve"><value>Phát triển có hỗ trợ AI</value></data>
|
||||
<data name="About_DisclaimersSection" xml:space="preserve"><value>Tuyên bố miễn trừ</value></data>
|
||||
<data name="About_TranslationDisclaimer" xml:space="preserve"><value>Bản dịch</value></data>
|
||||
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>Gói ngôn ngữ tiếng Việt và tiếng Ả Rập đang dùng bản dịch máy. Thuật ngữ có thể không khớp với quy ước bản ngữ, và một số từ kỹ thuật (hotkey, toast, frame, v.v.) được giữ tiếng Anh có chủ đích. Người bản ngữ sẵn lòng hiệu đính xin gửi pull request vào các tệp .resx trong src/CaptureImage.UI/Resources/Strings/.</value></data>
|
||||
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>Các gói ngôn ngữ tiếng Việt, tiếng Ả Rập, tiếng Nhật, tiếng Trung giản thể, tiếng Hàn, tiếng Tây Ban Nha, tiếng Pháp, tiếng Đức, tiếng Bồ Đào Nha (Brazil) và tiếng Nga đang dùng bản dịch máy. Thuật ngữ có thể không khớp với quy ước bản ngữ, và một số từ kỹ thuật (hotkey, toast, frame, v.v.) được giữ tiếng Anh có chủ đích. Người bản ngữ sẵn lòng hiệu đính xin gửi pull request vào các tệp .resx trong src/CaptureImage.UI/Resources/Strings/.</value></data>
|
||||
<data name="About_CaptureDisclaimer" xml:space="preserve"><value>Khả năng chụp</value></data>
|
||||
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage có thể chụp hầu hết game cửa sổ và borderless qua Windows.Graphics.Capture, nhưng không phải game nào cũng hoạt động. Bề mặt có DRM, game Direct3D 9 exclusive-fullscreen, và game có hook anti-cheat có thể trả khung đen hoặc từ chối chụp. Cơ chế dự phòng GDI PrintWindow được thử cho ứng dụng cũ. Xem docs/legal/DISCLAIMER.md §2 để biết danh sách đầy đủ.</value></data>
|
||||
<data name="About_LiabilityDisclaimer" xml:space="preserve"><value>Không bảo hành</value></data>
|
||||
@@ -155,4 +161,36 @@
|
||||
<data name="Tray_OpenFolder" xml:space="preserve"><value>Mở thư mục ảnh</value></data>
|
||||
<data name="Tray_Exit" xml:space="preserve"><value>Thoát</value></data>
|
||||
|
||||
<!-- v1.5 quick wins -->
|
||||
<data name="Settings_Countdown" xml:space="preserve"><value>Đếm ngược trước khi chụp</value></data>
|
||||
<data name="Settings_CountdownOff" xml:space="preserve"><value>Tắt (không trễ)</value></data>
|
||||
<data name="Settings_Countdown3s" xml:space="preserve"><value>3 giây</value></data>
|
||||
<data name="Settings_Countdown5s" xml:space="preserve"><value>5 giây</value></data>
|
||||
<data name="Settings_Countdown10s" xml:space="preserve"><value>10 giây</value></data>
|
||||
<data name="Settings_Clipboard" xml:space="preserve"><value>Chế độ clipboard</value></data>
|
||||
<data name="Settings_ClipboardNone" xml:space="preserve"><value>Tắt (chỉ lưu file)</value></data>
|
||||
<data name="Settings_ClipboardCopy" xml:space="preserve"><value>Chỉ copy (không lưu file)</value></data>
|
||||
<data name="Settings_ClipboardCopySave" xml:space="preserve"><value>Copy + lưu file</value></data>
|
||||
<data name="Settings_OpenFolderAfterSave" xml:space="preserve"><value>Mở thư mục đầu ra sau khi lưu</value></data>
|
||||
<data name="Toast_Countdown" xml:space="preserve"><value>Chụp sau {0}…</value></data>
|
||||
<data name="Toast_ClipboardCopied" xml:space="preserve"><value>Đã copy vào clipboard</value></data>
|
||||
|
||||
<!-- v1.5 pinned thumbnail -->
|
||||
<data name="Settings_AutoPinAfterCapture" xml:space="preserve"><value>Ghim ảnh nhỏ nổi sau mỗi lần chụp</value></data>
|
||||
<data name="PinnedWindow_Open" xml:space="preserve"><value>Hiện trong Explorer</value></data>
|
||||
<data name="PinnedWindow_Close" xml:space="preserve"><value>Đóng</value></data>
|
||||
|
||||
<!-- v1.5 OCR -->
|
||||
<data name="Preview_ExtractText" xml:space="preserve"><value>Trích xuất văn bản (OCR)</value></data>
|
||||
<data name="Toast_OcrSuccess" xml:space="preserve"><value>Đã copy {0} từ</value></data>
|
||||
<data name="Toast_OcrEmpty" xml:space="preserve"><value>Không tìm thấy văn bản trong ảnh</value></data>
|
||||
<data name="Toast_OcrUnavailable" xml:space="preserve"><value>Bộ máy OCR không khả dụng cho ngôn ngữ này</value></data>
|
||||
|
||||
<!-- v1.5 region capture -->
|
||||
<data name="Settings_CaptureMode" xml:space="preserve"><value>Chế độ chụp</value></data>
|
||||
<data name="Settings_CaptureModeWindow" xml:space="preserve"><value>Một cửa sổ</value></data>
|
||||
<data name="Settings_CaptureModeRegion" xml:space="preserve"><value>Vùng (kéo để chọn)</value></data>
|
||||
<data name="Region_TargetName" xml:space="preserve"><value>Vùng</value></data>
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>Kéo để chọn vùng. Nhấn Esc để huỷ.</value></data>
|
||||
|
||||
</root>
|
||||
@@ -0,0 +1,196 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="xml:space" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader>
|
||||
<resheader name="version"><value>2.0</value></resheader>
|
||||
<resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
|
||||
|
||||
<!-- Navigation -->
|
||||
<data name="Nav_Dashboard" xml:space="preserve"><value>仪表板</value></data>
|
||||
<data name="Nav_Update" xml:space="preserve"><value>更新</value></data>
|
||||
<data name="Nav_Settings" xml:space="preserve"><value>设置</value></data>
|
||||
<data name="Nav_About" xml:space="preserve"><value>关于</value></data>
|
||||
<data name="Nav_LogViewer" xml:space="preserve"><value>日志</value></data>
|
||||
|
||||
<!-- Dashboard -->
|
||||
<data name="Dashboard_Title" xml:space="preserve"><value>仪表板</value></data>
|
||||
<data name="Dashboard_Subtitle" xml:space="preserve"><value>选择目标并启动 — 按热键即可截图。</value></data>
|
||||
<data name="Dashboard_Refresh" xml:space="preserve"><value>刷新</value></data>
|
||||
<data name="Dashboard_Arm" xml:space="preserve"><value>启动</value></data>
|
||||
<data name="Dashboard_Disarm" xml:space="preserve"><value>停止</value></data>
|
||||
<data name="Dashboard_StatusIdle" xml:space="preserve"><value>空闲 — 选择目标并启动后开始。</value></data>
|
||||
<data name="Dashboard_StatusArmed" xml:space="preserve"><value>已启动:按 {0} 截取 {1}。</value></data>
|
||||
<data name="Dashboard_StatusCapturing" xml:space="preserve"><value>正在截取 {0}…</value></data>
|
||||
<data name="Dashboard_StatusDisarmed" xml:space="preserve"><value>已停止。</value></data>
|
||||
<data name="Dashboard_StatusSaved" xml:space="preserve"><value>已保存:{0} ({1}x{2}, {3} ms)</value></data>
|
||||
<data name="Dashboard_StatusFailed" xml:space="preserve"><value>截图失败 ({0}):{1}</value></data>
|
||||
<data name="Dashboard_TargetsCount" xml:space="preserve"><value>显示 {0} 个目标</value></data>
|
||||
<data name="Dashboard_Loading" xml:space="preserve"><value>正在加载…</value></data>
|
||||
<data name="Dashboard_EmptyState" xml:space="preserve"><value>没有可截取的可见窗口 — 启动游戏或应用后单击"刷新"。</value></data>
|
||||
<data name="Dashboard_LogToggle" xml:space="preserve"><value>切换实时日志面板</value></data>
|
||||
<data name="Dashboard_SteamBadge" xml:space="preserve"><value>STEAM</value></data>
|
||||
<data name="Dashboard_SteamBadgeTooltip" xml:space="preserve"><value>Steam 游戏:{0} (AppId {1})。可通过 Steam 叠加层使用 F12 截图。部分受反作弊保护的游戏可能会阻止外部截图。</value></data>
|
||||
|
||||
<!-- Settings -->
|
||||
<data name="Settings_Title" xml:space="preserve"><value>设置</value></data>
|
||||
<data name="Settings_Language" xml:space="preserve"><value>语言</value></data>
|
||||
<data name="Settings_Theme" xml:space="preserve"><value>主题</value></data>
|
||||
<data name="Settings_Theme_System" xml:space="preserve"><value>系统</value></data>
|
||||
<data name="Settings_Theme_Light" xml:space="preserve"><value>浅色</value></data>
|
||||
<data name="Settings_Theme_Dark" xml:space="preserve"><value>深色</value></data>
|
||||
<data name="Settings_Hotkey" xml:space="preserve"><value>截图热键</value></data>
|
||||
<data name="Settings_HotkeyHint" xml:space="preserve"><value>单击"录制"并按下组合键。Esc 取消。"重置"将恢复 Ctrl+Shift+F12。</value></data>
|
||||
<data name="Settings_HotkeyRecord" xml:space="preserve"><value>录制…</value></data>
|
||||
<data name="Settings_HotkeyCancel" xml:space="preserve"><value>取消</value></data>
|
||||
<data name="Settings_HotkeyReset" xml:space="preserve"><value>重置</value></data>
|
||||
<data name="Settings_HotkeyRecorderPrompt" xml:space="preserve"><value>请按下组合键(按 Esc 取消)…</value></data>
|
||||
<data name="Settings_HotkeyErrorNoPrimary" xml:space="preserve"><value>请选择主键(例如字母键或 F 键)。</value></data>
|
||||
<data name="Settings_HotkeyErrorModifierOnly" xml:space="preserve"><value>仅修饰键不够 — 请添加字母或 F 键。</value></data>
|
||||
<data name="Settings_HotkeyErrorNeedsModifier" xml:space="preserve"><value>普通字母和数字至少需要一个修饰键(Ctrl/Alt/Shift/Win)。</value></data>
|
||||
<data name="Settings_HotkeyErrorReserved" xml:space="preserve"><value>该组合键已被 Windows 保留,无法使用。</value></data>
|
||||
<data name="Settings_HotkeyConflictWarning" xml:space="preserve"><value>另一个应用程序可能已经占用了该组合键 — 当该应用运行时可能不会触发。</value></data>
|
||||
<data name="Settings_Format" xml:space="preserve"><value>默认格式</value></data>
|
||||
<data name="Settings_JpegQuality" xml:space="preserve"><value>JPEG 质量</value></data>
|
||||
<data name="Settings_WebpQuality" xml:space="preserve"><value>WebP 质量</value></data>
|
||||
<data name="Settings_OutputFolder" xml:space="preserve"><value>输出文件夹</value></data>
|
||||
<data name="Settings_OutputFolderDefault" xml:space="preserve"><value>(默认:Pictures\CaptureImage)</value></data>
|
||||
<data name="Settings_Browse" xml:space="preserve"><value>浏览…</value></data>
|
||||
<data name="Settings_BrowseTitle" xml:space="preserve"><value>选择输出文件夹</value></data>
|
||||
<data name="Settings_BrowseTooltip" xml:space="preserve"><value>选择文件夹而不是手动输入路径。</value></data>
|
||||
<data name="Settings_FileNameTemplate" xml:space="preserve"><value>文件名模板</value></data>
|
||||
<data name="Settings_PreviewBeforeSave" xml:space="preserve"><value>保存前预览每张截图</value></data>
|
||||
<data name="Settings_AutoSwitchOnAltTab" xml:space="preserve"><value>Alt-Tab 时自动切换目标</value></data>
|
||||
<data name="Settings_AutoSwitchOnAltTabHint" xml:space="preserve"><value>所选目标将跟随前台窗口。不在目标列表中的应用将保留当前选择。</value></data>
|
||||
<data name="Settings_MinimizeToTray" xml:space="preserve"><value>关闭按钮最小化到系统托盘</value></data>
|
||||
<data name="Settings_SoundEnabled" xml:space="preserve"><value>播放截图音效</value></data>
|
||||
<data name="Settings_Import" xml:space="preserve"><value>导入…</value></data>
|
||||
<data name="Settings_Export" xml:space="preserve"><value>导出…</value></data>
|
||||
<data name="Settings_ImportTitle" xml:space="preserve"><value>导入设置</value></data>
|
||||
<data name="Settings_ExportTitle" xml:space="preserve"><value>导出设置</value></data>
|
||||
<data name="Settings_OpenFile" xml:space="preserve"><value>打开设置文件</value></data>
|
||||
<data name="Settings_Logging" xml:space="preserve"><value>日志</value></data>
|
||||
<data name="Settings_LogLevel" xml:space="preserve"><value>最低日志级别</value></data>
|
||||
<data name="Settings_LogLevelHint" xml:space="preserve"><value>过滤滚动日志文件和查看器。支持诊断时选 Debug,日常使用选 Information,如需安静可选 Warning 或 Error。</value></data>
|
||||
|
||||
<!-- Update -->
|
||||
<data name="Update_Title" xml:space="preserve"><value>更新</value></data>
|
||||
<data name="Update_Check" xml:space="preserve"><value>检查更新</value></data>
|
||||
<data name="Update_Download" xml:space="preserve"><value>下载</value></data>
|
||||
<data name="Update_Install" xml:space="preserve"><value>安装并重启</value></data>
|
||||
<data name="Update_Status" xml:space="preserve"><value>状态</value></data>
|
||||
<data name="Update_Log" xml:space="preserve"><value>日志</value></data>
|
||||
<data name="Update_NewVersion" xml:space="preserve"><value>新版本:</value></data>
|
||||
|
||||
<!-- About -->
|
||||
<data name="About_Title" xml:space="preserve"><value>关于 CaptureImage</value></data>
|
||||
<data name="About_Tagline" xml:space="preserve"><value>面向无内置截图键游戏的轻量级 Windows 屏幕截图工具。</value></data>
|
||||
<data name="About_AppLabel" xml:space="preserve"><value>应用</value></data>
|
||||
<data name="About_VersionLabel" xml:space="preserve"><value>版本</value></data>
|
||||
<data name="About_LicenseLabel" xml:space="preserve"><value>许可证</value></data>
|
||||
<data name="About_DeveloperLabel" xml:space="preserve"><value>开发者</value></data>
|
||||
<data name="About_RepositoryLabel" xml:space="preserve"><value>仓库</value></data>
|
||||
<data name="About_AiSection" xml:space="preserve"><value>AI 辅助开发</value></data>
|
||||
<data name="About_DisclaimersSection" xml:space="preserve"><value>免责声明</value></data>
|
||||
<data name="About_TranslationDisclaimer" xml:space="preserve"><value>翻译</value></data>
|
||||
<data name="About_TranslationDisclaimerBody" xml:space="preserve"><value>越南语、阿拉伯语、日语、简体中文、韩语、西班牙语、法语、德语、巴西葡萄牙语和俄语语言包采用机器辅助翻译。术语可能与母语习惯不一致,部分技术术语(hotkey、toast、frame 等)有意保留为英文。欢迎母语为相关语言的志愿者校对,可通过对 src/CaptureImage.UI/Resources/Strings/ 下的 .resx 文件提交 Pull Request。</value></data>
|
||||
<data name="About_CaptureDisclaimer" xml:space="preserve"><value>截图支持</value></data>
|
||||
<data name="About_CaptureLimitationDisclaimerBody" xml:space="preserve"><value>CaptureImage 通过 Windows.Graphics.Capture 可截取大多数窗口化和无边框游戏,但并非所有游戏都受支持。受 DRM 保护的画面、独占全屏 Direct3D 9 游戏以及带反作弊钩子的游戏可能会返回黑屏或拒绝截图。对于旧应用会尝试 GDI PrintWindow 回退。完整列表请参阅 docs/legal/DISCLAIMER.md §2。</value></data>
|
||||
<data name="About_LiabilityDisclaimer" xml:space="preserve"><value>无担保</value></data>
|
||||
<data name="About_LiabilityDisclaimerBody" xml:space="preserve"><value>CaptureImage 按 GPL-3.0-or-later 协议"按原样"分发,不提供任何形式的担保。作者对截图丢失、游戏崩溃、反作弊处罚或数据丢失不承担责任。使用风险自负。完整文本请参阅 docs/legal/DISCLAIMER.md。</value></data>
|
||||
<data name="About_LegalSection" xml:space="preserve"><value>法律文件</value></data>
|
||||
<data name="About_ThirdPartySection" xml:space="preserve"><value>第三方组件</value></data>
|
||||
<data name="About_ThirdPartyHint" xml:space="preserve"><value>单击上方"第三方声明"查看包含上游 URL 的完整列表。</value></data>
|
||||
<data name="About_OpenDisclaimer" xml:space="preserve"><value>免责声明</value></data>
|
||||
<data name="About_OpenPrivacy" xml:space="preserve"><value>隐私</value></data>
|
||||
<data name="About_OpenTerms" xml:space="preserve"><value>条款</value></data>
|
||||
<data name="About_OpenLicense" xml:space="preserve"><value>许可证 (GPL-3.0)</value></data>
|
||||
<data name="About_OpenThirdParty" xml:space="preserve"><value>第三方声明</value></data>
|
||||
<data name="About_OpenContributors" xml:space="preserve"><value>贡献者</value></data>
|
||||
|
||||
<!-- Log viewer -->
|
||||
<data name="Log_Title" xml:space="preserve"><value>实时日志</value></data>
|
||||
<data name="Log_Pause" xml:space="preserve"><value>暂停</value></data>
|
||||
<data name="Log_Resume" xml:space="preserve"><value>继续</value></data>
|
||||
<data name="Log_Clear" xml:space="preserve"><value>清除</value></data>
|
||||
<data name="Log_EventsCount" xml:space="preserve"><value>{0} 条事件</value></data>
|
||||
<data name="Log_EmptyState" xml:space="preserve"><value>尚无日志事件。截图引擎的实时事件将显示在此处。</value></data>
|
||||
<data name="Log_Filter" xml:space="preserve"><value>最低级别:</value></data>
|
||||
<data name="Log_RevealFolder" xml:space="preserve"><value>打开文件夹</value></data>
|
||||
|
||||
<!-- Preview -->
|
||||
<data name="Preview_Title" xml:space="preserve"><value>预览</value></data>
|
||||
<data name="Preview_Prompt" xml:space="preserve"><value>是否保存此截图?</value></data>
|
||||
<data name="Preview_Save" xml:space="preserve"><value>保存</value></data>
|
||||
<data name="Preview_Discard" xml:space="preserve"><value>放弃</value></data>
|
||||
|
||||
<!-- Toasts -->
|
||||
<data name="Toast_CaptureSaved" xml:space="preserve"><value>截图已保存</value></data>
|
||||
<data name="Toast_CaptureFailed" xml:space="preserve"><value>截图失败</value></data>
|
||||
<data name="Toast_SettingsImported" xml:space="preserve"><value>设置已导入</value></data>
|
||||
<data name="Toast_SettingsExported" xml:space="preserve"><value>设置已导出</value></data>
|
||||
<data name="Toast_Error" xml:space="preserve"><value>错误</value></data>
|
||||
|
||||
<!-- Tray menu -->
|
||||
<data name="Tray_ShowWindow" xml:space="preserve"><value>显示 CaptureImage</value></data>
|
||||
<data name="Tray_OpenFolder" xml:space="preserve"><value>打开截图文件夹</value></data>
|
||||
<data name="Tray_Exit" xml:space="preserve"><value>退出</value></data>
|
||||
|
||||
<!-- v1.5 quick wins -->
|
||||
<data name="Settings_Countdown" xml:space="preserve"><value>拍摄倒计时</value></data>
|
||||
<data name="Settings_CountdownOff" xml:space="preserve"><value>关闭(无延迟)</value></data>
|
||||
<data name="Settings_Countdown3s" xml:space="preserve"><value>3 秒</value></data>
|
||||
<data name="Settings_Countdown5s" xml:space="preserve"><value>5 秒</value></data>
|
||||
<data name="Settings_Countdown10s" xml:space="preserve"><value>10 秒</value></data>
|
||||
<data name="Settings_Clipboard" xml:space="preserve"><value>剪贴板模式</value></data>
|
||||
<data name="Settings_ClipboardNone" xml:space="preserve"><value>关闭(仅文件)</value></data>
|
||||
<data name="Settings_ClipboardCopy" xml:space="preserve"><value>仅复制(不保存文件)</value></data>
|
||||
<data name="Settings_ClipboardCopySave" xml:space="preserve"><value>复制 + 保存文件</value></data>
|
||||
<data name="Settings_OpenFolderAfterSave" xml:space="preserve"><value>保存后打开输出文件夹</value></data>
|
||||
<data name="Toast_Countdown" xml:space="preserve"><value>{0} 秒后拍摄…</value></data>
|
||||
<data name="Toast_ClipboardCopied" xml:space="preserve"><value>已复制到剪贴板</value></data>
|
||||
|
||||
<!-- v1.5 pinned thumbnail -->
|
||||
<data name="Settings_AutoPinAfterCapture" xml:space="preserve"><value>每次拍摄后固定一个浮动缩略图</value></data>
|
||||
<data name="PinnedWindow_Open" xml:space="preserve"><value>在资源管理器中显示</value></data>
|
||||
<data name="PinnedWindow_Close" xml:space="preserve"><value>关闭</value></data>
|
||||
|
||||
<!-- v1.5 OCR -->
|
||||
<data name="Preview_ExtractText" xml:space="preserve"><value>提取文字 (OCR)</value></data>
|
||||
<data name="Toast_OcrSuccess" xml:space="preserve"><value>已复制 {0} 个词</value></data>
|
||||
<data name="Toast_OcrEmpty" xml:space="preserve"><value>图像中未发现文字</value></data>
|
||||
<data name="Toast_OcrUnavailable" xml:space="preserve"><value>该语言的 OCR 引擎不可用</value></data>
|
||||
|
||||
<!-- v1.5 region capture -->
|
||||
<data name="Settings_CaptureMode" xml:space="preserve"><value>拍摄模式</value></data>
|
||||
<data name="Settings_CaptureModeWindow" xml:space="preserve"><value>单个窗口</value></data>
|
||||
<data name="Settings_CaptureModeRegion" xml:space="preserve"><value>区域(拖动选择)</value></data>
|
||||
<data name="Region_TargetName" xml:space="preserve"><value>区域</value></data>
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>拖动一个矩形。按 Esc 取消。</value></data>
|
||||
|
||||
</root>
|
||||
@@ -0,0 +1,50 @@
|
||||
using CaptureImage.Core.Abstractions;
|
||||
using CaptureImage.UI.Views;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace CaptureImage.UI.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Spawns <see cref="PinnedThumbnailWindow"/> instances on demand. Hops to the UI
|
||||
/// thread because <see cref="DashboardViewModel"/> can fire Show from a continuation
|
||||
/// thread after the encoder finishes.
|
||||
/// </summary>
|
||||
public sealed class PinnedThumbnailHost : IPinnedThumbnailHost
|
||||
{
|
||||
private readonly IUIThreadDispatcher _dispatcher;
|
||||
private readonly ILocalizationService _localization;
|
||||
private readonly ISettingsStore _settings;
|
||||
private readonly ILogger<PinnedThumbnailHost> _logger;
|
||||
|
||||
public PinnedThumbnailHost(
|
||||
IUIThreadDispatcher dispatcher,
|
||||
ILocalizationService localization,
|
||||
ISettingsStore settings,
|
||||
ILogger<PinnedThumbnailHost> logger)
|
||||
{
|
||||
_dispatcher = dispatcher;
|
||||
_localization = localization;
|
||||
_settings = settings;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public void Show(byte[] pngBytes, string? filePath, string targetName)
|
||||
{
|
||||
if (pngBytes is null || pngBytes.Length == 0) return;
|
||||
|
||||
_dispatcher.Post(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var window = new PinnedThumbnailWindow(_localization);
|
||||
window.SetThumbnail(pngBytes, filePath, targetName);
|
||||
window.AttachThemeStore(_settings);
|
||||
window.Activate();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "Failed to spawn pinned thumbnail window.");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -21,11 +21,25 @@ public sealed class PreviewPresenter : IPreviewPresenter
|
||||
{
|
||||
private readonly IUIThreadDispatcher _dispatcher;
|
||||
private readonly ILocalizationService _localization;
|
||||
private readonly ISettingsStore _settings;
|
||||
private readonly IOcrService _ocr;
|
||||
private readonly IClipboardService _clipboard;
|
||||
private readonly IToastService _toasts;
|
||||
|
||||
public PreviewPresenter(IUIThreadDispatcher dispatcher, ILocalizationService localization)
|
||||
public PreviewPresenter(
|
||||
IUIThreadDispatcher dispatcher,
|
||||
ILocalizationService localization,
|
||||
ISettingsStore settings,
|
||||
IOcrService ocr,
|
||||
IClipboardService clipboard,
|
||||
IToastService toasts)
|
||||
{
|
||||
_dispatcher = dispatcher;
|
||||
_localization = localization;
|
||||
_settings = settings;
|
||||
_ocr = ocr;
|
||||
_clipboard = clipboard;
|
||||
_toasts = toasts;
|
||||
}
|
||||
|
||||
public async Task<bool> ShowAsync(
|
||||
@@ -43,11 +57,15 @@ public sealed class PreviewPresenter : IPreviewPresenter
|
||||
{
|
||||
try
|
||||
{
|
||||
var vm = new PreviewViewModel(_localization);
|
||||
var vm = new PreviewViewModel(_localization, _ocr, _clipboard, _toasts);
|
||||
vm.SetFrame(frame, target, pngBytes);
|
||||
|
||||
var window = new PreviewWindow();
|
||||
window.SetViewModel(vm);
|
||||
// Bind to the settings store BEFORE Activate so the very first paint
|
||||
// already has the correct theme — avoids a Light→Dark flash for users
|
||||
// running Dark mode.
|
||||
window.AttachThemeStore(_settings);
|
||||
window.Activate();
|
||||
|
||||
_ = WaitForResultAsync(window, vm, tcs);
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using CaptureImage.Core.Abstractions;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Windows.ApplicationModel.DataTransfer;
|
||||
using Windows.Storage.Streams;
|
||||
|
||||
namespace CaptureImage.UI.Services;
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="IClipboardService"/> backed by the WinRT clipboard. Wraps
|
||||
/// <c>Windows.ApplicationModel.DataTransfer.Clipboard.SetContent</c> with a
|
||||
/// PNG <c>InMemoryRandomAccessStream</c> so the receiving app pastes a real bitmap
|
||||
/// (Paint, Word, etc.) rather than a file reference.
|
||||
/// </summary>
|
||||
public sealed class WinAppSDKClipboardService : IClipboardService
|
||||
{
|
||||
private readonly ILogger<WinAppSDKClipboardService> _logger;
|
||||
|
||||
public WinAppSDKClipboardService(ILogger<WinAppSDKClipboardService> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public async Task<bool> CopyImageAsync(byte[] pngBytes, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (pngBytes is null || pngBytes.Length == 0) return false;
|
||||
|
||||
try
|
||||
{
|
||||
// Need an InMemoryRandomAccessStream the DataPackage can hold a reference to —
|
||||
// the DataTransferManager copies bytes lazily, so a MemoryStream wrapper would
|
||||
// get GC'd before the receiving app pastes.
|
||||
var stream = new InMemoryRandomAccessStream();
|
||||
await stream.WriteAsync(pngBytes.AsBuffer()).AsTask(cancellationToken).ConfigureAwait(false);
|
||||
stream.Seek(0);
|
||||
|
||||
var package = new DataPackage();
|
||||
package.SetBitmap(RandomAccessStreamReference.CreateFromStream(stream));
|
||||
|
||||
Clipboard.SetContent(package);
|
||||
// Flush makes the data survive process exit — important for capture-and-quit
|
||||
// scripted workflows. No exception here means SetContent accepted the package.
|
||||
Clipboard.Flush();
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "Failed to copy captured image to clipboard.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool CopyText(string text)
|
||||
{
|
||||
if (text is null) return false;
|
||||
try
|
||||
{
|
||||
var package = new DataPackage();
|
||||
package.SetText(text);
|
||||
Clipboard.SetContent(package);
|
||||
Clipboard.Flush();
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "Failed to copy text to clipboard.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,208 @@
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
using CaptureImage.Core.Abstractions;
|
||||
using CaptureImage.Core.Models;
|
||||
using CaptureImage.UI.Theming;
|
||||
using CaptureImage.UI.Views;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.UI.Xaml;
|
||||
|
||||
namespace CaptureImage.UI.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Region-capture flow:
|
||||
/// 1. Capture the primary monitor pixels in one shot via GDI <c>CopyFromScreen</c>.
|
||||
/// 2. Encode that screenshot as PNG so the overlay can show it as a background.
|
||||
/// 3. Open <see cref="RegionSelectorOverlay"/> — user drags a rectangle (Esc cancels).
|
||||
/// 4. Crop the original BGRA buffer to the user's rectangle and return a
|
||||
/// <see cref="CapturedFrame"/> ready to feed into the existing save pipeline.
|
||||
///
|
||||
/// Capturing the screen BEFORE showing the overlay means the overlay never appears
|
||||
/// inside the screenshot.
|
||||
/// </summary>
|
||||
[SupportedOSPlatform("windows")]
|
||||
public sealed class WindowsRegionCaptureService : IRegionCaptureService
|
||||
{
|
||||
private readonly IUIThreadDispatcher _dispatcher;
|
||||
private readonly ISettingsStore _settings;
|
||||
private readonly ILocalizationService _localization;
|
||||
private readonly ILogger<WindowsRegionCaptureService> _logger;
|
||||
|
||||
public WindowsRegionCaptureService(
|
||||
IUIThreadDispatcher dispatcher,
|
||||
ISettingsStore settings,
|
||||
ILocalizationService localization,
|
||||
ILogger<WindowsRegionCaptureService> logger)
|
||||
{
|
||||
_dispatcher = dispatcher;
|
||||
_settings = settings;
|
||||
_localization = localization;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public async Task<CapturedFrame?> SelectAndCaptureAsync(CancellationToken cancellationToken = default)
|
||||
{
|
||||
// Capture the primary monitor immediately so the overlay is never inside the shot.
|
||||
var (bgraPixels, screenWidth, screenHeight) = CaptureScreen();
|
||||
if (bgraPixels is null) return null;
|
||||
|
||||
var pngBytes = EncodePng(bgraPixels, screenWidth, screenHeight);
|
||||
|
||||
var tcs = new TaskCompletionSource<RegionSelectionResult?>(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||
|
||||
_dispatcher.Post(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var hint = _localization["Region_DragHint"];
|
||||
var overlay = new RegionSelectorOverlay(pngBytes, screenWidth, screenHeight, hint);
|
||||
ThemeApplicator.Apply(overlay.Content as FrameworkElement, _settings.Current.Theme);
|
||||
overlay.Activate();
|
||||
|
||||
_ = WaitForResultAsync(overlay, tcs);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
tcs.TrySetException(ex);
|
||||
}
|
||||
});
|
||||
|
||||
using (cancellationToken.Register(() => tcs.TrySetResult(null)))
|
||||
{
|
||||
var result = await tcs.Task.ConfigureAwait(false);
|
||||
if (result is null) return null;
|
||||
|
||||
// Clamp to screen bounds — the overlay can only land within them, but
|
||||
// belt+braces in case of float-rounding edge cases.
|
||||
var x = Math.Clamp(result.X, 0, screenWidth - 1);
|
||||
var y = Math.Clamp(result.Y, 0, screenHeight - 1);
|
||||
var w = Math.Clamp(result.Width, 1, screenWidth - x);
|
||||
var h = Math.Clamp(result.Height, 1, screenHeight - y);
|
||||
|
||||
return CropToBgraFrame(bgraPixels, screenWidth, screenHeight, x, y, w, h);
|
||||
}
|
||||
}
|
||||
|
||||
private static async Task WaitForResultAsync(
|
||||
RegionSelectorOverlay overlay,
|
||||
TaskCompletionSource<RegionSelectionResult?> tcs)
|
||||
{
|
||||
try
|
||||
{
|
||||
var r = await overlay.ResultAsync.ConfigureAwait(true);
|
||||
tcs.TrySetResult(r);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
tcs.TrySetException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private (byte[]? Pixels, int Width, int Height) CaptureScreen()
|
||||
{
|
||||
// GetSystemMetrics SM_CXSCREEN / SM_CYSCREEN — primary monitor in physical pixels
|
||||
// on a per-monitor-DPI-aware app. v1.5 ships single-monitor; multi-monitor +
|
||||
// DPI per monitor lands in v1.6.
|
||||
var width = NativeMethods.GetSystemMetrics(NativeMethods.SM_CXSCREEN);
|
||||
var height = NativeMethods.GetSystemMetrics(NativeMethods.SM_CYSCREEN);
|
||||
if (width <= 0 || height <= 0)
|
||||
{
|
||||
_logger.LogWarning("Could not determine screen dimensions for region capture.");
|
||||
return (null, 0, 0);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
using var bitmap = new Bitmap(width, height, PixelFormat.Format32bppArgb);
|
||||
using (var g = Graphics.FromImage(bitmap))
|
||||
{
|
||||
g.CopyFromScreen(0, 0, 0, 0, new Size(width, height), CopyPixelOperation.SourceCopy);
|
||||
}
|
||||
|
||||
var data = bitmap.LockBits(
|
||||
new Rectangle(0, 0, width, height),
|
||||
ImageLockMode.ReadOnly,
|
||||
PixelFormat.Format32bppArgb);
|
||||
try
|
||||
{
|
||||
var stride = data.Stride;
|
||||
var bytes = new byte[stride * height];
|
||||
Marshal.Copy(data.Scan0, bytes, 0, bytes.Length);
|
||||
// GDI 32bppArgb on little-endian is BGRA in memory — same layout the
|
||||
// existing encoders expect. Pass through unchanged.
|
||||
return (bytes, width, height);
|
||||
}
|
||||
finally
|
||||
{
|
||||
bitmap.UnlockBits(data);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Region capture failed while reading screen pixels.");
|
||||
return (null, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
private static byte[] EncodePng(byte[] bgraPixels, int width, int height)
|
||||
{
|
||||
var stride = bgraPixels.Length / height;
|
||||
using var bitmap = new Bitmap(width, height, PixelFormat.Format32bppArgb);
|
||||
var data = bitmap.LockBits(
|
||||
new Rectangle(0, 0, width, height),
|
||||
ImageLockMode.WriteOnly,
|
||||
PixelFormat.Format32bppArgb);
|
||||
try
|
||||
{
|
||||
// If the source stride matches the GDI bitmap stride we can blit; otherwise
|
||||
// copy row-by-row to honour the source padding.
|
||||
if (stride == data.Stride)
|
||||
{
|
||||
Marshal.Copy(bgraPixels, 0, data.Scan0, bgraPixels.Length);
|
||||
}
|
||||
else
|
||||
{
|
||||
var rowLen = width * 4;
|
||||
for (var y = 0; y < height; y++)
|
||||
{
|
||||
Marshal.Copy(bgraPixels, y * stride, IntPtr.Add(data.Scan0, y * data.Stride), rowLen);
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
bitmap.UnlockBits(data);
|
||||
}
|
||||
|
||||
using var ms = new MemoryStream();
|
||||
bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
|
||||
return ms.ToArray();
|
||||
}
|
||||
|
||||
private static CapturedFrame CropToBgraFrame(
|
||||
byte[] sourceBgra, int srcWidth, int srcHeight,
|
||||
int x, int y, int width, int height)
|
||||
{
|
||||
var srcStride = sourceBgra.Length / srcHeight;
|
||||
var dstStride = width * 4;
|
||||
var dst = new byte[dstStride * height];
|
||||
for (var row = 0; row < height; row++)
|
||||
{
|
||||
var srcOffset = (y + row) * srcStride + x * 4;
|
||||
var dstOffset = row * dstStride;
|
||||
Buffer.BlockCopy(sourceBgra, srcOffset, dst, dstOffset, dstStride);
|
||||
}
|
||||
return new CapturedFrame(width, height, dstStride, dst);
|
||||
}
|
||||
|
||||
private static class NativeMethods
|
||||
{
|
||||
internal const int SM_CXSCREEN = 0;
|
||||
internal const int SM_CYSCREEN = 1;
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
internal static extern int GetSystemMetrics(int nIndex);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using Microsoft.UI.Dispatching;
|
||||
using Microsoft.UI.Xaml;
|
||||
|
||||
namespace CaptureImage.UI.Theming;
|
||||
|
||||
/// <summary>
|
||||
/// Single source of truth for mapping the persisted theme string
|
||||
/// (<c>"Light"</c> / <c>"Dark"</c> / anything else → System) onto a window's
|
||||
/// <see cref="FrameworkElement.RequestedTheme"/>. Both <c>MainWindow</c> and
|
||||
/// secondary windows (Preview, pinned thumbnail) call into here so the
|
||||
/// switch lives in one place and never drifts.
|
||||
/// </summary>
|
||||
public static class ThemeApplicator
|
||||
{
|
||||
/// <summary>
|
||||
/// Apply the theme string to the given root element. Safe to call from any
|
||||
/// thread — the actual property assignment is hopped onto the dispatcher.
|
||||
/// A null root is a no-op (the window may not be loaded yet).
|
||||
/// </summary>
|
||||
public static void Apply(FrameworkElement? root, string theme)
|
||||
{
|
||||
if (root is null) return;
|
||||
|
||||
root.DispatcherQueue.TryEnqueue(DispatcherQueuePriority.Normal, () =>
|
||||
{
|
||||
root.RequestedTheme = theme switch
|
||||
{
|
||||
"Light" => ElementTheme.Light,
|
||||
"Dark" => ElementTheme.Dark,
|
||||
_ => ElementTheme.Default,
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Window
|
||||
x:Class="CaptureImage.UI.Views.PinnedThumbnailWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid x:Name="Root" Margin="0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Drag-handle title bar. Mica + ExtendsContentIntoTitleBar already makes the
|
||||
top strip draggable; the buttons sit on top with HitTestVisible. -->
|
||||
<Grid Grid.Row="0"
|
||||
Height="32"
|
||||
ColumnSpacing="4"
|
||||
Padding="8,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="0"
|
||||
x:Name="TitleText"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="{StaticResource FontSizeCaption}"
|
||||
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||
TextTrimming="CharacterEllipsis" />
|
||||
<Button Grid.Column="1"
|
||||
x:Name="OpenFileButton"
|
||||
Click="OnOpenFileClick"
|
||||
ToolTipService.ToolTip="{Binding Localization[PinnedWindow_Open]}"
|
||||
Background="Transparent"
|
||||
BorderBrush="Transparent"
|
||||
Padding="6,2">
|
||||
<FontIcon Glyph="" FontSize="14" />
|
||||
</Button>
|
||||
<Button Grid.Column="2"
|
||||
x:Name="CloseButton"
|
||||
Click="OnCloseClick"
|
||||
ToolTipService.ToolTip="{Binding Localization[PinnedWindow_Close]}"
|
||||
Background="Transparent"
|
||||
BorderBrush="Transparent"
|
||||
Padding="6,2">
|
||||
<FontIcon Glyph="" FontSize="12" />
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
<!-- Thumbnail image -->
|
||||
<Border Grid.Row="1"
|
||||
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
|
||||
BorderThickness="1,1,1,0"
|
||||
CornerRadius="0"
|
||||
Background="#111111">
|
||||
<Image x:Name="ThumbnailImage"
|
||||
Stretch="Uniform"
|
||||
Margin="0" />
|
||||
</Border>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,115 @@
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using CaptureImage.Core.Abstractions;
|
||||
using CaptureImage.UI.Theming;
|
||||
using Microsoft.UI;
|
||||
using Microsoft.UI.Composition.SystemBackdrops;
|
||||
using Microsoft.UI.Windowing;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Microsoft.UI.Xaml.Media.Imaging;
|
||||
using Windows.Graphics;
|
||||
using Windows.Storage.Streams;
|
||||
using WinRT.Interop;
|
||||
|
||||
namespace CaptureImage.UI.Views;
|
||||
|
||||
/// <summary>
|
||||
/// Small always-on-top floating window that shows a thumbnail of the most recent capture.
|
||||
/// Each capture spawns a fresh instance so users can pin several side-by-side.
|
||||
/// </summary>
|
||||
public sealed partial class PinnedThumbnailWindow : Window
|
||||
{
|
||||
private const int InitialWidth = 280;
|
||||
private const int InitialHeight = 220;
|
||||
|
||||
private readonly ILocalizationService _localization;
|
||||
private ISettingsStore? _settings;
|
||||
private string? _filePath;
|
||||
|
||||
/// <summary>Localization service exposed for XAML <c>{Binding Localization[...]}</c>.</summary>
|
||||
public ILocalizationService Localization => _localization;
|
||||
|
||||
public PinnedThumbnailWindow(ILocalizationService localization)
|
||||
{
|
||||
InitializeComponent();
|
||||
_localization = localization;
|
||||
Root.DataContext = this;
|
||||
|
||||
Title = "CaptureImage";
|
||||
SystemBackdrop = new MicaBackdrop { Kind = MicaKind.Base };
|
||||
ExtendsContentIntoTitleBar = true;
|
||||
|
||||
var hwnd = WindowNative.GetWindowHandle(this);
|
||||
var windowId = Win32Interop.GetWindowIdFromWindow(hwnd);
|
||||
var appWindow = AppWindow.GetFromWindowId(windowId);
|
||||
appWindow.Resize(new SizeInt32(InitialWidth, InitialHeight));
|
||||
|
||||
// OverlappedPresenter.IsAlwaysOnTop pins the window above other top-level windows
|
||||
// without needing SetWindowPos(HWND_TOPMOST). Drop the maximize button — the
|
||||
// thumbnail is meant to stay small.
|
||||
if (appWindow.Presenter is OverlappedPresenter presenter)
|
||||
{
|
||||
presenter.IsAlwaysOnTop = true;
|
||||
presenter.IsMaximizable = false;
|
||||
}
|
||||
|
||||
Closed += OnClosed;
|
||||
}
|
||||
|
||||
public void SetThumbnail(byte[] pngBytes, string? filePath, string targetName)
|
||||
{
|
||||
_filePath = filePath;
|
||||
TitleText.Text = targetName;
|
||||
|
||||
var bitmap = new BitmapImage();
|
||||
using (var stream = new InMemoryRandomAccessStream())
|
||||
{
|
||||
stream.WriteAsync(pngBytes.AsBuffer()).AsTask().GetAwaiter().GetResult();
|
||||
stream.Seek(0);
|
||||
bitmap.SetSource(stream);
|
||||
}
|
||||
ThumbnailImage.Source = bitmap;
|
||||
}
|
||||
|
||||
public void AttachThemeStore(ISettingsStore settings)
|
||||
{
|
||||
_settings = settings;
|
||||
ThemeApplicator.Apply(Content as FrameworkElement, settings.Current.Theme);
|
||||
settings.Changed += OnSettingsChanged;
|
||||
}
|
||||
|
||||
private void OnSettingsChanged(object? sender, EventArgs e)
|
||||
{
|
||||
if (_settings is null) return;
|
||||
ThemeApplicator.Apply(Content as FrameworkElement, _settings.Current.Theme);
|
||||
}
|
||||
|
||||
private void OnOpenFileClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(_filePath)) return;
|
||||
try
|
||||
{
|
||||
// /select highlights the file in Explorer rather than opening it.
|
||||
Process.Start(new ProcessStartInfo("explorer.exe", $"/select,\"{_filePath}\"")
|
||||
{
|
||||
UseShellExecute = true,
|
||||
});
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Best-effort — failure here just means the user clicks Open and nothing happens.
|
||||
}
|
||||
}
|
||||
|
||||
private void OnCloseClick(object sender, RoutedEventArgs e) => Close();
|
||||
|
||||
private void OnClosed(object sender, WindowEventArgs args)
|
||||
{
|
||||
if (_settings is not null)
|
||||
{
|
||||
_settings.Changed -= OnSettingsChanged;
|
||||
_settings = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,24 +43,38 @@
|
||||
Margin="8" />
|
||||
</Border>
|
||||
|
||||
<!-- Accept / discard -->
|
||||
<StackPanel Grid.Row="2"
|
||||
Orientation="Horizontal"
|
||||
HorizontalAlignment="Right"
|
||||
Spacing="8"
|
||||
Margin="0,12,0,0">
|
||||
<TextBlock Text="{Binding Localization[Preview_Prompt]}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,0,12,0" />
|
||||
<Button x:Name="DiscardButton"
|
||||
Content="{Binding Localization[Preview_Discard]}"
|
||||
Click="OnDiscardClick"
|
||||
MinWidth="100" />
|
||||
<Button x:Name="SaveButton"
|
||||
Content="{Binding Localization[Preview_Save]}"
|
||||
Style="{StaticResource AccentButtonStyle}"
|
||||
Click="OnSaveClick"
|
||||
MinWidth="100" />
|
||||
</StackPanel>
|
||||
<!-- Accept / discard / OCR -->
|
||||
<Grid Grid.Row="2" Margin="0,12,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Extract text (OCR) button on the leading edge — calls into the VM. -->
|
||||
<Button Grid.Column="0"
|
||||
x:Name="ExtractTextButton"
|
||||
Content="{Binding Localization[Preview_ExtractText]}"
|
||||
Command="{Binding ExtractTextCommand}"
|
||||
MinWidth="140" />
|
||||
|
||||
<StackPanel Grid.Column="2"
|
||||
Orientation="Horizontal"
|
||||
HorizontalAlignment="Right"
|
||||
Spacing="8">
|
||||
<TextBlock Text="{Binding Localization[Preview_Prompt]}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,0,12,0" />
|
||||
<Button x:Name="DiscardButton"
|
||||
Content="{Binding Localization[Preview_Discard]}"
|
||||
Click="OnDiscardClick"
|
||||
MinWidth="100" />
|
||||
<Button x:Name="SaveButton"
|
||||
Content="{Binding Localization[Preview_Save]}"
|
||||
Style="{StaticResource AccentButtonStyle}"
|
||||
Click="OnSaveClick"
|
||||
MinWidth="100" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -1,3 +1,5 @@
|
||||
using CaptureImage.Core.Abstractions;
|
||||
using CaptureImage.UI.Theming;
|
||||
using CaptureImage.ViewModels.Preview;
|
||||
using Microsoft.UI;
|
||||
using Microsoft.UI.Composition.SystemBackdrops;
|
||||
@@ -21,6 +23,8 @@ public sealed partial class PreviewWindow : Window
|
||||
private readonly TaskCompletionSource<bool> _result =
|
||||
new(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||
|
||||
private ISettingsStore? _settings;
|
||||
|
||||
public PreviewWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -45,6 +49,25 @@ public sealed partial class PreviewWindow : Window
|
||||
Root.DataContext = vm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Bind this preview window to the app's <see cref="ISettingsStore"/> so its theme
|
||||
/// matches MainWindow at open time AND tracks live changes (user toggles theme in
|
||||
/// Settings while the preview is open). The <c>Closed</c> handler unsubscribes so
|
||||
/// each preview doesn't leak a handler into the singleton store.
|
||||
/// </summary>
|
||||
public void AttachThemeStore(ISettingsStore settings)
|
||||
{
|
||||
_settings = settings;
|
||||
ThemeApplicator.Apply(Content as FrameworkElement, settings.Current.Theme);
|
||||
settings.Changed += OnSettingsChanged;
|
||||
}
|
||||
|
||||
private void OnSettingsChanged(object? sender, EventArgs e)
|
||||
{
|
||||
if (_settings is null) return;
|
||||
ThemeApplicator.Apply(Content as FrameworkElement, _settings.Current.Theme);
|
||||
}
|
||||
|
||||
private void OnSaveClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_result.TrySetResult(true);
|
||||
@@ -59,6 +82,11 @@ public sealed partial class PreviewWindow : Window
|
||||
|
||||
private void OnClosed(object sender, WindowEventArgs args)
|
||||
{
|
||||
if (_settings is not null)
|
||||
{
|
||||
_settings.Changed -= OnSettingsChanged;
|
||||
_settings = null;
|
||||
}
|
||||
// Closing via the X button counts as discard.
|
||||
_result.TrySetResult(false);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Window
|
||||
x:Class="CaptureImage.UI.Views.RegionSelectorOverlay"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid x:Name="Root"
|
||||
Background="#80000000"
|
||||
PointerPressed="OnPointerPressed"
|
||||
PointerMoved="OnPointerMoved"
|
||||
PointerReleased="OnPointerReleased"
|
||||
KeyDown="OnKeyDown">
|
||||
<!-- Background screenshot used as a hint of what is being selected. The image
|
||||
below the dim overlay shows through inside the selection rectangle so the
|
||||
user sees a "spotlight" effect on the chosen region. -->
|
||||
<Image x:Name="BackgroundImage"
|
||||
Stretch="Fill"
|
||||
Opacity="0.35"
|
||||
IsHitTestVisible="False" />
|
||||
|
||||
<!-- Selection rectangle. Visible while the user drags; positioned via Canvas.SetLeft. -->
|
||||
<Canvas IsHitTestVisible="False">
|
||||
<Border x:Name="SelectionBorder"
|
||||
Visibility="Collapsed"
|
||||
BorderBrush="#FFFF6B35"
|
||||
BorderThickness="2"
|
||||
Background="Transparent">
|
||||
<Image x:Name="SelectionImage" Stretch="Fill" />
|
||||
</Border>
|
||||
<Border x:Name="DimensionBadge"
|
||||
Visibility="Collapsed"
|
||||
Background="#FF1F2937"
|
||||
BorderBrush="#FFFF6B35"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4"
|
||||
Padding="6,2">
|
||||
<TextBlock x:Name="DimensionText"
|
||||
Foreground="White"
|
||||
FontSize="12" />
|
||||
</Border>
|
||||
</Canvas>
|
||||
|
||||
<!-- Hint shown when no selection is active. -->
|
||||
<TextBlock x:Name="HintText"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top"
|
||||
Margin="0,32,0,0"
|
||||
FontSize="14"
|
||||
Foreground="White"
|
||||
Opacity="0.85"
|
||||
IsHitTestVisible="False" />
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,177 @@
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using CaptureImage.Core.Abstractions;
|
||||
using Microsoft.UI;
|
||||
using Microsoft.UI.Windowing;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Input;
|
||||
using Microsoft.UI.Xaml.Media.Imaging;
|
||||
using Windows.Foundation;
|
||||
using Windows.Graphics;
|
||||
using Windows.Storage.Streams;
|
||||
using Windows.System;
|
||||
using WinRT.Interop;
|
||||
|
||||
namespace CaptureImage.UI.Views;
|
||||
|
||||
/// <summary>
|
||||
/// Full-screen primary-monitor overlay that lets the user drag a rectangle over the
|
||||
/// pre-captured desktop screenshot. Returns the selected region in pixel coordinates
|
||||
/// via <see cref="ResultAsync"/>. Esc cancels (yields null).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// v1.5 covers the primary monitor only. Multi-monitor + per-monitor DPI is on the
|
||||
/// v1.6 roadmap. The overlay shows the captured screen dimmed at 35% opacity; the
|
||||
/// user's selection rectangle re-shows the image through a clip so the chosen area
|
||||
/// stands out without re-capturing (which would race with the overlay itself).
|
||||
/// </remarks>
|
||||
public sealed partial class RegionSelectorOverlay : Window
|
||||
{
|
||||
private readonly TaskCompletionSource<RegionSelectionResult?> _result =
|
||||
new(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||
|
||||
private readonly int _screenWidth;
|
||||
private readonly int _screenHeight;
|
||||
private readonly byte[] _backgroundPngBytes;
|
||||
|
||||
private bool _selecting;
|
||||
private Point _selectionStart;
|
||||
|
||||
public RegionSelectorOverlay(byte[] backgroundPngBytes, int screenWidth, int screenHeight, string hintText)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
_backgroundPngBytes = backgroundPngBytes;
|
||||
_screenWidth = screenWidth;
|
||||
_screenHeight = screenHeight;
|
||||
HintText.Text = hintText;
|
||||
|
||||
Title = "CaptureImage region";
|
||||
ExtendsContentIntoTitleBar = true;
|
||||
|
||||
var hwnd = WindowNative.GetWindowHandle(this);
|
||||
var windowId = Win32Interop.GetWindowIdFromWindow(hwnd);
|
||||
var appWindow = AppWindow.GetFromWindowId(windowId);
|
||||
|
||||
// Borderless full-screen presenter so there's no chrome and no taskbar visible.
|
||||
appWindow.SetPresenter(AppWindowPresenterKind.FullScreen);
|
||||
appWindow.MoveAndResize(new RectInt32(0, 0, screenWidth, screenHeight));
|
||||
|
||||
Closed += OnClosed;
|
||||
Activated += OnActivated;
|
||||
|
||||
var bitmap = new BitmapImage();
|
||||
using (var stream = new InMemoryRandomAccessStream())
|
||||
{
|
||||
stream.WriteAsync(backgroundPngBytes.AsBuffer()).AsTask().GetAwaiter().GetResult();
|
||||
stream.Seek(0);
|
||||
bitmap.SetSource(stream);
|
||||
}
|
||||
BackgroundImage.Source = bitmap;
|
||||
SelectionImage.Source = bitmap;
|
||||
}
|
||||
|
||||
/// <summary>Resolves to the selected rectangle in pixel coords, or null if cancelled.</summary>
|
||||
public Task<RegionSelectionResult?> ResultAsync => _result.Task;
|
||||
|
||||
private void OnActivated(object sender, WindowActivatedEventArgs args)
|
||||
{
|
||||
// Ensure the overlay grabs keyboard focus so Esc/Enter are routed here.
|
||||
if (args.WindowActivationState != WindowActivationState.Deactivated)
|
||||
{
|
||||
Root.Focus(FocusState.Programmatic);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnPointerPressed(object sender, PointerRoutedEventArgs e)
|
||||
{
|
||||
_selecting = true;
|
||||
_selectionStart = e.GetCurrentPoint(Root).Position;
|
||||
SelectionBorder.Visibility = Visibility.Visible;
|
||||
DimensionBadge.Visibility = Visibility.Visible;
|
||||
UpdateSelection(_selectionStart);
|
||||
Root.CapturePointer(e.Pointer);
|
||||
}
|
||||
|
||||
private void OnPointerMoved(object sender, PointerRoutedEventArgs e)
|
||||
{
|
||||
if (!_selecting) return;
|
||||
UpdateSelection(e.GetCurrentPoint(Root).Position);
|
||||
}
|
||||
|
||||
private void OnPointerReleased(object sender, PointerRoutedEventArgs e)
|
||||
{
|
||||
if (!_selecting) return;
|
||||
_selecting = false;
|
||||
Root.ReleasePointerCapture(e.Pointer);
|
||||
|
||||
var end = e.GetCurrentPoint(Root).Position;
|
||||
var rect = NormalizeRect(_selectionStart, end);
|
||||
|
||||
if (rect.Width < 4 || rect.Height < 4)
|
||||
{
|
||||
// Treat micro-drags as a cancel — likely a mis-click.
|
||||
_result.TrySetResult(null);
|
||||
Close();
|
||||
return;
|
||||
}
|
||||
|
||||
// The overlay is sized to the screen pixel dimensions, so DIP coords map 1:1
|
||||
// when the overlay window's DPI matches the source capture (true on a single
|
||||
// 100% DPI monitor; v1.6 will add per-monitor scaling).
|
||||
_result.TrySetResult(new RegionSelectionResult(
|
||||
X: (int)Math.Round(rect.X),
|
||||
Y: (int)Math.Round(rect.Y),
|
||||
Width: (int)Math.Round(rect.Width),
|
||||
Height: (int)Math.Round(rect.Height)));
|
||||
Close();
|
||||
}
|
||||
|
||||
private void OnKeyDown(object sender, KeyRoutedEventArgs e)
|
||||
{
|
||||
if (e.Key == VirtualKey.Escape)
|
||||
{
|
||||
_result.TrySetResult(null);
|
||||
Close();
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateSelection(Point current)
|
||||
{
|
||||
var rect = NormalizeRect(_selectionStart, current);
|
||||
Canvas.SetLeft(SelectionBorder, rect.X);
|
||||
Canvas.SetTop(SelectionBorder, rect.Y);
|
||||
SelectionBorder.Width = rect.Width;
|
||||
SelectionBorder.Height = rect.Height;
|
||||
|
||||
// Position the inner image so it lines up with the same pixels of the underlying
|
||||
// screenshot — i.e. the visible selection shows the image at full opacity for
|
||||
// exactly the chosen region.
|
||||
SelectionImage.Width = _screenWidth;
|
||||
SelectionImage.Height = _screenHeight;
|
||||
Canvas.SetLeft(SelectionImage, -rect.X);
|
||||
Canvas.SetTop(SelectionImage, -rect.Y);
|
||||
|
||||
DimensionText.Text = $"{(int)rect.Width} × {(int)rect.Height}";
|
||||
Canvas.SetLeft(DimensionBadge, rect.X);
|
||||
Canvas.SetTop(DimensionBadge, rect.Y - 26);
|
||||
}
|
||||
|
||||
private static Rect NormalizeRect(Point a, Point b)
|
||||
{
|
||||
var x = Math.Min(a.X, b.X);
|
||||
var y = Math.Min(a.Y, b.Y);
|
||||
var w = Math.Abs(a.X - b.X);
|
||||
var h = Math.Abs(a.Y - b.Y);
|
||||
return new Rect(x, y, w, h);
|
||||
}
|
||||
|
||||
private void OnClosed(object sender, WindowEventArgs args)
|
||||
{
|
||||
_result.TrySetResult(null);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Pixel-coordinate result yielded by <see cref="RegionSelectorOverlay"/>.</summary>
|
||||
public sealed record RegionSelectionResult(int X, int Y, int Width, int Height);
|
||||
@@ -32,6 +32,23 @@
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Theme: System / Light / Dark. ItemTemplate binds to ThemeOption.DisplayLabel
|
||||
(already localized in the VM by RebuildThemeOptions). -->
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="{Binding ThemeLabel}"
|
||||
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||
FontSize="{StaticResource FontSizeSmall}" />
|
||||
<ComboBox ItemsSource="{Binding SupportedThemes}"
|
||||
SelectedItem="{Binding SelectedTheme, Mode=TwoWay}"
|
||||
HorizontalAlignment="Stretch">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DisplayLabel}" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Hotkey: HotkeyRecorder custom control owns the key-capture flow. Bound
|
||||
to the SettingsViewModel.Hotkey child VM (HotkeyBindingViewModel). -->
|
||||
<StackPanel Spacing="4">
|
||||
@@ -116,14 +133,75 @@
|
||||
FontFamily="Consolas, Courier New" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Capture mode (Window / Region) -->
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="{Binding CaptureModeLabel}"
|
||||
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||
FontSize="{StaticResource FontSizeSmall}" />
|
||||
<ComboBox ItemsSource="{Binding SupportedCaptureModes}"
|
||||
SelectedItem="{Binding SelectedCaptureMode, Mode=TwoWay}"
|
||||
HorizontalAlignment="Stretch">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DisplayLabel}" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Capture countdown -->
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="{Binding CountdownLabel}"
|
||||
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||
FontSize="{StaticResource FontSizeSmall}" />
|
||||
<ComboBox ItemsSource="{Binding SupportedCountdowns}"
|
||||
SelectedItem="{Binding SelectedCountdown, Mode=TwoWay}"
|
||||
HorizontalAlignment="Stretch">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DisplayLabel}" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Clipboard mode -->
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="{Binding ClipboardLabel}"
|
||||
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||
FontSize="{StaticResource FontSizeSmall}" />
|
||||
<ComboBox ItemsSource="{Binding SupportedClipboardModes}"
|
||||
SelectedItem="{Binding SelectedClipboardMode, Mode=TwoWay}"
|
||||
HorizontalAlignment="Stretch">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DisplayLabel}" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Toggles -->
|
||||
<StackPanel Spacing="6">
|
||||
<CheckBox Content="{Binding PreviewBeforeSaveLabel}"
|
||||
IsChecked="{Binding PreviewBeforeSave, Mode=TwoWay}" />
|
||||
<StackPanel Spacing="2">
|
||||
<CheckBox Content="{Binding AutoSwitchOnAltTabLabel}"
|
||||
IsChecked="{Binding AutoSwitchOnAltTab, Mode=TwoWay}" />
|
||||
<TextBlock Text="{Binding AutoSwitchOnAltTabHint}"
|
||||
FontSize="{StaticResource FontSizeCaption}"
|
||||
TextWrapping="Wrap"
|
||||
Margin="28,0,0,0"
|
||||
Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
|
||||
</StackPanel>
|
||||
<CheckBox Content="{Binding MinimizeToTrayLabel}"
|
||||
IsChecked="{Binding MinimizeToTray, Mode=TwoWay}" />
|
||||
<CheckBox Content="{Binding SoundEnabledLabel}"
|
||||
IsChecked="{Binding SoundEnabled, Mode=TwoWay}" />
|
||||
<CheckBox Content="{Binding OpenFolderAfterSaveLabel}"
|
||||
IsChecked="{Binding OpenFolderAfterSave, Mode=TwoWay}" />
|
||||
<CheckBox Content="{Binding AutoPinAfterCaptureLabel}"
|
||||
IsChecked="{Binding AutoPinAfterCapture, Mode=TwoWay}" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Logging -->
|
||||
|
||||
@@ -137,14 +137,14 @@ public sealed partial class AboutViewModel : ViewModelBase
|
||||
var full = Path.Combine(basePath, relativePath);
|
||||
if (!File.Exists(full))
|
||||
{
|
||||
_logger.LogWarning("Document not found: {Path}", full);
|
||||
_logger.LogWarning("Document not found at {Path}.", full);
|
||||
return;
|
||||
}
|
||||
Process.Start(new ProcessStartInfo(full) { UseShellExecute = true });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Failed to open document {Path}.", relativePath);
|
||||
_logger.LogError(ex, "Couldn't open the document at {Path}.", relativePath);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ public sealed partial class AboutViewModel : ViewModelBase
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Failed to open URL {Url}.", url);
|
||||
_logger.LogError(ex, "Couldn't open the link {Url}.", url);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,7 @@ public sealed partial class DashboardViewModel : ViewModelBase, IDisposable
|
||||
|
||||
private readonly IProcessDetector _detector;
|
||||
private readonly IProcessWatcher _watcher;
|
||||
private readonly IForegroundWindowWatcher _foregroundWatcher;
|
||||
private readonly IHotkeyService _hotkeys;
|
||||
private readonly ICaptureEngine _captureEngine;
|
||||
private readonly IReadOnlyList<IImageEncoder> _encoders;
|
||||
@@ -27,6 +28,9 @@ public sealed partial class DashboardViewModel : ViewModelBase, IDisposable
|
||||
private readonly IPreviewPresenter _previewPresenter;
|
||||
private readonly ISettingsStore _settings;
|
||||
private readonly IToastService _toasts;
|
||||
private readonly IClipboardService _clipboard;
|
||||
private readonly IPinnedThumbnailHost _pinnedThumbnail;
|
||||
private readonly IRegionCaptureService _regionCapture;
|
||||
private readonly IUIThreadDispatcher _dispatcher;
|
||||
private readonly ILogger<DashboardViewModel> _logger;
|
||||
private readonly CaptureStateMachine _stateMachine;
|
||||
@@ -74,6 +78,7 @@ public sealed partial class DashboardViewModel : ViewModelBase, IDisposable
|
||||
public DashboardViewModel(
|
||||
IProcessDetector detector,
|
||||
IProcessWatcher watcher,
|
||||
IForegroundWindowWatcher foregroundWatcher,
|
||||
IHotkeyService hotkeys,
|
||||
ICaptureEngine captureEngine,
|
||||
IEnumerable<IImageEncoder> encoders,
|
||||
@@ -81,12 +86,16 @@ public sealed partial class DashboardViewModel : ViewModelBase, IDisposable
|
||||
IPreviewPresenter previewPresenter,
|
||||
ISettingsStore settings,
|
||||
IToastService toasts,
|
||||
IClipboardService clipboard,
|
||||
IPinnedThumbnailHost pinnedThumbnail,
|
||||
IRegionCaptureService regionCapture,
|
||||
IUIThreadDispatcher dispatcher,
|
||||
ILocalizationService localization,
|
||||
ILogger<DashboardViewModel> logger)
|
||||
{
|
||||
_detector = detector;
|
||||
_watcher = watcher;
|
||||
_foregroundWatcher = foregroundWatcher;
|
||||
_hotkeys = hotkeys;
|
||||
_captureEngine = captureEngine;
|
||||
_encoders = new List<IImageEncoder>(encoders).AsReadOnly();
|
||||
@@ -94,6 +103,9 @@ public sealed partial class DashboardViewModel : ViewModelBase, IDisposable
|
||||
_previewPresenter = previewPresenter;
|
||||
_settings = settings;
|
||||
_toasts = toasts;
|
||||
_clipboard = clipboard;
|
||||
_pinnedThumbnail = pinnedThumbnail;
|
||||
_regionCapture = regionCapture;
|
||||
_dispatcher = dispatcher;
|
||||
Localization = localization;
|
||||
_logger = logger;
|
||||
@@ -106,6 +118,8 @@ public sealed partial class DashboardViewModel : ViewModelBase, IDisposable
|
||||
_watcher.Start();
|
||||
_hotkeys.Triggered += OnHotkeyTriggered;
|
||||
_settings.Changed += OnSettingsChanged;
|
||||
_foregroundWatcher.ForegroundChanged += OnForegroundChanged;
|
||||
ApplyAutoSwitchSetting();
|
||||
|
||||
Localization.PropertyChanged += OnLocalizationChanged;
|
||||
|
||||
@@ -159,7 +173,7 @@ public sealed partial class DashboardViewModel : ViewModelBase, IDisposable
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Failed to enumerate capture targets.");
|
||||
_logger.LogError(ex, "Couldn't load the list of windows. Try clicking Refresh again.");
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -322,21 +336,67 @@ public sealed partial class DashboardViewModel : ViewModelBase, IDisposable
|
||||
|
||||
private async Task CaptureOnceAsync()
|
||||
{
|
||||
if (_disposed || SelectedTarget is null) return;
|
||||
if (_disposed) return;
|
||||
if (_stateMachine.CurrentState != CaptureState.Armed) return;
|
||||
|
||||
var target = SelectedTarget.Target;
|
||||
var settings = _settings.Current;
|
||||
var isRegionMode = string.Equals(settings.Capture.Mode, "Region", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
// Window mode needs a selected target; Region mode does not.
|
||||
if (!isRegionMode && SelectedTarget is null) return;
|
||||
var target = isRegionMode
|
||||
? new GameTarget(
|
||||
ProcessId: 0u,
|
||||
WindowHandle: nint.Zero,
|
||||
ProcessName: "Region",
|
||||
WindowTitle: Localization["Region_TargetName"],
|
||||
ExecutablePath: string.Empty,
|
||||
IconBytes: null,
|
||||
SteamInfo: null)
|
||||
: SelectedTarget!.Target;
|
||||
|
||||
// Countdown gate — done BEFORE firing HotkeyPressed so the state machine still
|
||||
// shows Armed during the wait. Only fires when the user opted in (>0 seconds).
|
||||
var countdown = NormalizeCountdown(settings.Capture.CountdownSeconds);
|
||||
if (countdown > 0)
|
||||
{
|
||||
for (var remaining = countdown; remaining > 0; remaining--)
|
||||
{
|
||||
if (_disposed) return;
|
||||
StatusMessage = string.Format(
|
||||
Localization["Toast_Countdown"], remaining);
|
||||
try
|
||||
{
|
||||
await Task.Delay(TimeSpan.FromSeconds(1)).ConfigureAwait(true);
|
||||
}
|
||||
catch (TaskCanceledException) { return; }
|
||||
}
|
||||
}
|
||||
|
||||
_stateMachine.Fire(CaptureTrigger.HotkeyPressed);
|
||||
|
||||
CapturedFrame? frame;
|
||||
try
|
||||
{
|
||||
frame = await _captureEngine.CaptureAsync(target).ConfigureAwait(true);
|
||||
if (isRegionMode)
|
||||
{
|
||||
frame = await _regionCapture.SelectAndCaptureAsync().ConfigureAwait(true);
|
||||
if (frame is null)
|
||||
{
|
||||
// User cancelled the region selection (Esc / micro-drag) — return to
|
||||
// Armed state without firing FrameCaptured.
|
||||
_stateMachine.Fire(CaptureTrigger.PreviewRejected);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
frame = await _captureEngine.CaptureAsync(target).ConfigureAwait(true);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Capture engine threw.");
|
||||
_logger.LogError(ex, "Picture capture failed: the capture engine reported an error.");
|
||||
_stateMachine.Fire(CaptureTrigger.ErrorOccurred);
|
||||
_toasts.ShowError(Localization["Toast_CaptureFailed"], ex.Message);
|
||||
return;
|
||||
@@ -356,43 +416,148 @@ public sealed partial class DashboardViewModel : ViewModelBase, IDisposable
|
||||
_stateMachine.Fire(CaptureTrigger.PreviewAccepted);
|
||||
}
|
||||
|
||||
var clipboardMode = settings.Capture.ClipboardMode;
|
||||
var copyToClipboard = string.Equals(clipboardMode, "Copy", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(clipboardMode, "CopyAndSave", StringComparison.OrdinalIgnoreCase);
|
||||
var saveToFile = !string.Equals(clipboardMode, "Copy", StringComparison.OrdinalIgnoreCase);
|
||||
var autoPin = settings.UI.AutoPinAfterCapture;
|
||||
// PNG bytes are needed if either clipboard or auto-pin is on. Encode lazily to
|
||||
// avoid re-encoding when the user wants neither.
|
||||
byte[]? cachedPngBytes = null;
|
||||
async Task<byte[]?> EnsurePngAsync()
|
||||
=> cachedPngBytes ??= await EncodePngBytesAsync(frame).ConfigureAwait(true);
|
||||
|
||||
// Saving ------------------------------------------------------------
|
||||
try
|
||||
{
|
||||
var result = await SaveAsync(frame, target, settings).ConfigureAwait(true);
|
||||
switch (result)
|
||||
CaptureResult.Success? successResult = null;
|
||||
CaptureResult.Failure? failureResult = null;
|
||||
|
||||
if (saveToFile)
|
||||
{
|
||||
case CaptureResult.Success ok:
|
||||
LastCapturePath = ok.FilePath;
|
||||
_stateMachine.Fire(CaptureTrigger.Saved);
|
||||
StatusMessage = string.Format(
|
||||
Localization["Dashboard_StatusSaved"],
|
||||
Path.GetFileName(ok.FilePath),
|
||||
ok.Width, ok.Height, (int)ok.Duration.TotalMilliseconds);
|
||||
_toasts.ShowSuccess(
|
||||
Localization["Toast_CaptureSaved"],
|
||||
Path.GetFileName(ok.FilePath));
|
||||
PlayCaptureSoundIfEnabled();
|
||||
break;
|
||||
case CaptureResult.Failure fail:
|
||||
_stateMachine.Fire(CaptureTrigger.ErrorOccurred);
|
||||
StatusMessage = string.Format(
|
||||
Localization["Dashboard_StatusFailed"],
|
||||
fail.ErrorCode, fail.DeveloperMessage);
|
||||
_toasts.ShowError(
|
||||
Localization["Toast_CaptureFailed"],
|
||||
fail.DeveloperMessage);
|
||||
break;
|
||||
var result = await SaveAsync(frame, target, settings).ConfigureAwait(true);
|
||||
switch (result)
|
||||
{
|
||||
case CaptureResult.Success ok:
|
||||
successResult = ok;
|
||||
LastCapturePath = ok.FilePath;
|
||||
StatusMessage = string.Format(
|
||||
Localization["Dashboard_StatusSaved"],
|
||||
Path.GetFileName(ok.FilePath),
|
||||
ok.Width, ok.Height, (int)ok.Duration.TotalMilliseconds);
|
||||
_toasts.ShowSuccess(
|
||||
Localization["Toast_CaptureSaved"],
|
||||
Path.GetFileName(ok.FilePath));
|
||||
break;
|
||||
case CaptureResult.Failure fail:
|
||||
failureResult = fail;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (copyToClipboard && failureResult is null)
|
||||
{
|
||||
var pngBytes = await EnsurePngAsync().ConfigureAwait(true);
|
||||
if (pngBytes is not null)
|
||||
{
|
||||
var copied = await _clipboard.CopyImageAsync(pngBytes).ConfigureAwait(true);
|
||||
if (copied)
|
||||
{
|
||||
_toasts.ShowInfo(
|
||||
Localization["Toast_ClipboardCopied"],
|
||||
string.Empty);
|
||||
if (!saveToFile)
|
||||
{
|
||||
// Copy-only mode — synthesise a status update mirroring StatusSaved
|
||||
// so the dashboard tells the user something happened.
|
||||
StatusMessage = Localization["Toast_ClipboardCopied"];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (failureResult is not null)
|
||||
{
|
||||
_stateMachine.Fire(CaptureTrigger.ErrorOccurred);
|
||||
StatusMessage = string.Format(
|
||||
Localization["Dashboard_StatusFailed"],
|
||||
failureResult.ErrorCode, failureResult.DeveloperMessage);
|
||||
_toasts.ShowError(
|
||||
Localization["Toast_CaptureFailed"],
|
||||
failureResult.DeveloperMessage);
|
||||
}
|
||||
else
|
||||
{
|
||||
_stateMachine.Fire(CaptureTrigger.Saved);
|
||||
PlayCaptureSoundIfEnabled();
|
||||
|
||||
if (settings.UI.OpenFolderAfterSave && successResult is not null)
|
||||
{
|
||||
TryOpenContainingFolder(successResult.FilePath);
|
||||
}
|
||||
|
||||
if (autoPin)
|
||||
{
|
||||
var pngBytes = await EnsurePngAsync().ConfigureAwait(true);
|
||||
if (pngBytes is not null)
|
||||
{
|
||||
_pinnedThumbnail.Show(pngBytes, successResult?.FilePath, target.DisplayName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Save path threw unexpectedly.");
|
||||
_logger.LogError(ex, "Picture capture failed while saving: {Reason}", ex.Message);
|
||||
_stateMachine.Fire(CaptureTrigger.ErrorOccurred);
|
||||
_toasts.ShowError(Localization["Toast_CaptureFailed"], ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Snap the persisted countdown to one of the supported tiers (0/3/5/10).</summary>
|
||||
private static int NormalizeCountdown(int raw) => raw switch
|
||||
{
|
||||
3 or 5 or 10 => raw,
|
||||
_ => 0,
|
||||
};
|
||||
|
||||
private async Task<byte[]?> EncodePngBytesAsync(CapturedFrame frame)
|
||||
{
|
||||
var encoder = ResolveEncoder(ImageFormat.Png);
|
||||
if (encoder is null)
|
||||
{
|
||||
_logger.LogWarning("No PNG encoder registered; clipboard copy skipped.");
|
||||
return null;
|
||||
}
|
||||
try
|
||||
{
|
||||
using var ms = new MemoryStream();
|
||||
await encoder.EncodeAsync(frame, ImageFormat.Png, jpegQuality: 100, webpQuality: 100, ms)
|
||||
.ConfigureAwait(true);
|
||||
return ms.ToArray();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "Failed to encode capture as PNG for clipboard.");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void TryOpenContainingFolder(string filePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
var folder = Path.GetDirectoryName(filePath);
|
||||
if (string.IsNullOrWhiteSpace(folder)) return;
|
||||
System.Diagnostics.Process.Start(
|
||||
new System.Diagnostics.ProcessStartInfo(folder) { UseShellExecute = true });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogDebug(ex, "Failed to open output folder after save.");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Run the orchestrator-equivalent save path inline: pick an encoder, write to a tmp
|
||||
/// file, atomically rename, return a CaptureResult. We don't reuse CaptureOrchestrator
|
||||
@@ -510,6 +675,50 @@ public sealed partial class DashboardViewModel : ViewModelBase, IDisposable
|
||||
{
|
||||
UpdateStatusForState();
|
||||
}
|
||||
|
||||
ApplyAutoSwitchSetting();
|
||||
}
|
||||
|
||||
private void ApplyAutoSwitchSetting()
|
||||
{
|
||||
var enabled = _settings.Current.Capture.AutoSwitchOnAltTab;
|
||||
if (enabled && !_foregroundWatcher.IsRunning)
|
||||
{
|
||||
_foregroundWatcher.Start();
|
||||
}
|
||||
else if (!enabled && _foregroundWatcher.IsRunning)
|
||||
{
|
||||
_foregroundWatcher.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnForegroundChanged(object? sender, nint hwnd)
|
||||
{
|
||||
// Watcher runs on a thread-pool timer; marshal to the UI thread before touching
|
||||
// SelectedTarget so binding updates land on the dispatcher.
|
||||
_dispatcher.Post(() =>
|
||||
{
|
||||
if (_disposed) return;
|
||||
if (!_settings.Current.Capture.AutoSwitchOnAltTab) return;
|
||||
|
||||
foreach (var vm in Targets)
|
||||
{
|
||||
if (vm.Target.WindowHandle == hwnd)
|
||||
{
|
||||
if (!ReferenceEquals(SelectedTarget, vm))
|
||||
{
|
||||
SelectedTarget = vm;
|
||||
_logger.LogDebug(
|
||||
"Auto-switched target to PID {Pid} ({Name}).",
|
||||
vm.ProcessId, vm.DisplayName);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
// No match — keep the current selection. Clearing it would surprise users
|
||||
// who Alt-Tab to apps that are filtered out of the target list (Explorer,
|
||||
// Settings, etc.).
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -548,6 +757,13 @@ public sealed partial class DashboardViewModel : ViewModelBase, IDisposable
|
||||
_hotkeys.Triggered -= OnHotkeyTriggered;
|
||||
_watcher.Changed -= OnProcessChanged;
|
||||
_settings.Changed -= OnSettingsChanged;
|
||||
_foregroundWatcher.ForegroundChanged -= OnForegroundChanged;
|
||||
_foregroundWatcher.Stop();
|
||||
// The WMI watcher's ManagementEventWatcher subscriptions run on non-background
|
||||
// threads. If these aren't stopped, the CLR can't tear down on app exit and the
|
||||
// process becomes a zombie — every subsequent launch then accumulates a duplicate
|
||||
// CaptureImage.exe in Task Manager. Symmetric with the Start() call in the ctor.
|
||||
_watcher.Stop();
|
||||
_stateMachine.StateChanged -= OnStateChanged;
|
||||
Localization.PropertyChanged -= OnLocalizationChanged;
|
||||
_pendingRefresh?.Cancel();
|
||||
|
||||
@@ -193,7 +193,7 @@ public sealed partial class LogViewerViewModel : ViewModelBase, IDisposable
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "Failed to open logs folder {Path}.", folder);
|
||||
_logger.LogWarning(ex, "Couldn't open the logs folder at {Path}.", folder);
|
||||
_toasts.ShowError(Localization["Toast_Error"], ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Threading.Tasks;
|
||||
using CaptureImage.Core.Abstractions;
|
||||
using CaptureImage.Core.Models;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace CaptureImage.ViewModels.Preview;
|
||||
|
||||
@@ -12,6 +15,10 @@ namespace CaptureImage.ViewModels.Preview;
|
||||
/// </summary>
|
||||
public sealed partial class PreviewViewModel : ViewModelBase, IDisposable
|
||||
{
|
||||
private readonly IOcrService _ocr;
|
||||
private readonly IClipboardService _clipboard;
|
||||
private readonly IToastService _toasts;
|
||||
private readonly ILogger<PreviewViewModel>? _logger;
|
||||
private bool _disposed;
|
||||
|
||||
public ILocalizationService Localization { get; }
|
||||
@@ -28,9 +35,21 @@ public sealed partial class PreviewViewModel : ViewModelBase, IDisposable
|
||||
[ObservableProperty]
|
||||
private int _height;
|
||||
|
||||
public PreviewViewModel(ILocalizationService localization)
|
||||
[ObservableProperty]
|
||||
private bool _isExtractingText;
|
||||
|
||||
public PreviewViewModel(
|
||||
ILocalizationService localization,
|
||||
IOcrService ocr,
|
||||
IClipboardService clipboard,
|
||||
IToastService toasts,
|
||||
ILogger<PreviewViewModel>? logger = null)
|
||||
{
|
||||
Localization = localization;
|
||||
_ocr = ocr;
|
||||
_clipboard = clipboard;
|
||||
_toasts = toasts;
|
||||
_logger = logger;
|
||||
|
||||
// Preview window is modal and short-lived, but the user can still switch language
|
||||
// from the tray menu while it is open. Raise Localization on culture change so the
|
||||
@@ -67,4 +86,76 @@ public sealed partial class PreviewViewModel : ViewModelBase, IDisposable
|
||||
Width = frame.Width;
|
||||
Height = frame.Height;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Run OCR on the captured PNG and copy the recognised text to the clipboard.
|
||||
/// Surfaces a single toast based on the outcome (success / empty / unavailable).
|
||||
/// </summary>
|
||||
[RelayCommand]
|
||||
private async Task ExtractTextAsync()
|
||||
{
|
||||
if (PngBytes is null || PngBytes.Length == 0 || IsExtractingText) return;
|
||||
|
||||
IsExtractingText = true;
|
||||
try
|
||||
{
|
||||
var result = await _ocr.RecognizeAsync(PngBytes, languageTag: null).ConfigureAwait(true);
|
||||
if (!result.EngineAvailable)
|
||||
{
|
||||
_toasts.ShowError(Localization["Toast_OcrUnavailable"], string.Empty);
|
||||
return;
|
||||
}
|
||||
|
||||
var text = result.Text?.Trim() ?? string.Empty;
|
||||
if (text.Length == 0)
|
||||
{
|
||||
_toasts.ShowInfo(Localization["Toast_OcrEmpty"], string.Empty);
|
||||
return;
|
||||
}
|
||||
|
||||
_clipboard.CopyText(text);
|
||||
var wordCount = CountWords(text);
|
||||
_logger?.LogInformation(
|
||||
"OCR extracted {WordCount} words at avg confidence {Conf:F2}; copied to clipboard.",
|
||||
wordCount, result.AverageConfidence);
|
||||
_toasts.ShowSuccess(
|
||||
string.Format(Localization["Toast_OcrSuccess"], wordCount),
|
||||
Truncate(text, 80));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger?.LogWarning(ex, "OCR extraction failed.");
|
||||
_toasts.ShowError(Localization["Toast_Error"], ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
IsExtractingText = false;
|
||||
}
|
||||
}
|
||||
|
||||
private static int CountWords(string text)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(text)) return 0;
|
||||
var count = 0;
|
||||
var inWord = false;
|
||||
foreach (var ch in text)
|
||||
{
|
||||
if (char.IsWhiteSpace(ch))
|
||||
{
|
||||
inWord = false;
|
||||
}
|
||||
else if (!inWord)
|
||||
{
|
||||
inWord = true;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
private static string Truncate(string text, int max)
|
||||
{
|
||||
if (text.Length <= max) return text;
|
||||
return text[..max] + "…";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace CaptureImage.ViewModels.Settings;
|
||||
|
||||
/// <summary>
|
||||
/// Pickable entry for the Settings → Capture mode ComboBox. <see cref="Code"/> is
|
||||
/// the raw value persisted to <c>AppSettings.Capture.Mode</c> (one of <c>Window</c>,
|
||||
/// <c>Region</c>); the localized <see cref="DisplayLabel"/> rebuilds on culture switch.
|
||||
/// </summary>
|
||||
public sealed record CaptureModeOption(string Code, string DisplayLabel)
|
||||
{
|
||||
public override string ToString() => DisplayLabel;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace CaptureImage.ViewModels.Settings;
|
||||
|
||||
/// <summary>
|
||||
/// Pickable entry for the Settings → Clipboard mode ComboBox. <see cref="Code"/> is the
|
||||
/// raw value persisted to <c>AppSettings.Capture.ClipboardMode</c> (one of <c>None</c>,
|
||||
/// <c>Copy</c>, <c>CopyAndSave</c>); the localized <see cref="DisplayLabel"/> is rebuilt
|
||||
/// on culture change.
|
||||
/// </summary>
|
||||
public sealed record ClipboardOption(string Code, string DisplayLabel)
|
||||
{
|
||||
public override string ToString() => DisplayLabel;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace CaptureImage.ViewModels.Settings;
|
||||
|
||||
/// <summary>
|
||||
/// Pickable entry for the Settings → Capture countdown ComboBox. <see cref="Seconds"/>
|
||||
/// is what gets persisted into <c>AppSettings.Capture.CountdownSeconds</c>; the localized
|
||||
/// <see cref="DisplayLabel"/> is rebuilt on culture change.
|
||||
/// </summary>
|
||||
public sealed record CountdownOption(int Seconds, string DisplayLabel)
|
||||
{
|
||||
public override string ToString() => DisplayLabel;
|
||||
}
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using CaptureImage.Core.Abstractions;
|
||||
using CaptureImage.Core.Models;
|
||||
@@ -32,6 +33,8 @@ public sealed partial class SettingsViewModel : ViewModelBase, IDisposable
|
||||
|
||||
public ObservableCollection<CultureInfo> SupportedCultures { get; }
|
||||
|
||||
public ObservableCollection<ThemeOption> SupportedThemes { get; } = new();
|
||||
|
||||
public ObservableCollection<ImageFormat> SupportedFormats { get; } =
|
||||
new(new[] { ImageFormat.Png, ImageFormat.Jpeg, ImageFormat.Webp, ImageFormat.Tiff });
|
||||
|
||||
@@ -46,6 +49,9 @@ public sealed partial class SettingsViewModel : ViewModelBase, IDisposable
|
||||
[ObservableProperty]
|
||||
private CultureInfo _selectedCulture;
|
||||
|
||||
[ObservableProperty]
|
||||
private ThemeOption? _selectedTheme;
|
||||
|
||||
[ObservableProperty]
|
||||
private ImageFormat _defaultFormat;
|
||||
|
||||
@@ -64,15 +70,39 @@ public sealed partial class SettingsViewModel : ViewModelBase, IDisposable
|
||||
[ObservableProperty]
|
||||
private bool _previewBeforeSave;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _autoSwitchOnAltTab;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _minimizeToTray;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _soundEnabled;
|
||||
|
||||
[ObservableProperty]
|
||||
private CaptureModeOption? _selectedCaptureMode;
|
||||
|
||||
[ObservableProperty]
|
||||
private CountdownOption? _selectedCountdown;
|
||||
|
||||
[ObservableProperty]
|
||||
private ClipboardOption? _selectedClipboardMode;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _openFolderAfterSave;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _autoPinAfterCapture;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _selectedLogLevel = "Information";
|
||||
|
||||
public ObservableCollection<CountdownOption> SupportedCountdowns { get; } = new();
|
||||
|
||||
public ObservableCollection<ClipboardOption> SupportedClipboardModes { get; } = new();
|
||||
|
||||
public ObservableCollection<CaptureModeOption> SupportedCaptureModes { get; } = new();
|
||||
|
||||
public string SettingsFilePath => _settings.SettingsFilePath;
|
||||
|
||||
// -- localized labels ---------------------------------------------------
|
||||
@@ -87,6 +117,7 @@ public sealed partial class SettingsViewModel : ViewModelBase, IDisposable
|
||||
|
||||
public string TitleLabel => Localization["Settings_Title"];
|
||||
public string LanguageLabel => Localization["Settings_Language"];
|
||||
public string ThemeLabel => Localization["Settings_Theme"];
|
||||
public string HotkeyLabel => Localization["Settings_Hotkey"];
|
||||
public string HotkeyHint => Localization["Settings_HotkeyHint"];
|
||||
public string FormatLabel => Localization["Settings_Format"];
|
||||
@@ -98,8 +129,15 @@ public sealed partial class SettingsViewModel : ViewModelBase, IDisposable
|
||||
public string BrowseTooltip => Localization["Settings_BrowseTooltip"];
|
||||
public string FileNameTemplateLabel => Localization["Settings_FileNameTemplate"];
|
||||
public string PreviewBeforeSaveLabel => Localization["Settings_PreviewBeforeSave"];
|
||||
public string AutoSwitchOnAltTabLabel => Localization["Settings_AutoSwitchOnAltTab"];
|
||||
public string AutoSwitchOnAltTabHint => Localization["Settings_AutoSwitchOnAltTabHint"];
|
||||
public string MinimizeToTrayLabel => Localization["Settings_MinimizeToTray"];
|
||||
public string SoundEnabledLabel => Localization["Settings_SoundEnabled"];
|
||||
public string CountdownLabel => Localization["Settings_Countdown"];
|
||||
public string ClipboardLabel => Localization["Settings_Clipboard"];
|
||||
public string OpenFolderAfterSaveLabel => Localization["Settings_OpenFolderAfterSave"];
|
||||
public string AutoPinAfterCaptureLabel => Localization["Settings_AutoPinAfterCapture"];
|
||||
public string CaptureModeLabel => Localization["Settings_CaptureMode"];
|
||||
public string ImportLabel => Localization["Settings_Import"];
|
||||
public string ExportLabel => Localization["Settings_Export"];
|
||||
public string OpenFileLabel => Localization["Settings_OpenFile"];
|
||||
@@ -125,6 +163,11 @@ public sealed partial class SettingsViewModel : ViewModelBase, IDisposable
|
||||
SupportedCultures = new ObservableCollection<CultureInfo>(localization.SupportedCultures);
|
||||
_selectedCulture = FindCulture(settings.Current.Culture) ?? SupportedCultures[0];
|
||||
|
||||
RebuildThemeOptions();
|
||||
RebuildCountdownOptions();
|
||||
RebuildClipboardOptions();
|
||||
RebuildCaptureModeOptions();
|
||||
|
||||
Hydrate();
|
||||
_settings.Changed += OnSettingsStoreChanged;
|
||||
|
||||
@@ -149,10 +192,12 @@ public sealed partial class SettingsViewModel : ViewModelBase, IDisposable
|
||||
if (e.PropertyName is "Item[]" or nameof(ILocalizationService.CurrentCulture))
|
||||
{
|
||||
OnPropertyChanged(nameof(Localization));
|
||||
RebuildThemeOptions();
|
||||
// Plain-property refresh for every localized label the view binds to —
|
||||
// indexer-path bindings don't wake reliably on Localization-reference ping.
|
||||
OnPropertyChanged(nameof(TitleLabel));
|
||||
OnPropertyChanged(nameof(LanguageLabel));
|
||||
OnPropertyChanged(nameof(ThemeLabel));
|
||||
OnPropertyChanged(nameof(HotkeyLabel));
|
||||
OnPropertyChanged(nameof(HotkeyHint));
|
||||
OnPropertyChanged(nameof(FormatLabel));
|
||||
@@ -164,8 +209,18 @@ public sealed partial class SettingsViewModel : ViewModelBase, IDisposable
|
||||
OnPropertyChanged(nameof(BrowseTooltip));
|
||||
OnPropertyChanged(nameof(FileNameTemplateLabel));
|
||||
OnPropertyChanged(nameof(PreviewBeforeSaveLabel));
|
||||
OnPropertyChanged(nameof(AutoSwitchOnAltTabLabel));
|
||||
OnPropertyChanged(nameof(AutoSwitchOnAltTabHint));
|
||||
OnPropertyChanged(nameof(MinimizeToTrayLabel));
|
||||
OnPropertyChanged(nameof(SoundEnabledLabel));
|
||||
OnPropertyChanged(nameof(CountdownLabel));
|
||||
OnPropertyChanged(nameof(ClipboardLabel));
|
||||
OnPropertyChanged(nameof(OpenFolderAfterSaveLabel));
|
||||
OnPropertyChanged(nameof(AutoPinAfterCaptureLabel));
|
||||
OnPropertyChanged(nameof(CaptureModeLabel));
|
||||
RebuildCountdownOptions();
|
||||
RebuildClipboardOptions();
|
||||
RebuildCaptureModeOptions();
|
||||
OnPropertyChanged(nameof(ImportLabel));
|
||||
OnPropertyChanged(nameof(ExportLabel));
|
||||
OnPropertyChanged(nameof(OpenFileLabel));
|
||||
@@ -202,14 +257,21 @@ public sealed partial class SettingsViewModel : ViewModelBase, IDisposable
|
||||
{
|
||||
var current = _settings.Current;
|
||||
SelectedCulture = FindCulture(current.Culture) ?? SupportedCultures[0];
|
||||
SelectedTheme = FindTheme(current.Theme) ?? SupportedThemes[0];
|
||||
DefaultFormat = current.Capture.DefaultFormat;
|
||||
JpegQuality = current.Capture.JpegQuality;
|
||||
WebpQuality = current.Capture.WebpQuality;
|
||||
OutputDirectory = current.Capture.OutputDirectory;
|
||||
FileNameTemplate = current.Capture.FileNameTemplate;
|
||||
PreviewBeforeSave = current.Capture.PreviewBeforeSave;
|
||||
AutoSwitchOnAltTab = current.Capture.AutoSwitchOnAltTab;
|
||||
MinimizeToTray = current.UI.MinimizeToTray;
|
||||
SoundEnabled = current.UI.SoundEnabled;
|
||||
OpenFolderAfterSave = current.UI.OpenFolderAfterSave;
|
||||
AutoPinAfterCapture = current.UI.AutoPinAfterCapture;
|
||||
SelectedCountdown = FindCountdown(current.Capture.CountdownSeconds) ?? SupportedCountdowns[0];
|
||||
SelectedClipboardMode = FindClipboardMode(current.Capture.ClipboardMode) ?? SupportedClipboardModes[0];
|
||||
SelectedCaptureMode = FindCaptureMode(current.Capture.Mode) ?? SupportedCaptureModes[0];
|
||||
// Fall back to the first supported value if the persisted string doesn't match —
|
||||
// that can happen after a hand-edit or a downgrade from a future schema.
|
||||
SelectedLogLevel = SupportedLogLevels.Contains(current.LogLevel)
|
||||
@@ -227,6 +289,44 @@ public sealed partial class SettingsViewModel : ViewModelBase, IDisposable
|
||||
if (_suppressPush || value is null) return;
|
||||
_settings.Update(s => s with { Culture = value.Name });
|
||||
Localization.SetCulture(value);
|
||||
_logger.LogInformation("Language switched to {Code} ({Name}).", value.Name, value.NativeName);
|
||||
}
|
||||
|
||||
partial void OnSelectedThemeChanged(ThemeOption? value)
|
||||
{
|
||||
if (_suppressPush || value is null) return;
|
||||
_settings.Update(s => s with { Theme = value.Code });
|
||||
_logger.LogInformation("Theme switched to {Theme}.", value.Code);
|
||||
}
|
||||
|
||||
private ThemeOption? FindTheme(string code)
|
||||
{
|
||||
foreach (var t in SupportedThemes)
|
||||
{
|
||||
if (t.Code.Equals(code, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return t;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void RebuildThemeOptions()
|
||||
{
|
||||
var keepCode = SelectedTheme?.Code;
|
||||
SupportedThemes.Clear();
|
||||
SupportedThemes.Add(new ThemeOption("System", Localization["Settings_Theme_System"]));
|
||||
SupportedThemes.Add(new ThemeOption("Light", Localization["Settings_Theme_Light"]));
|
||||
SupportedThemes.Add(new ThemeOption("Dark", Localization["Settings_Theme_Dark"]));
|
||||
|
||||
// After a culture switch the bound SelectedTheme reference points at a stale
|
||||
// option — rebind by Code so the ComboBox shows the right entry.
|
||||
if (keepCode is not null)
|
||||
{
|
||||
_suppressPush = true;
|
||||
try { SelectedTheme = FindTheme(keepCode) ?? SupportedThemes[0]; }
|
||||
finally { _suppressPush = false; }
|
||||
}
|
||||
}
|
||||
|
||||
partial void OnDefaultFormatChanged(ImageFormat value)
|
||||
@@ -265,6 +365,13 @@ public sealed partial class SettingsViewModel : ViewModelBase, IDisposable
|
||||
_settings.Update(s => s with { Capture = s.Capture with { PreviewBeforeSave = value } });
|
||||
}
|
||||
|
||||
partial void OnAutoSwitchOnAltTabChanged(bool value)
|
||||
{
|
||||
if (_suppressPush) return;
|
||||
_settings.Update(s => s with { Capture = s.Capture with { AutoSwitchOnAltTab = value } });
|
||||
_logger.LogInformation("Auto-switch on Alt-Tab {State}.", value ? "enabled" : "disabled");
|
||||
}
|
||||
|
||||
partial void OnMinimizeToTrayChanged(bool value)
|
||||
{
|
||||
if (_suppressPush) return;
|
||||
@@ -275,6 +382,115 @@ public sealed partial class SettingsViewModel : ViewModelBase, IDisposable
|
||||
{
|
||||
if (_suppressPush) return;
|
||||
_settings.Update(s => s with { UI = s.UI with { SoundEnabled = value } });
|
||||
_logger.LogInformation("Capture sound {State}.", value ? "enabled" : "disabled");
|
||||
}
|
||||
|
||||
partial void OnSelectedCountdownChanged(CountdownOption? value)
|
||||
{
|
||||
if (_suppressPush || value is null) return;
|
||||
_settings.Update(s => s with { Capture = s.Capture with { CountdownSeconds = value.Seconds } });
|
||||
_logger.LogInformation("Capture countdown set to {Seconds}s.", value.Seconds);
|
||||
}
|
||||
|
||||
partial void OnSelectedClipboardModeChanged(ClipboardOption? value)
|
||||
{
|
||||
if (_suppressPush || value is null) return;
|
||||
_settings.Update(s => s with { Capture = s.Capture with { ClipboardMode = value.Code } });
|
||||
_logger.LogInformation("Clipboard mode set to {Mode}.", value.Code);
|
||||
}
|
||||
|
||||
partial void OnSelectedCaptureModeChanged(CaptureModeOption? value)
|
||||
{
|
||||
if (_suppressPush || value is null) return;
|
||||
_settings.Update(s => s with { Capture = s.Capture with { Mode = value.Code } });
|
||||
_logger.LogInformation("Capture mode set to {Mode}.", value.Code);
|
||||
}
|
||||
|
||||
private CaptureModeOption? FindCaptureMode(string code)
|
||||
{
|
||||
foreach (var m in SupportedCaptureModes)
|
||||
{
|
||||
if (m.Code.Equals(code, StringComparison.OrdinalIgnoreCase)) return m;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void RebuildCaptureModeOptions()
|
||||
{
|
||||
var keepCode = SelectedCaptureMode?.Code;
|
||||
SupportedCaptureModes.Clear();
|
||||
SupportedCaptureModes.Add(new CaptureModeOption("Window", Localization["Settings_CaptureModeWindow"]));
|
||||
SupportedCaptureModes.Add(new CaptureModeOption("Region", Localization["Settings_CaptureModeRegion"]));
|
||||
|
||||
if (keepCode is not null)
|
||||
{
|
||||
_suppressPush = true;
|
||||
try { SelectedCaptureMode = FindCaptureMode(keepCode) ?? SupportedCaptureModes[0]; }
|
||||
finally { _suppressPush = false; }
|
||||
}
|
||||
}
|
||||
|
||||
partial void OnOpenFolderAfterSaveChanged(bool value)
|
||||
{
|
||||
if (_suppressPush) return;
|
||||
_settings.Update(s => s with { UI = s.UI with { OpenFolderAfterSave = value } });
|
||||
}
|
||||
|
||||
partial void OnAutoPinAfterCaptureChanged(bool value)
|
||||
{
|
||||
if (_suppressPush) return;
|
||||
_settings.Update(s => s with { UI = s.UI with { AutoPinAfterCapture = value } });
|
||||
}
|
||||
|
||||
private CountdownOption? FindCountdown(int seconds)
|
||||
{
|
||||
foreach (var c in SupportedCountdowns)
|
||||
{
|
||||
if (c.Seconds == seconds) return c;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private ClipboardOption? FindClipboardMode(string code)
|
||||
{
|
||||
foreach (var m in SupportedClipboardModes)
|
||||
{
|
||||
if (m.Code.Equals(code, StringComparison.OrdinalIgnoreCase)) return m;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void RebuildCountdownOptions()
|
||||
{
|
||||
var keepSeconds = SelectedCountdown?.Seconds;
|
||||
SupportedCountdowns.Clear();
|
||||
SupportedCountdowns.Add(new CountdownOption(0, Localization["Settings_CountdownOff"]));
|
||||
SupportedCountdowns.Add(new CountdownOption(3, Localization["Settings_Countdown3s"]));
|
||||
SupportedCountdowns.Add(new CountdownOption(5, Localization["Settings_Countdown5s"]));
|
||||
SupportedCountdowns.Add(new CountdownOption(10, Localization["Settings_Countdown10s"]));
|
||||
|
||||
if (keepSeconds is int s)
|
||||
{
|
||||
_suppressPush = true;
|
||||
try { SelectedCountdown = FindCountdown(s) ?? SupportedCountdowns[0]; }
|
||||
finally { _suppressPush = false; }
|
||||
}
|
||||
}
|
||||
|
||||
private void RebuildClipboardOptions()
|
||||
{
|
||||
var keepCode = SelectedClipboardMode?.Code;
|
||||
SupportedClipboardModes.Clear();
|
||||
SupportedClipboardModes.Add(new ClipboardOption("None", Localization["Settings_ClipboardNone"]));
|
||||
SupportedClipboardModes.Add(new ClipboardOption("Copy", Localization["Settings_ClipboardCopy"]));
|
||||
SupportedClipboardModes.Add(new ClipboardOption("CopyAndSave", Localization["Settings_ClipboardCopySave"]));
|
||||
|
||||
if (keepCode is not null)
|
||||
{
|
||||
_suppressPush = true;
|
||||
try { SelectedClipboardMode = FindClipboardMode(keepCode) ?? SupportedClipboardModes[0]; }
|
||||
finally { _suppressPush = false; }
|
||||
}
|
||||
}
|
||||
|
||||
partial void OnSelectedLogLevelChanged(string value)
|
||||
@@ -298,7 +514,7 @@ public sealed partial class SettingsViewModel : ViewModelBase, IDisposable
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "Failed to open settings file.");
|
||||
_logger.LogWarning(ex, "Couldn't open the settings file.");
|
||||
_toasts.ShowError(Localization["Toast_Error"], ex.Message);
|
||||
}
|
||||
}
|
||||
@@ -318,7 +534,7 @@ public sealed partial class SettingsViewModel : ViewModelBase, IDisposable
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Settings export failed.");
|
||||
_logger.LogError(ex, "Couldn't export settings.");
|
||||
_toasts.ShowError(Localization["Toast_Error"], ex.Message);
|
||||
}
|
||||
}
|
||||
@@ -334,7 +550,7 @@ public sealed partial class SettingsViewModel : ViewModelBase, IDisposable
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Settings import failed.");
|
||||
_logger.LogError(ex, "Couldn't import settings.");
|
||||
_toasts.ShowError(Localization["Toast_Error"], ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace CaptureImage.ViewModels.Settings;
|
||||
|
||||
public sealed record ThemeOption(string Code, string DisplayLabel)
|
||||
{
|
||||
public override string ToString() => DisplayLabel;
|
||||
}
|
||||
@@ -111,7 +111,7 @@ public sealed partial class UpdateViewModel : ViewModelBase, IDisposable
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Update check failed.");
|
||||
_logger.LogError(ex, "Couldn't check for updates.");
|
||||
Status = UpdateStatus.Failed;
|
||||
}
|
||||
finally
|
||||
@@ -139,7 +139,7 @@ public sealed partial class UpdateViewModel : ViewModelBase, IDisposable
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Update download failed.");
|
||||
_logger.LogError(ex, "Couldn't download the update.");
|
||||
Status = UpdateStatus.Failed;
|
||||
}
|
||||
finally
|
||||
@@ -160,7 +160,7 @@ public sealed partial class UpdateViewModel : ViewModelBase, IDisposable
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Update install failed.");
|
||||
_logger.LogError(ex, "Couldn't install the update.");
|
||||
Status = UpdateStatus.Failed;
|
||||
IsBusy = false;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
using CaptureImage.Core.Models;
|
||||
using FluentAssertions;
|
||||
using Xunit;
|
||||
|
||||
namespace CaptureImage.Core.Tests.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Regression guards for the v1.5 settings additions. Defaults are part of the
|
||||
/// schema contract — when v1.4 settings.json files load on a v1.5 build, the new
|
||||
/// fields must come back with these values so users don't get surprise behaviour.
|
||||
/// </summary>
|
||||
public class AppSettingsDefaultsTests
|
||||
{
|
||||
[Fact]
|
||||
public void CaptureSettings_NewFieldsHaveSafeDefaults()
|
||||
{
|
||||
var s = new CaptureSettings();
|
||||
s.CountdownSeconds.Should().Be(0, "v1.5 must default to no countdown so existing users see no behaviour change");
|
||||
s.ClipboardMode.Should().Be("None", "default clipboard mode must keep file-only behaviour");
|
||||
s.Mode.Should().Be("Window", "default capture mode must remain the v1.4 window-capture flow");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void UiSettings_NewFieldsHaveSafeDefaults()
|
||||
{
|
||||
var s = new UiSettings();
|
||||
s.OpenFolderAfterSave.Should().BeFalse("opening Explorer on every capture would be intrusive by default");
|
||||
s.AutoPinAfterCapture.Should().BeFalse("auto-pin must be opt-in — surprise floating windows would annoy gamers");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AppSettings_DefaultsAreInternallyConsistent()
|
||||
{
|
||||
var settings = new AppSettings();
|
||||
settings.Capture.Should().NotBeNull();
|
||||
settings.UI.Should().NotBeNull();
|
||||
// The full default record round-trips through `with` cleanly — guards against
|
||||
// the STJ source-gen init-default gotcha noted in the v1.2 cycle ledger.
|
||||
var roundTripped = settings with { Theme = "Dark" };
|
||||
roundTripped.Capture.Mode.Should().Be("Window");
|
||||
roundTripped.UI.AutoPinAfterCapture.Should().BeFalse();
|
||||
}
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
using CaptureImage.Infrastructure.Processes;
|
||||
using FluentAssertions;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
using Xunit;
|
||||
|
||||
namespace CaptureImage.Infrastructure.Tests.Processes;
|
||||
|
||||
/// <summary>
|
||||
/// Smoke tests for <see cref="Win32ForegroundWindowWatcher"/> lifecycle. Verifies that
|
||||
/// construction, idempotent stop, and disposal don't throw — the actual SetWinEventHook
|
||||
/// path needs a UI thread with a message pump and is exercised manually during QA.
|
||||
/// </summary>
|
||||
public class Win32ForegroundWindowWatcherTests
|
||||
{
|
||||
[Fact]
|
||||
public void NewInstance_IsNotRunning()
|
||||
{
|
||||
using var watcher = new Win32ForegroundWindowWatcher(
|
||||
NullLogger<Win32ForegroundWindowWatcher>.Instance);
|
||||
|
||||
watcher.IsRunning.Should().BeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Stop_WithoutStart_IsNoOp()
|
||||
{
|
||||
using var watcher = new Win32ForegroundWindowWatcher(
|
||||
NullLogger<Win32ForegroundWindowWatcher>.Instance);
|
||||
|
||||
var act = () => watcher.Stop();
|
||||
|
||||
act.Should().NotThrow();
|
||||
watcher.IsRunning.Should().BeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Dispose_IsIdempotent()
|
||||
{
|
||||
var watcher = new Win32ForegroundWindowWatcher(
|
||||
NullLogger<Win32ForegroundWindowWatcher>.Instance);
|
||||
|
||||
watcher.Dispose();
|
||||
var act = () => watcher.Dispose();
|
||||
|
||||
act.Should().NotThrow();
|
||||
}
|
||||
}
|
||||
@@ -7,10 +7,11 @@ using Xunit;
|
||||
namespace CaptureImage.UI.Tests.Localization;
|
||||
|
||||
/// <summary>
|
||||
/// Asserts that every load-bearing UI string is translated in all 3 shipped cultures
|
||||
/// (en-US / vi-VN / ar-SA). The bracketed fallback (e.g. <c>"[Nav_Dashboard]"</c>) means
|
||||
/// a key is missing from the resx — these tests catch that before it reaches the user.
|
||||
/// Asserts that every load-bearing UI string is translated in all shipped cultures.
|
||||
/// The bracketed fallback (e.g. <c>"[Nav_Dashboard]"</c>) means a key is missing from
|
||||
/// the resx — these tests catch that before it reaches the user.
|
||||
/// </summary>
|
||||
[Collection(LocalizationTestCollection.Name)]
|
||||
public class LocalizationCompletenessTests : IDisposable
|
||||
{
|
||||
private readonly CultureInfo _savedUICulture;
|
||||
@@ -47,8 +48,10 @@ public class LocalizationCompletenessTests : IDisposable
|
||||
"Dashboard_Title", "Dashboard_Subtitle", "Dashboard_Refresh",
|
||||
"Dashboard_Arm", "Dashboard_Disarm", "Dashboard_StatusIdle",
|
||||
"Settings_Title", "Settings_Language", "Settings_Hotkey",
|
||||
"Settings_Theme", "Settings_Theme_System", "Settings_Theme_Light", "Settings_Theme_Dark",
|
||||
"Settings_Format", "Settings_OutputFolder", "Settings_Browse",
|
||||
"Settings_PreviewBeforeSave", "Settings_MinimizeToTray", "Settings_SoundEnabled",
|
||||
"Settings_PreviewBeforeSave", "Settings_AutoSwitchOnAltTab", "Settings_AutoSwitchOnAltTabHint",
|
||||
"Settings_MinimizeToTray", "Settings_SoundEnabled",
|
||||
"Settings_Logging", "Settings_LogLevel",
|
||||
"About_Title", "About_Tagline", "About_VersionLabel", "About_LicenseLabel",
|
||||
"Update_Title", "Update_Check", "Update_Download", "Update_Install",
|
||||
@@ -65,7 +68,13 @@ public class LocalizationCompletenessTests : IDisposable
|
||||
|
||||
public static IEnumerable<object[]> CultureMatrix()
|
||||
{
|
||||
foreach (var culture in new[] { "en-US", "vi-VN", "ar-SA" })
|
||||
var cultures = new[]
|
||||
{
|
||||
"en-US", "vi-VN", "ar-SA",
|
||||
"ja-JP", "zh-Hans", "ko-KR", "es-ES",
|
||||
"fr-FR", "de-DE", "pt-BR", "ru-RU",
|
||||
};
|
||||
foreach (var culture in cultures)
|
||||
{
|
||||
foreach (var key in LoadBearingKeys)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
using Xunit;
|
||||
|
||||
namespace CaptureImage.UI.Tests.Localization;
|
||||
|
||||
/// <summary>
|
||||
/// xUnit collection that serialises every test class touching
|
||||
/// <see cref="System.Globalization.CultureInfo.DefaultThreadCurrentUICulture"/> /
|
||||
/// <c>DefaultThreadCurrentCulture</c>. Those properties are process-wide statics, so
|
||||
/// without this guard a Theory iteration in one class can stomp on a static
|
||||
/// assertion in another class running on a parallel runner thread.
|
||||
/// </summary>
|
||||
[CollectionDefinition(Name)]
|
||||
public sealed class LocalizationTestCollection
|
||||
{
|
||||
public const string Name = "Localization (serialised — touches static CultureInfo)";
|
||||
}
|
||||
@@ -12,6 +12,7 @@ namespace CaptureImage.UI.Tests.Localization;
|
||||
/// restores in <see cref="Dispose"/> so setting <c>CultureInfo.CurrentCulture</c> from one
|
||||
/// test doesn't leak into the next one running on the same test runner thread.
|
||||
/// </summary>
|
||||
[Collection(LocalizationTestCollection.Name)]
|
||||
public class ResxLocalizationServiceTests : IDisposable
|
||||
{
|
||||
private readonly CultureInfo _savedUICulture;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using CaptureImage.Core.Abstractions;
|
||||
using CaptureImage.Core.Models;
|
||||
using CaptureImage.ViewModels.Preview;
|
||||
using FluentAssertions;
|
||||
using Xunit;
|
||||
@@ -19,7 +21,7 @@ public class PreviewViewModelTests
|
||||
public void ItemIndexerChange_RaisesLocalizationPropertyChanged()
|
||||
{
|
||||
var localization = new FakeLocalizationService();
|
||||
using var vm = new PreviewViewModel(localization);
|
||||
using var vm = new PreviewViewModel(localization, new FakeOcr(), new FakeClipboard(), new FakeToasts());
|
||||
var raised = new List<string?>();
|
||||
vm.PropertyChanged += (_, e) => raised.Add(e.PropertyName);
|
||||
|
||||
@@ -32,7 +34,7 @@ public class PreviewViewModelTests
|
||||
public void CurrentCultureChange_RaisesLocalizationPropertyChanged()
|
||||
{
|
||||
var localization = new FakeLocalizationService();
|
||||
using var vm = new PreviewViewModel(localization);
|
||||
using var vm = new PreviewViewModel(localization, new FakeOcr(), new FakeClipboard(), new FakeToasts());
|
||||
var raised = new List<string?>();
|
||||
vm.PropertyChanged += (_, e) => raised.Add(e.PropertyName);
|
||||
|
||||
@@ -45,7 +47,7 @@ public class PreviewViewModelTests
|
||||
public void UnrelatedPropertyChange_DoesNotRaiseLocalization()
|
||||
{
|
||||
var localization = new FakeLocalizationService();
|
||||
using var vm = new PreviewViewModel(localization);
|
||||
using var vm = new PreviewViewModel(localization, new FakeOcr(), new FakeClipboard(), new FakeToasts());
|
||||
var raised = new List<string?>();
|
||||
vm.PropertyChanged += (_, e) => raised.Add(e.PropertyName);
|
||||
|
||||
@@ -58,7 +60,7 @@ public class PreviewViewModelTests
|
||||
public void Dispose_DetachesLocalizationHandler()
|
||||
{
|
||||
var localization = new FakeLocalizationService();
|
||||
var vm = new PreviewViewModel(localization);
|
||||
var vm = new PreviewViewModel(localization, new FakeOcr(), new FakeClipboard(), new FakeToasts());
|
||||
var raised = 0;
|
||||
vm.PropertyChanged += (_, _) => raised++;
|
||||
|
||||
@@ -94,4 +96,29 @@ public class PreviewViewModelTests
|
||||
public void RaiseOther(string propertyName) =>
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
private sealed class FakeOcr : IOcrService
|
||||
{
|
||||
public Task<OcrResult> RecognizeAsync(byte[] pngBytes, string? languageTag, CancellationToken cancellationToken = default) =>
|
||||
Task.FromResult(new OcrResult(string.Empty, 0.0, EngineAvailable: false));
|
||||
}
|
||||
|
||||
private sealed class FakeClipboard : IClipboardService
|
||||
{
|
||||
public Task<bool> CopyImageAsync(byte[] pngBytes, CancellationToken cancellationToken = default) =>
|
||||
Task.FromResult(false);
|
||||
|
||||
public bool CopyText(string text) => false;
|
||||
}
|
||||
|
||||
private sealed class FakeToasts : IToastService
|
||||
{
|
||||
public ObservableCollection<ToastItem> Visible { get; } = new();
|
||||
public void Show(ToastItem item) { }
|
||||
public void Dismiss(Guid id) { }
|
||||
public void ShowSuccess(string title, string message) { }
|
||||
public void ShowError(string title, string message) { }
|
||||
public void ShowInfo(string title, string message) { }
|
||||
public void ShowWarning(string title, string message) { }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user