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 :: what is NoReverseMatch in django? 
Python :: children beautiful soup 
Python :: flask remove file after send_file 
Python :: cd in python 
Python :: python round to two decimals 
Python :: lambda python 
Python :: string to list python 
Python :: writerows to existing csv python 
Python :: How to construct a prefix sum array in python? 
Python :: find duplicated entries present in a list 
Python :: fork function in python 
Python :: how to run pyttsx3 in a loop 
Python :: dataclass default list 
Python :: can list comprehenios contain else 
Python :: column type pandas as numpy array 
Python :: pandas select first within groupby 
Python :: python get subset of dictionary 
Python :: grouped bar chart matplotlib 
Python :: import antigravity in python 
Python :: use matplotlib in python 
Python :: python face recognition 
Python :: pandas split dataframe into chunks with a condition 
Python :: max pooling in cnn 
Python :: how to find highest number in list without using max function python 
Python :: python sort array by value 
Python :: keyboardinterrupt python 
Python :: strp datetime 
Python :: split python strings into pairs & complete uneven pairs 
Python :: Python program to print even numbers in a list 
Python :: import get user model django 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =