Rescale pixel's size pygame [duplicate]

核能气质少年 提交于 2019-12-25 04:48:47

问题


I'm using pygame 1.9. How to make window bigger, than it's size definite by pixel's size. For example, I create display with 100x100 pixel. And fill it by numpy array.

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()

And it's too small, I even can see anything. I want to rescale it by 600x600 pixels of my display. How to rescale "pixel's size"?


回答1:


I do not really get what you were trying to explain but maybe newSurface = pygame.transform.scale(surface, (newWidth, newHeight)) is the right thing for you.



来源:https://stackoverflow.com/questions/40778994/rescale-pixels-size-pygame

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!