Java创建画布的挑战 [英] Java Challenge on Creating a Canvas

查看:146
本文介绍了Java创建画布的挑战的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个基本问题。但是,我已经完成了Java绝对入门的Java编程第9章的阅读,并且已经接近挑战部分。我不太明白这个问题。



问题提示:

 创建一个绘制一个画布的画布一边是黑暗的渐变,慢慢地
会移向另一边变得更轻。

这可能是有用的信息:在这个质询问题之前,'gradient'这个词没有出现代码方法或在文本中。我还没有学到任何有关动画的知识,因为这个问题指出了移到另一边。

对这个问题的回答可能有助于许多新Java程序员理解Graphics和Canvas。



我不想要一个编码答案(除非有必要),只是这个问题用更基本的术语解释,以及我必须采取的程序。非常感谢您在这件事上的时间和合作。

解决方案

渐变是指颜色渐变,即在一个二维区域内从一种颜色逐渐过渡到另一种颜色。



说缓慢和随着它移动,它们并不意味着动画;图像本身将是静态的。你可以认为这意味着如果你的眼睛从一侧移动到另一侧,你会慢慢看到颜色从黑暗变为明亮。



即 - —他们想要这样的东西:




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.

解决方案

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:

这篇关于Java创建画布的挑战的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆