Пример #1
0
        protected override void WriteDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            ele.TryPathTo("Bounds/X", true, out subEle);
            subEle.Value = XBound.ToString("G15");

            ele.TryPathTo("Bounds/Y", true, out subEle);
            subEle.Value = YBound.ToString("G15");

            ele.TryPathTo("Bounds/Z", true, out subEle);
            subEle.Value = ZBound.ToString("G15");

            ele.TryPathTo("Color/Red", true, out subEle);
            subEle.Value = Red.ToString("G15");

            ele.TryPathTo("Color/Green", true, out subEle);
            subEle.Value = Green.ToString("G15");

            ele.TryPathTo("Color/Blue", true, out subEle);
            subEle.Value = Blue.ToString("G15");

            ele.TryPathTo("Unknown", true, out subEle);
            subEle.Value = Unknown.ToHex();

            ele.TryPathTo("Type", true, out subEle);
            subEle.Value = Type.ToString();
        }
 public void Display()
 {
     Console.WriteLine(CardNumber + ", " + FlavorText);
     Console.WriteLine(Strain);
     Console.WriteLine("Red    : " + Red.ToString());
     Console.WriteLine("Orange : " + Orange.ToString());
     Console.WriteLine("Yellow : " + Yellow.ToString());
     Console.WriteLine("Blue   : " + Blue.ToString());
 }
Пример #3
0
        private Color GetRGB(long RGB)
        {
            long Red, Green, Blue;

            Red   = RGB & 255;
            Green = RGB % 256 & 255;
            Blue  = RGB % 256 ^ 2 & 255;
            Console.WriteLine("RGB: " + Blue.ToString() + ", " + Green.ToString() + ", " + Red.ToString());
            return(Color.FromArgb((int)Blue, (int)Green, (int)Red));
        }
Пример #4
0
        public override string ToString()
        {
            var css = $"rgb";
            var r   = Red.ToString("F0", CultureInfo.InvariantCulture);
            var g   = Green.ToString("F0", CultureInfo.InvariantCulture);
            var b   = Blue.ToString("F0", CultureInfo.InvariantCulture);
            var o   = Opacity.ToString("F1", CultureInfo.InvariantCulture);

            css += (Opacity != 1 ? "a" : "") + "(";
            css += $"{r},{g},{b}";
            css += (Opacity != 1 ? $",{o}" : "") + ")";
            return(css);
        }
Пример #5
0
        public void WriteXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            ele.TryPathTo("Red", true, out subEle);
            subEle.Value = Red.ToString();

            ele.TryPathTo("Green", true, out subEle);
            subEle.Value = Green.ToString();

            ele.TryPathTo("Blue", true, out subEle);
            subEle.Value = Blue.ToString();

            ele.TryPathTo("Alpha_Unused", true, out subEle);
            subEle.Value = Alpha_Unused.ToString();
        }
Пример #6
0
        /// <summary>Converts the current instance to an equivalent <see cref="string" /> value.</summary>
        /// <param name="format">The format to use or <c>null</c> to use the default format.</param>
        /// <param name="formatProvider">The provider to use when formatting the current instance or <c>null</c> to use the default provider.</param>
        /// <returns>An equivalent <see cref="string" /> value for the current instance.</returns>
        public string ToString(string?format, IFormatProvider?formatProvider)
        {
            var separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator;

            return(new StringBuilder(7 + (separator.Length * 2))
                   .Append('<')
                   .Append(Red.ToString(format, formatProvider))
                   .Append(separator)
                   .Append(' ')
                   .Append(Green.ToString(format, formatProvider))
                   .Append(separator)
                   .Append(' ')
                   .Append(Blue.ToString(format, formatProvider))
                   .Append('>')
                   .ToString());
        }
Пример #7
0
    void Update()
    {
        if (StartGame.Clicked && !End)
        {
            if (RedCube.transform.position.y < -25f)
            {
                Blue++;
                BlueScore.text = Blue.ToString();
            }

            if (BlueCube.transform.position.y < -25f)
            {
                Red++;
                RedScore.text = Red.ToString();
            }
            StartCoroutine(Win());
        }
    }
Пример #8
0
        public void WriteXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            ele.TryPathTo("Time", true, out subEle);
            subEle.Value = Time.ToString("G15");

            ele.TryPathTo("Color/Red", true, out subEle);
            subEle.Value = Red.ToString("G15");

            ele.TryPathTo("Color/Green", true, out subEle);
            subEle.Value = Green.ToString("G15");

            ele.TryPathTo("Color/Blue", true, out subEle);
            subEle.Value = Blue.ToString("G15");

            ele.TryPathTo("Color/Alpha", true, out subEle);
            subEle.Value = Alpha.ToString("G15");
        }
 /// <summary>
 /// Returns a <see cref="System.String"/> that describes this instance.
 /// </summary>
 /// <returns>A <see cref="System.String"/> that describes this instance.</returns>
 public override string ToString()
 {
     return(string.Format("{0} ({1})", BitsPerPixel, (IsIndexed ? " indexed" : Red.ToString() + Green.ToString() + Blue.ToString() + Alpha.ToString())));
 }
Пример #10
0
 new public void writeURDF(XmlWriter writer)
 {
     writer.WriteStartElement("color");
     writer.WriteAttributeString("rgba", Red.ToString() + " " + Green.ToString() + " " + Blue.ToString() + " " + Alpha.ToString());
     writer.WriteEndElement();
 }
        //private void make_change(object sender, EventArgs e)
        //{
        //    second_count++;
        //    second_count %= 38;
        //    this.Title = second_count.ToString();
        //    //System.Threading.Thread.Sleep(5000);
        //    OpenGL gl = myGLCon.OpenGL;
        //    ////gl = e.OpenGL;
        //    ////  Load the identity matrix.
        //    ////gl.LoadIdentity();
        //    ////  Set the clear color.
        //    //gl.ClearColor(1, 1, 1, 0);
        //    //////  Clear the color and depth buffer.
        //    //gl.Clear(OpenGL.GL_COLOR_BUFFER_BIT | OpenGL.GL_DEPTH_BUFFER_BIT);
        //    //gl.LoadIdentity();
        //    //gl.Flush();
        //    for (int index = 0; index != ds.Tables[0].Rows.Count; ++index)
        //    {
        //        DataRow dr = ds.Tables[0].Rows[index];
        //        if (tag_arr[index] == true)
        //            continue;
        //        else
        //        {
        //            myGLCon_drawWireFram((float)dr["lx"], (float)dr["lz"], (float)dr["ly"], (float)dr["hx"], (float)dr["hz"], (float)dr["hy"]);
        //            myGLCon_drawCube((float)dr["lx"], (float)dr["lz"], (float)dr["ly"], (float)dr["hx"], (float)dr["hz"], (float)dr["hy"], 0.5f, 0.5f, 0.5f);
        //            tag_arr[index] = true;
        //            break;
        //        }
        //    }

        //}
        //动画演示,初始化

        //private void myGLCon_OpenGLDraw(object sender, OpenGLEventArgs args)
        //{
        //    gl = myGLCon.OpenGL;
        //    //  Clear the color and depth buffer.
        //    //gl.ClearColor(1, 1, 1, 0);
        //    //gl.Clear(OpenGL.GL_COLOR_BUFFER_BIT | OpenGL.GL_DEPTH_BUFFER_BIT);

        //    //  Load the identity matrix.
        //    //gl.LoadIdentity();

        //    //  Rotate around the Y axis.
        //    gl.Rotate(rotation, 0.0f, 1.0f, 0.0f);
        //    //画车厢线框图
        //    myGLCon_drawWireFram(0.0f, 0.0f, 0.0f, 5.0f, 2.0f, 2.0f);
        //    ////动态展示箱子
        //    //全部置为false
        //    for (int index = 0; index != ds.Tables[0].Rows.Count; ++index)
        //    {
        //        tag_arr[index] = false;
        //    }
        //    ////取得箱子总数
        //    int box_number = ds.Tables[0].Rows.Count;
        //    //DispatcherTimer timer = new DispatcherTimer();//定时器
        //    //timer.Interval = TimeSpan.FromMilliseconds(10000);//定时10毫秒
        //    //timer.Tick += new EventHandler(make_change);
        //    //timer.IsEnabled = true;
        //    //timer.Start();
        //    //foreach (DataRow dr in ds.Tables[0].Rows)
        //    //{
        //    //    float Blue, Red, Green;
        //    //    string temp;

        //    //    temp = dr["distance"].ToString();
        //    //    if (!ColorHashTable.ContainsKey(dr["distance"].ToString()))
        //    //    {
        //    //        Random ra = new Random();
        //    //        Blue = (float)ra.NextDouble();
        //    //        Red = (float)ra.NextDouble();
        //    //        Green = (float)ra.NextDouble();
        //    //        ColorHashTable.Add(dr["distance"].ToString(), Blue.ToString() + " " + Red.ToString() + " " + Green.ToString());
        //    //    }
        //    //    else
        //    //    {
        //    //        string AllColor = ColorHashTable[dr["distance"].ToString()].ToString();
        //    //        string[] ColorArray = AllColor.Split(' ');
        //    //        Blue = (float)Convert.ToDecimal(ColorArray[0]);
        //    //        Red = (float)Convert.ToDecimal(ColorArray[1]);
        //    //        Green = (float)Convert.ToDecimal(ColorArray[2]);
        //    //    }
        //    //    //画箱子线框图
        //    //    //drawWireFram((float)dr["lx"], (float)dr["ly"], (float)dr["lz"], (float)dr["hx"], (float)dr["hy"], (float)dr["hz"]);
        //    //    //drawCube((float)dr["lx"], (float)dr["ly"], (float)dr["lz"], (float)dr["hx"], (float)dr["hy"], (float)dr["hz"], Red, Green, Blue);
        //    //    drawWireFram((float)dr["lx"], (float)dr["lz"], (float)dr["ly"], (float)dr["hx"], (float)dr["hz"], (float)dr["hy"]);
        //    //    drawCube((float)dr["lx"], (float)dr["lz"], (float)dr["ly"], (float)dr["hx"], (float)dr["hz"], (float)dr["hy"], Red, Green, Blue);

        //    //    second_count++;
        //    //}
        //}
        /// <summary>
        /// Handles the OpenGLDraw event of the openGLControl1 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="args">The <see cref="SharpGL.SceneGraph.OpenGLEventArgs"/> instance containing the event data.</param>
        private void openGLControl_OpenGLDraw(object sender, OpenGLEventArgs args)
        {
            //  Get the OpenGL object.
            OpenGL gl = openGLControl.OpenGL;

            //gl = args.OpenGL;
            //  Clear the color and depth buffer.
            gl.Clear(OpenGL.GL_COLOR_BUFFER_BIT | OpenGL.GL_DEPTH_BUFFER_BIT);

            //  Load the identity matrix.
            //gl.LoadIdentity();

            //  Rotate around the Y axis.
            gl.Rotate(rotation, 0.0f, 1.0f, 0.0f);
            //画车厢线框图
            openGLControl_drawWireFram(0.0f, 0.0f, 0.0f, 5.0f, 2.0f, 2.0f);

            //画坐标系  车厢的坐标
            //x轴
            gl.LineWidth(2.5f);
            gl.Color(1.0, 0.0, 0.0);
            gl.Begin(OpenGL.GL_LINES);
            gl.Vertex(-1.0f, 0.0f, 0.0f);
            gl.Vertex(6.0f, 0.0f, 0.0f);
            gl.End();

            //y轴
            gl.LineWidth(2.5f);
            gl.Color(0.0, 1.0, 0.0);
            gl.Begin(OpenGL.GL_LINES);
            gl.Vertex(0.0f, -1.0f, 0.0f);
            gl.Vertex(0.0f, 5.0f, 0.0f);
            gl.End();

            //z轴
            gl.LineWidth(2.5f);
            gl.Color(0.0, 0.0, 1.0);
            gl.Begin(OpenGL.GL_LINES);
            gl.Vertex(0.0f, 0.0f, -1.0f);
            gl.Vertex(0.0f, 0.0f, 4.0f);
            gl.End();
            gl.Flush();
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                //myTextBlock.Text += dr["box_id"].ToString() + "(" + dr["lx"].ToString() + "," + dr["ly"].ToString() + "," + dr["lz"].ToString() + ","
                //                    + dr["hx"].ToString() + "," + dr["hy"].ToString() + "," + dr["hz"].ToString() + ") ";
                float  Blue, Red, Green;
                string temp;

                temp = dr["distance"].ToString();
                string dis = dr["distance"].ToString();
                if (!ColorHashTable.ContainsKey(dr["distance"].ToString()))
                {
                    Random ra = new Random();
                    Blue  = (float)ra.NextDouble();
                    Red   = (float)ra.NextDouble();
                    Green = (float)ra.NextDouble();
                    ColorHashTable.Add(dr["distance"].ToString(), Blue.ToString() + " " + Red.ToString() + " " + Green.ToString());
                }
                else
                {
                    string   AllColor   = ColorHashTable[dr["distance"].ToString()].ToString();
                    string[] ColorArray = AllColor.Split(' ');
                    Blue  = (float)Convert.ToDecimal(ColorArray[0]);
                    Red   = (float)Convert.ToDecimal(ColorArray[1]);
                    Green = (float)Convert.ToDecimal(ColorArray[2]);
                }
                //画箱子线框图
                //drawWireFram((float)dr["lx"], (float)dr["ly"], (float)dr["lz"], (float)dr["hx"], (float)dr["hy"], (float)dr["hz"]);
                //drawCube((float)dr["lx"], (float)dr["ly"], (float)dr["lz"], (float)dr["hx"], (float)dr["hy"], (float)dr["hz"], Red, Green, Blue);
                openGLControl_drawWireFram((float)dr["lx"], (float)dr["lz"], (float)dr["ly"], (float)dr["hx"], (float)dr["hz"], (float)dr["hy"]);
                openGLControl_drawCube((float)dr["lx"], (float)dr["lz"], (float)dr["ly"], (float)dr["hx"], (float)dr["hz"], (float)dr["hy"], Red, Green, Blue);
            }
            //  Nudge the rotation.
            //rotation += 3.0f;
        }
Пример #12
0
 public string ToHex()
 {
     return("#" + Red.ToString("X2") + Green.ToString("X2") + Blue.ToString("X2"));
 }
 public override string ToString()
 {
     return(string.Concat(Red.ToString("X"), Green.ToString("X"), Blue.ToString("X")));
 }
Пример #14
0
 public override string CombineValue() => $"#{Red.ToString("x").PadLeft(2, '0')}{Green.ToString("x").PadLeft(2, '0')}{Blue.ToString("x").PadLeft(2, '0')}";
Пример #15
0
 public override void Save(XmlTextWriter writer)
 {
     writer.WriteStartElement("Fill");
     if (!string.IsNullOrEmpty(Name))
     {
         writer.WriteAttributeString("name", Name);
     }
     writer.WriteAttributeString("color", Red.ToString() + "," + Green.ToString() + "," + Blue.ToString());
     writer.WriteAttributeString("x", X.ToString());
     writer.WriteAttributeString("y", Y.ToString());
     writer.WriteAttributeString("width", Width.ToString());
     writer.WriteAttributeString("height", Height.ToString());
     writer.WriteAttributeString("layer", Layer.ToString());
     writer.WriteEndElement();
 }
Пример #16
0
 public override string ToString()
 {
     return(Red1.ToString() + " " + Red2.ToString() + " " + Red3.ToString() + " "
            + Red4.ToString() + " " + Red5.ToString() + " " + Red6.ToString() + " " + Blue.ToString());
 }
Пример #17
0
 public String getBrushString()
 {
     return("fill:#" + Red.ToString("X") + Green.ToString("X") + Blue.ToString("X") + ";fill-opacity:" + Alpha / 255.0);
 }
Пример #18
0
 public override string ToString()
 {
     return($"#{Red.ToString("X2")}{Green.ToString("X2")}{Blue.ToString("X2")}");
 }
        //动画演示,初始化
        private void myGLCon_OpenGLDraw(object sender, OpenGLEventArgs args)
        {
            myTextBlock.Text = "hello";
            gl = myGLCon.OpenGL;
            //  Clear the color and depth buffer.
            //gl.ClearColor(1, 1, 1, 0);
            gl.Clear(OpenGL.GL_COLOR_BUFFER_BIT | OpenGL.GL_DEPTH_BUFFER_BIT);

            //  Load the identity matrix.
            //gl.LoadIdentity();

            //  Rotate around the Y axis.
            gl.Rotate(rotation, 0.0f, 1.0f, 0.0f);
            //画车厢线框图
            myGLCon_drawWireFram(0.0f, 0.0f, 0.0f, 5.0f, 2.0f, 2.0f);
            ////动态展示箱子
            //全部置为false
            for (int index = 0; index != ds.Tables[0].Rows.Count; ++index)
            {
                tag_arr[index] = false;
            }
            //取得箱子总数
            int             box_number = ds.Tables[0].Rows.Count;
            DispatcherTimer timer      = new DispatcherTimer(); //定时器

            timer.Interval = TimeSpan.FromMilliseconds(10);     //定时10毫秒
            //timer.Interval = TimeSpan.FromSeconds(5);//定时10毫秒
            timer.Tick     += new EventHandler(make_change);
            timer.IsEnabled = true;
            timer.Start();
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                float  Blue, Red, Green;
                string temp;

                temp = dr["distance"].ToString();
                if (!ColorHashTable.ContainsKey(dr["distance"].ToString()))
                {
                    Random ra = new Random();
                    Blue  = (float)ra.NextDouble();
                    Red   = (float)ra.NextDouble();
                    Green = (float)ra.NextDouble();
                    ColorHashTable.Add(dr["distance"].ToString(), Blue.ToString() + " " + Red.ToString() + " " + Green.ToString());
                }
                else
                {
                    string   AllColor   = ColorHashTable[dr["distance"].ToString()].ToString();
                    string[] ColorArray = AllColor.Split(' ');
                    Blue  = (float)Convert.ToDecimal(ColorArray[0]);
                    Red   = (float)Convert.ToDecimal(ColorArray[1]);
                    Green = (float)Convert.ToDecimal(ColorArray[2]);
                }
                //    //画箱子线框图
                //    //drawWireFram((float)dr["lx"], (float)dr["ly"], (float)dr["lz"], (float)dr["hx"], (float)dr["hy"], (float)dr["hz"]);
                //    //drawCube((float)dr["lx"], (float)dr["ly"], (float)dr["lz"], (float)dr["hx"], (float)dr["hy"], (float)dr["hz"], Red, Green, Blue);
                //    //画图部分被注释
                //    //myGLCon_drawWireFram((float)dr["lx"], (float)dr["lz"], (float)dr["ly"], (float)dr["hx"], (float)dr["hz"], (float)dr["hy"]);
                //    //myGLCon_drawCube((float)dr["lx"], (float)dr["lz"], (float)dr["ly"], (float)dr["hx"], (float)dr["hz"], (float)dr["hy"], Red, Green, Blue);

                //    second_count++;
            }
        }
Пример #20
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     txtRed.Text   = Red.ToString();
     txtGreen.Text = Green.ToString();
     txtBlue.Text  = Blue.ToString();
 }