def paint__draw_rect(hdc, pos_x, pos_y, width, height, color):
rect = wintypes.RECT()
rect.left = pos_x
rect.top = pos_y
rect.right = pos_x + width
rect.bottom = pos_y + height
fill_rgb = wintypes.RGB((color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff)
fill_brush = None
try:
fill_brush = windll.gdi32.CreateSolidBrush(fill_rgb)
windll.user32.FillRect(hdc, byref(rect), fill_brush)
finally:
if fill_brush is not None:
_delete_gdi_object(fill_brush)
评论列表
文章目录