当前位置: 首页>>代码示例>>Python>>正文


Python wintypes.HDC属性代码示例

本文整理汇总了Python中ctypes.wintypes.HDC属性的典型用法代码示例。如果您正苦于以下问题:Python wintypes.HDC属性的具体用法?Python wintypes.HDC怎么用?Python wintypes.HDC使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在ctypes.wintypes的用法示例。


在下文中一共展示了wintypes.HDC属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _set_argtypes

# 需要导入模块: from ctypes import wintypes [as 别名]
# 或者: from ctypes.wintypes import HDC [as 别名]
def _set_argtypes(self):
        ''' Functions arguments. '''

        self.MONITORENUMPROC = WINFUNCTYPE(INT, DWORD, DWORD, POINTER(RECT),
                                           DOUBLE)
        windll.user32.GetSystemMetrics.argtypes = [INT]
        windll.user32.EnumDisplayMonitors.argtypes = [HDC, c_void_p,
                                                      self.MONITORENUMPROC,
                                                      LPARAM]
        windll.user32.GetWindowDC.argtypes = [HWND]
        windll.gdi32.CreateCompatibleDC.argtypes = [HDC]
        windll.gdi32.CreateCompatibleBitmap.argtypes = [HDC, INT, INT]
        windll.gdi32.SelectObject.argtypes = [HDC, HGDIOBJ]
        windll.gdi32.BitBlt.argtypes = [HDC, INT, INT, INT, INT, HDC, INT, INT,
                                        DWORD]
        windll.gdi32.DeleteObject.argtypes = [HGDIOBJ]
        windll.gdi32.GetDIBits.argtypes = [HDC, HBITMAP, UINT, UINT, c_void_p,
                                           POINTER(BITMAPINFO), UINT] 
开发者ID:maldevel,项目名称:gdog,代码行数:20,代码来源:client.py

示例2: _set_restypes

# 需要导入模块: from ctypes import wintypes [as 别名]
# 或者: from ctypes.wintypes import HDC [as 别名]
def _set_restypes(self):
        ''' Functions return type. '''

        windll.user32.GetSystemMetrics.restypes = INT
        windll.user32.EnumDisplayMonitors.restypes = BOOL
        windll.user32.GetWindowDC.restypes = HDC
        windll.gdi32.CreateCompatibleDC.restypes = HDC
        windll.gdi32.CreateCompatibleBitmap.restypes = HBITMAP
        windll.gdi32.SelectObject.restypes = HGDIOBJ
        windll.gdi32.BitBlt.restypes = BOOL
        windll.gdi32.GetDIBits.restypes = INT
        windll.gdi32.DeleteObject.restypes = BOOL 
开发者ID:maldevel,项目名称:gdog,代码行数:14,代码来源:client.py

示例3: CreateDC

# 需要导入模块: from ctypes import wintypes [as 别名]
# 或者: from ctypes.wintypes import HDC [as 别名]
def CreateDC(driver, device, output, initData):
    return HDC(_CreateIC(driver, device, output, initData)) 
开发者ID:dev7355608,项目名称:csgo_dont_blind_me,代码行数:4,代码来源:context_wingdi.py

示例4: GetDC

# 需要导入模块: from ctypes import wintypes [as 别名]
# 或者: from ctypes.wintypes import HDC [as 别名]
def GetDC(hWnd):
    return HDC(_GetDC(hWnd)) 
开发者ID:dev7355608,项目名称:csgo_dont_blind_me,代码行数:4,代码来源:context_wingdi.py

示例5: enumerate_monitors

# 需要导入模块: from ctypes import wintypes [as 别名]
# 或者: from ctypes.wintypes import HDC [as 别名]
def enumerate_monitors() -> list:
    """
    enumerate all physical monitor.
    ** 请注意防止返回的 Handle 对象被GC!
    
    https://msdn.microsoft.com/en-us/library/dd162610(v=vs.85).aspx
    BOOL EnumDisplayMonitors(
        _In_ HDC             hdc,
        _In_ LPCRECT         lprcClip,
        _In_ MONITORENUMPROC lpfnEnum,
        _In_ LPARAM          dwData
    );
    
    :return: list contains physical monitor handles
    """
    all_hmonitor = []

    # Factory function of EnumDisplayMonitors callback.
    # 保持引用以防止被GC !
    # https://msdn.microsoft.com/en-us/library/dd145061(v=vs.85).aspx
    _MONITOR_ENUM_PROC = ctypes.WINFUNCTYPE(wintypes.BOOL,
                                            wintypes.HMONITOR,
                                            wintypes.HDC,
                                            ctypes.POINTER(wintypes.LPRECT),
                                            wintypes.LPARAM)

    def __monitor_enum_proc_callback(hmonitor_: wintypes.HMONITOR, hdc, lprect, lparam) -> bool:
        """
        EnumDisplayMonitors callback, append HMONITOR to all_hmonitor list.
        :param hmonitor_:
        :param hdc:
        :param lprect:
        :param lparam:
        :return:
        """
        all_hmonitor.append(hmonitor_)
        return True
    
    if not ctypes.windll.user32.EnumDisplayMonitors(None, None,
                                                    _MONITOR_ENUM_PROC(__monitor_enum_proc_callback), None):
            raise ctypes.WinError()
    
    # get physical monitor handle
    handles = []
    for hmonitor in all_hmonitor:
        handles.extend(_get_physical_monitors_from_hmonitor(hmonitor))
    
    return handles 
开发者ID:dot-osk,项目名称:monitor_ctrl,代码行数:50,代码来源:vcp.py


注:本文中的ctypes.wintypes.HDC属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。