(self, **_)
Windows initialisations.
Windows initialisations.
Windows initialisations .
def __init__(self, **_):
        # type: (Any) -> None
        """ Windows initialisations. """

        super().__init__()

        self.user32 = ctypes.WinDLL("user32")
        self.gdi32 = ctypes.WinDLL("gdi32")
        self._set_cfunctions()
        self._set_dpi_awareness()

        self._bbox = {"height": 0, "width": 0}
        self._data = ctypes.create_string_buffer(0)  # type: ctypes.Array[ctypes.c_char]

        srcdc = self._get_srcdc()
        if not MSS.memdc:
            MSS.memdc = self.gdi32.CreateCompatibleDC(srcdc)

        bmi = BITMAPINFO()
        bmi.bmiHeader.biSize = ctypes.sizeof(BITMAPINFOHEADER)
        bmi.bmiHeader.biPlanes = 1  # Always 1
        bmi.bmiHeader.biBitCount = 32  # See grab.__doc__ [2]
        bmi.bmiHeader.biCompression = 0  # 0 = BI_RGB (no compression)
        bmi.bmiHeader.biClrUsed = 0  # See grab.__doc__ [3]
        bmi.bmiHeader.biClrImportant = 0  # See grab.__doc__ [3]
        self._bmi = bmi
def __init__ ( self , * * _ ) : # type: (Any) -> None super ( ) . __init__ ( ) self . user32 = ctypes . WinDLL ( "user32" ) self . gdi32 = ctypes . WinDLL ( "gdi32" ) self . _set_cfunctions ( ) self . _set_dpi_awareness ( ) self . _bbox = { "height" : 0 , "width" : 0 } self . _data = ctypes . create_string_buffer ( 0 ) # type: ctypes.Array[ctypes.c_char] srcdc = self . _get_srcdc ( ) if not MSS . memdc : MSS . memdc = self . gdi32 . CreateCompatibleDC ( srcdc ) bmi = BITMAPINFO ( ) bmi . bmiHeader . biSize = ctypes . sizeof ( BITMAPINFOHEADER ) bmi . bmiHeader . biPlanes = 1 # Always 1 bmi . bmiHeader . biBitCount = 32 # See grab.__doc__ [2] bmi . bmiHeader . biCompression = 0 # 0 = BI_RGB (no compression) bmi . bmiHeader . biClrUsed = 0 # See grab.__doc__ [3] bmi . bmiHeader . biClrImportant = 0 # See grab.__doc__ [3] self . _bmi = bmi