2016-11-24 96 views
0

我正在使用pygame 1.9。 如何使窗口更大,比按照像素大小确定的大小更大。例如,我创建100x100像素的显示。 并用numpy数组填充它。重新调整像素的大小pygame

screenarray=np.zeros((100, 100)) 
screenarray.fill(10) 
screen = pygame.display.set_mode((100,100)) 
surface = pygame.surfarray.make_surface(screenarray) 
screen.blit(surface, (0, 0)) 
pygame.display.flip() 

它太小了,我什至可以看到任何东西。 我想重新调整它的600x600像素的显示。 如何重新调整“像素大小”?

回答

0

我真的不明白你想解释什么,但也许newSurface = pygame.transform.scale(surface,(newWidth,newHeight))对你来说是正确的。

+0

我想创建窗口(200x200),但我的输入数据是numpy数组只有100x100 – weider

+0

做newSurface = pygame.transform.scale(surface,(newWidth,newHeight)) – WYCE

+0

@WYCE请将评论移动到答案使用[编辑]选项。 –