admin
2023-03-07 8b06b1cbf112d55307ea8a6efe711db4e7506d89
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#pragma once
#include <list>
#include <iostream>
#include <math.h>
#include<Windows.h>
 
#include <string>
#include "ImgUtil.h"
#define L2_CHENNL_COUNT 6
using namespace std;
enum CaptureContentType {
    CAPTURE_TYPE_L2,
    CAPTURE_TYPE_TRADE_QUEUE,
};
struct FrameInfo
{
    HWND frame;
    RECT position;
 
    bool operator < (FrameInfo& b) {
        return position.left < b.position.left;
    }
 
};
class CaptureUtil
{
private:
    static std::list<FrameInfo> tempFrames;
    static HWND level2Frames[L2_CHENNL_COUNT];
    static HWND tradeQueueFrames[L2_CHENNL_COUNT];
    static BOOL CALLBACK EnumChildProc(HWND hwndChild, LPARAM lParam);
 
 
public:
    //³õʼ»¯
    static void init(HWND l2win);
 
    static HWND getHWND(int index, CaptureContentType type);
 
    //½ØÍ¼
    static cv::Mat capture(int index, CaptureContentType type);
 
 
    static cv::Mat capture(HWND frame);
 
};