Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 国产日韩精品一区在线不卡,日韩中文在线观看,亚洲高清资源

          整合營(yíng)銷(xiāo)服務(wù)商

          電腦端+手機(jī)端+微信端=數(shù)據(jù)同步管理

          免費(fèi)咨詢(xún)熱線(xiàn):

          使用tkinter開(kāi)發(fā)圖形界面顯示圖片(Win10,

          使用tkinter開(kāi)發(fā)圖形界面顯示圖片(Win10,Python)

          kinter(也叫Tk接?)是Tk圖形?戶(hù)界??具包標(biāo)準(zhǔn)的Python接?。Tk是?個(gè)輕量級(jí)的跨平臺(tái)圖形?戶(hù)界?(GUI)開(kāi)發(fā)?具。

          Tkinter是Python自帶的官方標(biāo)準(zhǔn)庫(kù),安裝Python之后直接導(dǎo)入就可以使用,我們常見(jiàn)的python IDLE就是使用TKinter實(shí)現(xiàn)的。

          在Win10命令行窗口輸入python、import tkinter、dir(tkinter)、help(tkinter),可獲得tkinter的相關(guān)幫助信息。

          help(tkinter)命令的執(zhí)行結(jié)果,列出了模塊幫助文檔的鏈接: https://docs.python.org/3.10/library/tkinter.html

          實(shí)現(xiàn)打開(kāi)并顯示圖片的源代碼如下:


          import tkinter as tk

          import tkinter.filedialog

          from PIL import Image,ImageTk

          #選擇并顯示圖片

          def choosepic():

          path_=tkinter.filedialog.askopenfilename()

          path.set(path_)

          print(path)

          img_open=Image.open(entry.get())

          #img=ImageTk.PhotoImage(img_open.resize((200,200)))

          img=ImageTk.PhotoImage(img_open)

          lableShowImage.config(image=img)

          lableShowImage.image=img

          if __name__=='__main__':

          #生成tk界面 app即主窗口

          app=tk.Tk()

          #修改窗口titile

          app.title("顯示圖片")

          #設(shè)置主窗口的大小和位置

          app.geometry("800x400+200+200")

          #Entry widget which allows displaying simple text.

          path=tk.StringVar()

          entry=tk.Entry(app, state='readonly', text=path,width=100)

          entry.pack()

          #使用Label顯示圖片

          lableShowImage=tk.Label(app)

          lableShowImage.pack()

          #選擇圖片的按鈕

          buttonSelImage=tk.Button(app, text='選擇圖片', command=choosepic)

          buttonSelImage.pack()

          #buttonSelImage.pack(side=tk.BOTTOM)

          #Call the mainloop of Tk.

          app.mainloop()


          假設(shè)將源代碼保存在文件“d:\temp\MyShowImage.py”。在命令行執(zhí)行命令

          python d:\temp\MyShowImage.py

          程序運(yùn)行,界面如下圖所示

          Tkinter(也叫Tk接?)是Tk圖形?戶(hù)界??具包標(biāo)準(zhǔn)的Python接?。Tk是?個(gè)輕量級(jí)的跨平臺(tái)圖形?戶(hù)界?(GUI)開(kāi)發(fā)?具。

          Tkinter是Python自帶的官方標(biāo)準(zhǔn)庫(kù),安裝Python之后直接導(dǎo)入就可以使用,我們常見(jiàn)的python IDLE就是使用TKinter實(shí)現(xiàn)的。

          在Win10命令行窗口輸入python、import tkinter、dir(tkinter)、help(tkinter),可獲得tkinter的相關(guān)幫助信息。

          help(tkinter)命令的執(zhí)行結(jié)果,列出了模塊幫助文檔的鏈接: https://docs.python.org/3.10/library/tkinter.html

          實(shí)現(xiàn)打開(kāi)并顯示圖片的源代碼如下:

          import tkinter as tk

          import tkinter.filedialog

          from PIL import Image,ImageTk

          #選擇并顯示圖片

          def choosepic():

          path_=tkinter.filedialog.askopenfilename()

          path.set(path_)

          print(path)

          img_open=Image.open(entry.get())

          #img=ImageTk.PhotoImage(img_open.resize((200,200)))

          img=ImageTk.PhotoImage(img_open)

          lableShowImage.config(image=img)

          lableShowImage.image=img

          if __name__=='__main__':

          #生成tk界面 app即主窗口

          app=tk.Tk()

          #修改窗口titile

          app.title("顯示圖片")

          #設(shè)置主窗口的大小和位置

          app.geometry("800x400+200+200")

          #Entry widget which allows displaying simple text.

          path=tk.StringVar()

          entry=tk.Entry(app, state='readonly', text=path,width=100)

          entry.pack()

          #使用Label顯示圖片

          lableShowImage=tk.Label(app)

          lableShowImage.pack()

          #選擇圖片的按鈕

          buttonSelImage=tk.Button(app, text='選擇圖片', command=choosepic)

          buttonSelImage.pack()

          #buttonSelImage.pack(side=tk.BOTTOM)

          #Call the mainloop of Tk.

          app.mainloop()


          假設(shè)將源代碼保存在文件“d:\temp\MyShowImage.py”。在命令行執(zhí)行命令

          python d:\temp\MyShowImage.py

          程序運(yùn)行,界面如下圖所示


          點(diǎn)擊“選擇圖片”按鈕,彈出打開(kāi)文件對(duì)話(huà)框,

          選擇要打開(kāi)的圖片文件,點(diǎn)擊“打開(kāi)”按鈕,圖片就會(huì)顯示在圖形界面上了,如下圖所示:



          上述代碼實(shí)現(xiàn)了圖片的選擇和顯示功能,但也有不足之處,比如“沒(méi)有滾動(dòng)條,無(wú)法完全顯示比屏幕大的圖片”。

          相關(guān)參考網(wǎng)頁(yè)

          (1)https://blog.csdn.net/xyzhan/article/details/113856833 (2021年開(kāi)發(fā)Python圖形用戶(hù)界面(GUI)的6種最佳Python GUI框架)

          (2)https://wenku.baidu.com/view/8f03733bf9d6195f312b3169a45177232e60e44d.html (推薦8款常?的PythonGUI圖形界?開(kāi)發(fā)框架)

          (3)https://github.com/honghaier-game/TKinterDesigner (honghaier-game/TKinterDesigner

          (4)https://blog.csdn.net/HG0724/article/details/112248635 (Python之Tkinter進(jìn)行GUI開(kāi)發(fā))

          (5)https://blog.csdn.net/wj0807/article/details/120890111在tkinter中顯示圖片和圖片名

          (6)https://www.cnpython.com/qa/58793 (如何在gui中使用tkinter顯示圖像)

          (7)https://m.php.cn/article/419452.html (python idle是什么)

          (8)https://docs.python.org/3.10/library/tkinter.html (tkinter — Python interface to Tcl/Tk)

          (9)https://blog.csdn.net/tyler880/article/details/106862322?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1-106862322-blog-112248635.pc_relevant_aa&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1-106862322-blog-112248635.pc_relevant_aa&utm_relevant_index=2 (python GUI編程(Tkinter)

          (10)https://www.cnpython.com/qa/308976 (用滾動(dòng)條在Tkinter中顯示多個(gè)圖像)

          • 件版本:
          • 軟件大小:
          • 軟件授權(quán):
          • 適用平臺(tái):
          • 下載http://dl.pconline.com.cn/download/732173.html

          ppt怎么設(shè)置點(diǎn)擊鏈接文字顯示圖片?

          1、首先,打開(kāi)PTP,找到需要鏈接的文字,然后選中該文字,比如圖中的“趟門(mén)柜”

          2、選擇工具欄中的“插入”,再選擇“超鏈接”,如圖中所示

          3、就會(huì)彈出一個(gè)插入超鏈接的窗口,然后我們?cè)诓檎曳秶抢镞x擇我們要鏈接的圖片的路徑,選擇要鏈接的圖片,在單擊“確定”,如圖所示

          4、操作完第三步之后發(fā)現(xiàn),我們選擇超鏈接的文字變顏色了,這代表我們已經(jīng)鏈接成功

          5、播放PTP,然后單擊變顏色的文字,如圖中”趟門(mén)柜”

          6、操作完第五步后,就好彈出我們剛剛選擇鏈接的圖片

          生javascript實(shí)現(xiàn)帶動(dòng)畫(huà)的提示型彈窗,常用于網(wǎng)站彈層的彈窗也有很多,一般用插件比較多,所以今天就來(lái)寫(xiě)一寫(xiě)該功能,如有錯(cuò)誤之處請(qǐng)指出!

          彈出跟消失都有放大縮小動(dòng)畫(huà)在里面!

          實(shí)現(xiàn)方法:

          html:

          可以自己輸入內(nèi)容,再點(diǎn)擊彈出即可看到彈窗效果

          css:

          javascript:


          主站蜘蛛池模板: 亚洲AV日韩AV天堂一区二区三区 | 一区一区三区产品乱码| 一级特黄性色生活片一区二区| 一区二区三区四区精品| 色狠狠色狠狠综合一区| 韩国一区二区视频| 综合人妻久久一区二区精品| 国产综合无码一区二区色蜜蜜| 国产亚洲无线码一区二区| 日本一区免费电影| 日韩一区二区三区无码影院| 午夜福利国产一区二区| 国产一区在线mmai| 中文字幕在线观看一区二区三区 | 国产suv精品一区二区6| 天堂国产一区二区三区| 精品亚洲一区二区三区在线观看 | 人妻少妇AV无码一区二区| 午夜爽爽性刺激一区二区视频| 精品视频无码一区二区三区 | 日本精品一区二区三区在线观看| 国产福利电影一区二区三区,亚洲国模精品一区 | 一区二区三区免费在线视频| 日韩AV片无码一区二区不卡| 暖暖免费高清日本一区二区三区| 中文字幕日韩一区| 中文字幕无码不卡一区二区三区| 亚洲AV综合色区无码一区爱AV| 无码人妻一区二区三区在线视频| 国产丝袜视频一区二区三区| 人妻少妇精品一区二区三区| 国产av熟女一区二区三区| 亚洲一区精品无码| 精品国产福利第一区二区三区| 亚洲国产高清在线一区二区三区 | 毛片一区二区三区| 免费一本色道久久一区| 国产精品无码一区二区三区免费| 一区二区三区免费视频观看| 农村人乱弄一区二区| 午夜福利av无码一区二区 |