ThefunctionmustbenamedmyPic()Thefunctionmustcreateanewemptypicturewiththefollowingproperties:Thewidthmustbe256pixelsTheheightmustbe256pixelsThebackgroundmustbeblackThepic...
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
TODO4实在不知如何做 拜托高手们了!!!!
展开