Guest User

Untitled

a guest
Nov 17th, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.84 KB | None | 0 0
  1. import sys, ctypes, re
  2. p = [[[int(v) for v in p.split(",")] for p in re.split("\[(.*?)\]", line) if p != '' and p != "\n"] for line in open(sys.argv[1], "r").readlines()]
  3. open(sys.argv[2], "w+").write(f"#include<Windows.h>\n#include<cstdint>\nint main(){{int w={len(p[0])}; int h = {len(p)};uint32_t* p=new uint32_t[{len(p[0])*len(p)}]{{"+",".join([",".join([hex((p[y][x][0]<<16)|(p[y][x][1]<<8)|p[y][x][2]) for x in range(len(p[0]))]) for y in range(len(p))])+f"}};HBITMAP b=CreateBitmap(w,h,1,32,p);HBRUSH e=CreatePatternBrush(b);delete[]p;HDC c=GetDC(0);RECT s{{{(x:=(u:=ctypes.windll.user32.GetSystemMetrics)(76))},{(y:=u(77))},{(x + u(78))},{(y + u(79))}}};while(!GetAsyncKeyState('Q'))FillRect(c,&s,e);InvalidateRect(0,&s,true);ReleaseDC(0,c);return 0;}}")
  4. print("Note: press 'Q' to terminate after you compile and run main program\nCompile to windows x86")
Advertisement
Add Comment
Please, Sign In to add comment