python isdigit,python获取图片大小_如何在pygame(python)中获取图片大小

 2023-09-23 阅读 28 评论 0

摘要:If I'm using an image and I want to know the image's size in the file. There is a function to get the picture's height and width ? EDIT: Of course I loaded the image to the program with pygame.image.load(PATH). 解决方案 I believe you need to

1586010002-jmsa.png

If I'm using an image and I want to know the image's size in the file.

There is a function to get the picture's height and width ?

EDIT: Of course I loaded the image to the program with pygame.image.load(PATH).

解决方案

I believe you need to load the image as a Surface before you can get its width and height. You do that with foo = pygame.image.load(PATHNAME).

python isdigit?Then you can get the width and height by creating a Rectangle with foo.get_rect() and asking the rectangle.

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/2/89337.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息