public struct MyColor
{
public int red;
public int green;
public int blue;
}
class Program
{
static void Main(string[] args)
{
MyColor onecolor;
color .red =;
color .green =;
color .blue =;
Console.WriteLine("颜色" + Convert.ToString(onecolor.blue));作者: 张伟86 时间: 2013-5-1 12:45
我觉得应该是楼主理解的那样,使用结构体来定义类似RGB结构;而代码应该是red=255,green=0,blue=0;即:
public struct MyColor
{
public int red;
public int green;
public int blue;
}
class Program
{
static void Main(string[] args)
{
MyColor onecolor;
onecolor.red =255;
onecolor.green =0;
onecolor.blue =0;