加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

python linux – 显示带有文件名的图像作为查看器窗口标题

发布时间:2020-12-20 13:17:22 所属栏目:Python 来源:网络整理
导读:当我使用PIL Image显示图像时,它会打开一个imagemagick窗口,但标题是一些像’tmpWbfj48Bfjf’这样的乱码.如何使图像文件名成为查看器窗口的标题? 解决方法 使用title属性:Image.show(title =“Your Title Here”[…] 从documentation: Image.show(title=N
当我使用PIL Image显示图像时,它会打开一个imagemagick窗口,但标题是一些像’tmpWbfj48Bfjf’这样的乱码.如何使图像文件名成为查看器窗口的标题?

解决方法

使用title属性:Image.show(title =“Your Title Here”[…]

从documentation:

Image.show(title=None,command=None) Displays this image. This method
is mainly intended for debugging purposes.

On Unix platforms,this method saves the image to a temporary PPM
file,and calls the xv utility.

On Windows,it saves the image to a temporary BMP file,and uses the
standard BMP display utility to show it (usually Paint).

Parameters: title – Optional title to use for the image window,where possible. command – command used to show the image

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读