Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to find the width of a image pygame

width = surface.get_size()[0]
height = surface.get_size()[1]
Comment

how to reduce width of image in pygame

import pygame
picture = pygame.image.load(filename)
picture = pygame.transform.scale(picture, (1280, 720))
Comment

pygame size of image

image = pygame.image.load("path/to/file.png")  # load image

width, height = image.get_width(), image.get_height()  # get size
print(width, height)  # print size

"""
OUTPUT:
(50, 50)
"""
Comment

PREVIOUS NEXT
Code Example
Python :: In file included from psycopg/psycopgmodule.c:28:./psycopg/psycopg.h:35:10: fatal error: Python.h: No such file or directory35 | #include <Python.h| ^~~~~~~~~~compilation terminated. 
Python :: pandas python group by for one column and sum another column 
Python :: django signup view 
Python :: time.sleep() faster 
Python :: pandas read dictionary 
Python :: np vstack 
Python :: how to create frequency table in python 
Python :: python pillow resize image 
Python :: mediafileupload python example 
Python :: opencv erosion 
Python :: Python function to calculate LCM of 2 numbers. 
Python :: pygame how to draw a rectangle 
Python :: seaborn countplot 
Python :: pandas change to first day 
Python :: python how to check if a functions been called 
Python :: python print numbers 1 to 10 in one line 
Python :: stop program python 
Python :: How to check for palindromes in python 
Python :: converting int to binary python 
Python :: count unique pandas 
Python :: numpy matrix power 
Python :: conda python update 
Python :: numpy arrauy to df 
Python :: live plot loss 
Python :: python column multiply 
Python :: django.db.utils.ProgrammingError: relation "users" does not exist in django 3.0 
Python :: output path jupyter 
Python :: float to string python 
Python :: dataframe row print 
Python :: print pattern a shape in python 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =