[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] can't load image ?



Howdy~

before i go that far i want to display an image but it didnt work ? below is my code, anyone indicate the errors will be welcome, thanx~

[code]
import pygame

# Initialize first~
pygame.init()

imgPath = "F:\\myself\\works\\Python\\test.jpg"
bg = pygame.image.load(imgPath)
bgWidth = bg.get_width()
bgHeight = bg.get_height()
screen = pygame.display.set_mode((bgWidth, bgHeight))
bg.convert()
print bgWidth, bgHeight
screen.blit(bg, (0, 0))

while 1:
    pass 
[/code]