Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a29217a324 | ||
|
|
72a6730c84 | ||
|
|
94027889d3 | ||
|
|
38b1554dc5 | ||
|
|
f296756b0d | ||
|
|
56cd1047c2 | ||
|
|
933e872b49 | ||
|
|
cfe2b5ce69 | ||
|
|
9f5986dbac | ||
|
|
585dfb3de5 | ||
|
|
e5ddc4e3ac |
No files matched your search
+107
@@ -7,6 +7,113 @@ 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
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
@@ -60,6 +62,15 @@ public partial class App : Application
|
||||
// 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.4.0</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;
|
||||
@@ -98,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;
|
||||
@@ -59,23 +60,9 @@ public sealed partial class MainWindow : Window
|
||||
/// 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 — internally hops to the dispatcher.
|
||||
/// Safe to call from any thread — <see cref="ThemeApplicator"/> hops to the dispatcher.
|
||||
/// </summary>
|
||||
public void ApplyTheme(string theme)
|
||||
{
|
||||
DispatcherQueue.TryEnqueue(() =>
|
||||
{
|
||||
if (Content is FrameworkElement root)
|
||||
{
|
||||
root.RequestedTheme = theme switch
|
||||
{
|
||||
"Light" => ElementTheme.Light,
|
||||
"Dark" => ElementTheme.Dark,
|
||||
_ => ElementTheme.Default,
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
public void ApplyTheme(string theme) => ThemeApplicator.Apply(Content as FrameworkElement, theme);
|
||||
|
||||
public void SetViewModel(MainWindowViewModel vm)
|
||||
{
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using CaptureImage.App.SingleInstance;
|
||||
using CaptureImage.Core.Abstractions;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.UI.Dispatching;
|
||||
@@ -24,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();
|
||||
@@ -119,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,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);
|
||||
}
|
||||
@@ -80,6 +80,29 @@ public sealed record CaptureSettings
|
||||
/// 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>
|
||||
@@ -92,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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,10 @@ public sealed class ResxLocalizationService : ILocalizationService
|
||||
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;
|
||||
|
||||
@@ -118,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>
|
||||
@@ -161,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>
|
||||
@@ -118,7 +118,7 @@
|
||||
<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 japonés, chino simplificado, coreano y español 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_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>
|
||||
@@ -161,4 +161,36 @@
|
||||
<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>
|
||||
@@ -118,7 +118,7 @@
|
||||
<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_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>
|
||||
@@ -161,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>
|
||||
@@ -118,7 +118,7 @@
|
||||
<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_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>
|
||||
@@ -161,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>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>
|
||||
@@ -118,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>The Vietnamese, Arabic, Japanese, Simplified Chinese, Korean, and Spanish 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>
|
||||
@@ -161,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>
|
||||
@@ -118,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>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 và tiếng Tây Ban Nha đ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>
|
||||
@@ -161,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>
|
||||
@@ -118,7 +118,7 @@
|
||||
<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_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>
|
||||
@@ -161,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,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);
|
||||
@@ -133,6 +133,54 @@
|
||||
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}"
|
||||
@@ -150,6 +198,10 @@
|
||||
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 -->
|
||||
|
||||
@@ -28,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;
|
||||
@@ -83,6 +86,9 @@ 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)
|
||||
@@ -97,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;
|
||||
@@ -327,17 +336,63 @@ 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)
|
||||
{
|
||||
@@ -361,33 +416,94 @@ 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)
|
||||
@@ -398,6 +514,50 @@ public sealed partial class DashboardViewModel : ViewModelBase, IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
/// <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
|
||||
@@ -599,6 +759,11 @@ public sealed partial class DashboardViewModel : ViewModelBase, IDisposable
|
||||
_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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -79,9 +79,30 @@ public sealed partial class SettingsViewModel : ViewModelBase, IDisposable
|
||||
[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 ---------------------------------------------------
|
||||
@@ -112,6 +133,11 @@ public sealed partial class SettingsViewModel : ViewModelBase, IDisposable
|
||||
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"];
|
||||
@@ -138,6 +164,9 @@ public sealed partial class SettingsViewModel : ViewModelBase, IDisposable
|
||||
_selectedCulture = FindCulture(settings.Current.Culture) ?? SupportedCultures[0];
|
||||
|
||||
RebuildThemeOptions();
|
||||
RebuildCountdownOptions();
|
||||
RebuildClipboardOptions();
|
||||
RebuildCaptureModeOptions();
|
||||
|
||||
Hydrate();
|
||||
_settings.Changed += OnSettingsStoreChanged;
|
||||
@@ -184,6 +213,14 @@ public sealed partial class SettingsViewModel : ViewModelBase, IDisposable
|
||||
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));
|
||||
@@ -230,6 +267,11 @@ public sealed partial class SettingsViewModel : ViewModelBase, IDisposable
|
||||
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)
|
||||
@@ -343,6 +385,114 @@ public sealed partial class SettingsViewModel : ViewModelBase, IDisposable
|
||||
_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)
|
||||
{
|
||||
if (_suppressPush || string.IsNullOrWhiteSpace(value)) return;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
@@ -67,7 +68,13 @@ public class LocalizationCompletenessTests : IDisposable
|
||||
|
||||
public static IEnumerable<object[]> CultureMatrix()
|
||||
{
|
||||
foreach (var culture in new[] { "en-US", "vi-VN", "ar-SA", "ja-JP", "zh-Hans", "ko-KR", "es-ES" })
|
||||
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