
wxpython没用过,不清楚,不过PyQt4用过。
"""
鼠标移动需要把鼠标的XY值读取
"""
if eventbuttons() & QtLeftButton:
pointX = eventglobalX()
pointY = eventglobalY()
# img is QImage type
img = QPixmapgrabWindow(
QApplicationdesktop()winId())toImage()
rgb = imgpixel(pointX, pointY)
#十进制
red10 = QtGuiqRed(rgb)
green10 =QtGuiqGreen(rgb)
blue10 = QtGuiqBlue(rgb)
color10="("+str(red10)+","+str(green10)+","+str(blue10)+")"
#十六进制
#print str(hex(red10))
red16=str(hex(red10))[2:]
green16=str(hex(green10))[2]
blue16=str(hex(blue10))[2:]
color16=red16+green16+blue16
#print color16
print "(%s,%s) = %s (%s,%s,%s)" % (pointX, pointY, color16,red10, green10, blue10)
以上就是关于人机界面属于哪个库全部的内容,包括:人机界面属于哪个库、wxpython 怎么设置一个无边框窗体、python怎么获取鼠标附近的像素wxpython等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)