導航:首頁 > 圖片大全 > python如何讓圖片跟著滑鼠移動

python如何讓圖片跟著滑鼠移動

發布時間:2024-03-26 05:03:18

1. python 獲取滑鼠在圖片上的坐標

下pygame mole,然後


importpygame
pygame.init()
screen=pygame.display.set_mode([100,100])##sizeofwindow
your_image=pygame.image.load("your_image_name.png")##imagemustbeinthesamefolder,elsepathmustbespecified
while1:
screen.blit(your_image,[0,0])##posofyourimageonthewindow
foreventinpygame.event.get():
ifevent.type==pygame.QUIT:
exit()

position=pygame.mouse.get_pos()##positionofmouseonwindow
printposition
pygame.display.set_caption(str(position))##makeitthetitleofthewindow
pygame.display.flip()
閱讀全文

與python如何讓圖片跟著滑鼠移動相關的資料

熱點內容
怎麼把word的柱狀圖變成圖片 瀏覽:753
動漫森女圖片 瀏覽:404
漢服圖片衣服紙樣 瀏覽:749
最美女殺手安娜圖片 瀏覽:746
ppt如何讓圖片背景去掉 瀏覽:737
披發發型圖片優雅 瀏覽:383
word組合圖形和圖片 瀏覽:602
男生專用聊天背景圖片黑色 瀏覽:473
織語毛巾價格圖片 瀏覽:821
漂亮可愛寶可夢圖片 瀏覽:923
小女孩高冷圖片 瀏覽:787
絨線鉤衣服的花樣圖片 瀏覽:948
張敬軒發型圖片 瀏覽:662
word在表格中插入圖片如何布滿 瀏覽:663
短臉蛋發型圖片 瀏覽:855
土酒價格圖片 瀏覽:766
純色簡約黑衣服圖片 瀏覽:628
人心不簡單圖片大全 瀏覽:813
想你了男生圖片動漫 瀏覽:133
臉長男適合的發型圖片 瀏覽:941