Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to change the scale of a picture 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 :: python use tqdm with concurrent futures 
Python :: get the current year in python 
Python :: get external ip python 
Python :: drop a range of rows pandas 
Python :: pygame get screen width and height 
Python :: conda install lxml 
Python :: torch device 
Python :: drop a column pandas 
Python :: how to get the calendar of current month in python 
Python :: mac upgrade python to 3.8 
Python :: scipy version check 
Python :: mypy ignore type 
Python :: python read json 
Python :: bytes to string python 
Python :: How to play music without pygame 
Python :: python saving a screentshot with PIL 
Python :: python convert list to true falsebased on condition 
Python :: invert y axis python 
Python :: cube finder python 
Python :: copy whole directory python 
Python :: check python version mac 
Python :: install requests python 
Python :: save plot as pdf python 
Python :: import user in django 
Python :: get page source code selenium python 
Python :: hide root window tkinter 
Python :: python random number between 1 and 100 
Python :: pandas plotly backend 
Python :: python3 install google 
Python :: how to set the screen brightness using python 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =