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.
版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。
工作时间:8:00-18:00
客服电话
电子邮件
admin@qq.com
扫码二维码
获取最新动态