MCPcopy Create free account
hub / github.com/DSVVA/MHY_Scanner / ScreenScan

Method ScreenScan

src/Core/ScreenScan.cpp:5–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3using cv::Mat;
4
5ScreenScan::ScreenScan()
6{
7 double zoom = getZoom();
8 m_width = GetSystemMetrics(SM_CXSCREEN) * (int)zoom;
9 m_height = GetSystemMetrics(SM_CYSCREEN) * (int)zoom;
10 m_screenshotData = new char[m_width * m_height * 4];
11 memset(m_screenshotData, 0, m_width);
12
13 // 获取屏幕 DC
14 m_screenDC = GetDC(NULL);
15 m_compatibleDC = CreateCompatibleDC(m_screenDC);
16
17 // 创建位图
18 m_hBitmap = CreateCompatibleBitmap(m_screenDC, m_width, m_height);
19 SelectObject(m_compatibleDC, m_hBitmap);
20}
21
22/* 获取整个屏幕的截图 */
23Mat ScreenScan::getScreenshot()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected