winGDI.py
699 Bytes
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
from ctypes import *
from ctypes.wintypes import *
user32=windll.user32
gdi32=windll.gdi32
class RGBQUAD(Structure):
_fields_=[
('rgbBlue',c_ubyte),
('rgbGreen',c_ubyte),
('rgbRed',c_ubyte),
('rgbReserved',c_ubyte),
]
class BITMAPINFOHEADER(Structure):
_fields_=[
('biSize',DWORD),
('biWidth',LONG),
('biHeight',LONG),
('biPlanes',WORD),
('biBitCount',WORD),
('biCompression',WORD),
('biSizeImage',DWORD),
('biXPelsPerMeter',LONG),
('biYPelsPerMeter',LONG),
('biClrUsed',DWORD),
('biClrImportant',DWORD),
]
class BITMAPINFO(Structure):
_fields_=[
('bmiHeader',BITMAPINFOHEADER),
('bmiColors',(RGBQUAD*1)),
]
BI_RGB=0
SRCCOPY=0x00CC0020
DIB_RGB_COLORS=0