Created
May 15, 2020 16:12
-
-
Save essamamdani/ab2dbeb4ee8f0a59dc7cf19097018a56 to your computer and use it in GitHub Desktop.
displaying image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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