Add NightShot source

This commit is contained in:
f1den committed 2026-07-31 17:03:49 +03:00
1 parent 0174ecaf32
commit dfcbacfb0c
33 files changed
+8358 -1

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
#pragma once
#include "config.hpp"
#include <windows.h>
struct ScreenCapture {
HDC memoryDc = nullptr;
HBITMAP bitmap = nullptr;
HGDIOBJ oldBitmap = nullptr;
void* pixels = nullptr;
int x = 0;
int y = 0;
int width = 0;
int height = 0;
int stride = 0;
ScreenCapture() = default;
ScreenCapture(const ScreenCapture&) = delete;
ScreenCapture& operator=(const ScreenCapture&) = delete;
ScreenCapture(ScreenCapture&& other) noexcept;
ScreenCapture& operator=(ScreenCapture&& other) noexcept;
~ScreenCapture();
[[nodiscard]] bool valid() const noexcept { return memoryDc && bitmap && width > 0 && height > 0; }
void reset() noexcept;
};
[[nodiscard]] ScreenCapture captureVirtualDesktop();