Hi, I\'m drawing a color line by using the cImage module. The following code dra
ID: 663220 • Letter: H
Question
Hi, I'm drawing a color line by using the cImage module. The following code draw a line from top left to bottom right.
import cImage
myImWin = cImage.ImageWin("Line Image",300,300)
lineImage = cImage.EmptyImage(300,300)
redPixel = cImage.Pixel (255,0,0)
for i in range(300):
lineImage.setPixel(i,i,redPixel)
lineImage.draw(myImWin)
lineImage.save('Line Image.gif')
myImWin.exitOnClick()
my question is : how to draw a line from bottom left to top right by just changing the code above?
Appreciate for helping.
Explanation / Answer
make line image from bottom to right.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.