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 :: change django administration title 
Python :: legend size matplotlib 
Python :: Import "reportlab" could not be resolved django 
Python :: convert column in pandas to datetime 
Python :: save thing in pickle python 
Python :: python read json file 
Python :: pandas read csv no index 
Python :: remove column from df 
Python :: XLRDError: Excel xlsx file; not supported 
Python :: upgrade python version mc 
Python :: download files from google colab 
Python :: python kivy Kivy files require #:kivy ! 
Python :: selenium python find all links 
Python :: how to add text in python turtle 
Python :: copy text to clipboard python 
Python :: bold text variable in python 
Python :: gdscript string format 
Python :: flip a plot matplotlib 
Python :: python upload video to youtube 
Python :: set axis labels python 
Python :: 8 ball responses list python 
Python :: how to scroll down to end of page in selenium python 
Python :: get python directiory 
Python :: show image in tkinter pillow 
Python :: unzip file python 
Python :: python get day name 
Python :: create guid python 
Python :: pandas drop all columns except certain ones 
Python :: copy image from one folder to another in python 
Python :: hyperlinks in jupyter notebook 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =