Skip to content

Instantly share code, notes, and snippets.

View w4ngzhen's full-sized avatar
😺
Fall in love

Zhen WANG w4ngzhen

😺
Fall in love
View GitHub Profile
@w4ngzhen
w4ngzhen / win_screenshot_bmp.cpp
Created December 1, 2023 00:57
win_screenshot_bmp.cpp
#include <windows.h>
#include <vector>
#include <sstream>
#include "cp_screenshot/cp_screenshot.h"
#include <gdiplus.h>
#pragma comment(lib, "gdiplus")
/**
* \brief cps inner utils on Windows.
*/
@w4ngzhen
w4ngzhen / sdl_demo.cpp
Created September 22, 2023 01:18
SDL2 simple demo
#include "SDL.h"
int main() {
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
return -1;
}
SDL_Window *window = SDL_CreateWindow(
"Hello World",
10, 10, 800, 600, SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE);
if (!window) {
return -1;
@w4ngzhen
w4ngzhen / simple-qt-screen-capture.cpp
Last active August 31, 2023 10:49
simple screen capture demo based Qt
#include <QApplication>
#include <QPainter>
#include <QWidget>
#include <QKeyEvent>
#include <QRect>
#include <QPoint>
#include <QImage>
#include <QCursor>
#include <QClipboard>