嗨,我正在尝试在Jython环境中为学生制作一个裁剪函数。在
我也在尝试如何使画布的大小,所有的新像素将采取。在
有什么帮助吗
def crop(pic, startX, endX, startY, endY):
canvas = makeEmptyPicture(500, 800)
for sourceX in range(startX, endX):
for sourceY in range(startY, endY):
color = getColor(getPixel(pic, sourceX, sourceY))
setColor(getPixel(canvas, startX, startY), color)
startY = startY + 1
startX = startX + 1
show(canvas)
试试这个:
注意:结果画布的大小可以从(endX-startX)x(endY-startY)获得
给予:
……………………………….。。。。。。。。。。。
输出参数错误:
^{pr2}$相关问题 更多 >
编程相关推荐