到目前为止,这是我的代码,我的问题是如何使白色网格线变粗并保持25像素?请帮忙
def grid():
picture = makeEmptyPicture(365,365,black)
w = getWidth(picture)
h = getHeight(picture)
vertical = 25
horizontal = 25
for y in range(0,h):
for x in range(0,w):
if (x % horizontal ==0 or y % vertical == 0):
px = getPixel(picture,x,y)
setColor(px, white)
show(picture)
return picture
答案 0 :(得分:0)
要使你的线更大,请尝试绘制2条线。例如
px1 = getPixel(picture, x, y+1)
px2 = getPixel(picture, x, y+1)
setColor(px1, white)
setColor(px2, white)
这将使线沿X轴变大。
至于保持线条间隔25个像素,尝试在每次迭代后将外部循环增加26个。