Java Challenge on Creating a Canvas

Deadly 提交于 2019-12-13 06:43:29

问题


This is probably an elementary question. However, I have completed reading the 9th Chapter of Java Programming for the Absolute Beginner and have approached the Challenges section. I cannot quite understand the question.

The question asks:

"Create a Canvas that paints a gradient that’s dark on one side and slowly
gets lighter as it moves to the other side."  

This might be helpful information: prior to this challenge question, the word 'gradient' has not appeared within code methods or within the text. I have not yet learned anything about animation as the question states "moves to the other side."

An answer to this question can potentially aid many new Java programmers in understanding Graphics and Canvas.

I DO NOT want a coding answer (unless necessary), just this question explained in more basic terms along with what procedures I must take. Thank you very much for your time and cooperation regarding this matter.


回答1:


By "gradient" they mean a color gradient, that is, a gradual transition from one color to another across a two-dimensional region.

When they say "slowly" and "as it moves", they don't mean animation; the image itself will be static. You can think of it as meaning that if your eye were to move across the region from one side to the other, you would slowly see the color change from dark to light.

That is — they want something like this:



来源:https://stackoverflow.com/questions/14093303/java-challenge-on-creating-a-canvas

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!