Skip to content

Instantly share code, notes, and snippets.

@essamamdani
Created May 15, 2020 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save essamamdani/ab2dbeb4ee8f0a59dc7cf19097018a56 to your computer and use it in GitHub Desktop.
Save essamamdani/ab2dbeb4ee8f0a59dc7cf19097018a56 to your computer and use it in GitHub Desktop.
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