求助python中图片颜色过渡的程序!!!!!!!!!!!!!!!!!!!!!!!!!!拜托了><!!!!!!!很急!!

Python/PHP/Perl 开发与设计
回复
PLZHELP
帖子: 1
注册时间: 2011-02-08 15:02
送出感谢: 0
接收感谢: 0

求助python中图片颜色过渡的程序!!!!!!!!!!!!!!!!!!!!!!!!!!拜托了><!!!!!!!很急!!

#1

帖子 PLZHELP » 2011-02-08 15:07

The function must be named myPic()
The function must create a new empty picture with the following properties:
The width must be 256 pixels
The height must be 256 pixels
The background must be black
The picture must be stored in the variable named pic
The function must use the JES show function to display the empty black image (see TODO 3 below)
The function must define a variable named blueVal and set it to zero
The function must use a for loop to change the color of every pixel in the following way:
Inside the loop the blue RGB property of the pixel must be set to the value stored in blueVal
The blueVal must increased by one during each iteration of the loop until it reaches 256 at which time it must be reset to zero (hint: use the modulo operator)
The function must use the JES repaint function to display the updated image (see TODO 4 below)
For grading purposes, the function myPic() described above will be considered composed of the following TODOs:
TODO 3: the function myPic() builds an empty black image of 256×256 pixels and shows it
TODO 4: the function myPic() generates and displays the black to blue gradient filled picture shown in Figure 1
[attachment=0]blue.png[/attachment]
----------------------
*TODO3 我写的是
def myPic():
blankPicture = makeEmptyPicture(256, 256)
pic = blankPicture
show(pic)
但是TODO4实在不知如何做 拜托高手们了!!!!!!><
附件
blue.png
blue.png (7.28 KiB) 查看 595 次
头像
remeber
论坛版主
帖子: 13005
注册时间: 2009-01-06 15:18
来自: 人间
送出感谢: 1 次
接收感谢: 22 次

Re: 求助python中图片颜色过渡的程序!!!!!!!!!!!!!!!!!!!!!!!!!!拜托了><!!!!!!!

#2

帖子 remeber » 2011-02-08 18:34

初学...还不清楚..关注下.
“有一种被人抛诸脑后的过去,包含一些不该遗忘的点点滴滴。欢笑之余,我将故旧拾起,才刹见自己的薄情。人世间似乎存在着某种公平,每个人都曾被抛掷在他人的遗忘中;而今你所有哽咽难宣的话语,也正是你曾为人所期盼,却永远听不见的字句。” —赫曼 赫塞
回复

回到 “Python/Php/Perl”