计算机中常用RGB(red,green,blue)函数来表示图像的色彩,如RGB(255,0,0)表示红色。已知红色和蓝色叠加是洋红色,则下列选项中表示洋红色的是()。
第1题:
阅读以下说明和Java代码,将应填入(n)处的语句写在对应栏内。
【说明】
本程序通过移动滑动条修改颜色RGB值,从而控制颜色。程序中有一个面板、3个标签和3个滑动条,标签和滑动条一一对应,分别对应三原色红、绿、蓝,任意拖动其中的一个滑动条,所对应的颜色值就会发生变化,面板的颜色也会发生对应的变化,如下图所示,滑动条值的范围是0~255。
【Java代码】
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class simple extends JFrame. implements AdjustmentListener{
public simple(){
setTitle("simple");
setSize(300, 200);
addWindowListener(new WindowAdapter(){
public void windowClosing((1)){
System.exit(0);
}
});
Container contentPane=getContentPane();
JPanel p=(2);
p.setLayout(new GridLayout(3, 2));
p.add(redLabel=new JLabel("Red 0"));
p.add(red=new JScrollBar(Adjustable. HORIZONTAL, 0, 0, 0, 255));
red.setBlocklncrement(16);
red.addAdjustmentListener(this);
p.add(greenLabel=(3) ("Green 0"));
p.add(green=new JScrollBar(Adjustable.HORIZONTAL 0, 0, 0, 255));
green setBIocklncrement(16);
green.addAdjustmentListener(this);
p.add(blueLabel=new JLabel("Blue 0"));
p.add(btue=new JScrollBar(Adjustable. HORIZONTAL, 0, 0, 0, 255));
blue,setBIocklncrement(16);
blue.addAdjustmentListener(this);
contentPane.add(p, "South");
colorPanet=new JPanel();
colorPanet.setBackground(new Color(0, 0, 0));
contentPane.add((4),"Center");
} public void adjustmentValueChanged(AdjustmentEvent evt){
redLabel.setText("Red"+red.getValue());
greenLabel.setText("Green"+green.getValue());
blueLabel.setText("Blue"+blue.getValue());
coiorPanel.setBackground(new Color(red.getValue(), green.getValue(), blue.getValue()));
colorPanel.repaint();
}
public static void main(String[] args){
JFrame. f=(5);
f.show();
}
private JLabel redLabel;
private JLabel greenLabel;
private JLabel blueLabel;
private JScrollBar red;
private JScroilBar green;
private JScrollBar blue;
private JPanel colorPanel;
第2题:
A.red with envy
B.white with envy
C.blue with envy
D.green with envy
第3题:
Aolor:=‘green‘;
Bwriteln(green);
Cwriteln(color);
Da:=color=red;
第4题:
以下选项中能正确把c1定义成结构体变量的是( )。
A.typedef struct { int red; int red; int green; int blue; }COLOR; COLOR c1;
B.struct color c1 { int red int red; int green int blue; };
C.stmctcolor { int red, int green; int blue; }c1;
D.struct { int red; int green; int blue; }c1;
第5题:
以下选项中不能正确把c1定义成结构体变量的是
A.typedef struct { int red; int green;; int blue; }COLOR; COLOR cl;
B.struct color cl { int red; int green; int blue; };
C.struet color { int red; int green; int blue; }c1;
D.struct { int red; int green; int blue; }cl;
第6题:
A.for(Colorc:Color.values())
B.for(Colorc=RED;c<=BLUE;c++)
C.for(Colorc;c.hasNext();c.next())
D.for(Colorc=Color[0];c<=Color[2];c++)
E.for(Colorc=Color.RED;c<=Color.BLUE;c++)
第7题:
以下选项中不能正确把cl定义成结构体变量的是
A.typedef struct { int red; int green; int blue; } COLOR; COLOR cl;
B.struct color cl { int red; int green; int blue; }
C.struct color { int red; int green; int blue; } cl;
D.struct { int red; int green; int blue; } cl;
第8题:
以下选项中不能正确把c1定义成结构体变量的是
A.typedef struct {int red: int green: int blue; } COLOR; COLOR c1;
B.struct color c1 {int red int green: int blue; };
C.struct color {int red , int green : int blue : )cl;
D.struct {int red; int green; int blue } c1 ;
第9题:
下列选项中不能正确定义结构体的是_______。
A.typedef struct
B.struct color cl {int red; {int red; int green; int green; int blue; int blue; }COLOR; }; COLOR cl;
C.struct color
D.struct {int red; {int red; int green; int green; int blue; int blue; }cl; }cl;
第10题:
对于这样的一个枚举类型:
enum Color:byte
{
Red,
Green,
Blue,
Orange
}