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

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 :: change pyplot dpi 
Python :: python currnent time now 
Python :: install reportlab python 
Python :: how to convert a column to datetime in pandas 
Python :: how to make a letter animation in python 
Python :: unique values in pyspark column 
Python :: get gpu device name tensorflow 
Python :: random number python 
Python :: install xgboost 
Python :: install django rest framework 
Python :: warning ignore python 
Python :: show full pd dataframe 
Python :: ValueError: Tz-aware datetime.datetime cannot be converted to datetime64 unless utc=True site:stackoverflow.com 
Python :: how to change pygame window icon 
Python :: copy to clipboard python 
Python :: python windows notification 
Python :: AssertionError: Torch not compiled with CUDA enabled 
Python :: heroku run python manage.py migrate 
Python :: create dictionary python from two lists 
Python :: where to import render in django 
Python :: check 32 or 64 bit python 
Python :: Extract images from html page based on src attribute using beatutiful soup 
Python :: ind vs wi 
Python :: Python project root dir 
Python :: unzip in python 
Python :: python strip non numeric in string 
Python :: how to convert datetime to jdatetime 
Python :: How to config your flask for gmail 
Python :: search code ascii python 
Python :: get longest shortest word in list python 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =