我需要做一个指示: 一种将参数“l”和“h”(长度和宽度)两个整数假定为正,并将文件名与图像的相应扩展名合并的过程。它将创建一个长度为“l”、宽度为“h”的窗口,并将随机值(R、G、B形式)影响到每个像素,最后它将以传入参数的名称将此图像保存在当前目录中
这是我的(混乱的)代码:
def surf (l, h, imagech):
pygame.init()
ecran = pygame.display.set_mode("RGB",(l, h))
fond = pygame.image.load("MPchiffre.bmp").convert()
surface.blit(fond, (0,0))
pygame.display.flip()
continue = 1
while continue:
continue = int(input())
pixels = getPixelArray('MPchiffre.bmp')
nu.random.randint(0, 255)
pygame.image.save(surface, "imagech.bmp")
我的主要问题是语法基础和对python的基本理解,我没有时间回顾所有内容,如果有人能告诉我这段代码的错误,那就太好了
目前没有回答
相关问题 更多 >
编程相关推荐