Skip to content

Instantly share code, notes, and snippets.

@ProjectEli
Created May 9, 2021 09:48
Show Gist options
  • Save ProjectEli/e0ffd1385fbeeb08889aa0355ae53b6c to your computer and use it in GitHub Desktop.
Save ProjectEli/e0ffd1385fbeeb08889aa0355ae53b6c to your computer and use it in GitHub Desktop.
draw red line on windows screen
import win32gui
import win32api
dc = win32gui.GetDC(0)
red = win32api.RGB(255, 0, 0)
x = 3030
y= 100
# for k in range(100):
# win32gui.SetPixel(dc, x, y+k, red) # draw red at 0,0
win32gui.MoveToEx(dc,x,y)
win32gui.LineTo(dc,100,10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment