Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
displaying image
import pygame
pygame.init()
displayWidth = 800
displayHeight = 600
surface= pygame.display.set_mode((displayWidth, displayHeight ))
pygame.display.set_caption('Image')
displayImage = pygame.image.load(r'C:\Users\user\Pictures\image.jpg')
while True :
surface.fill((255,255,255))
surface.blit(displayImage, (0, 0))
for event in pygame.event.get() :
if event.type == pygame.QUIT :
pygame.quit()
quit()
pygame.display.update()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.