示例#1
0
        public StudyListBox()
        {
            InitializeComponent();

            ColorList.Add(new Color()
            {
                Code = "#FF8C00"
            });
            ColorList.Add(new Color()
            {
                Code = "#FF7F50"
            });
            ColorList.Add(new Color()
            {
                Code = "#FF6EB4"
            });
            ColorList.Add(new Color()
            {
                Code = "#FF4500"
            });
            ColorList.Add(new Color()
            {
                Code = "#FF3030"
            });
            ColorList.Add(new Color()
            {
                Code = "#CD5B45"
            });

            cob.ItemsSource = ColorList;
            lib.ItemsSource = ColorList;


            ic.ItemsSource = ColorList;
        }
示例#2
0
        /// <summary>
        /// Gets a cabinet color list for the config colors contained in this list.
        /// </summary>
        /// <returns>Cabinet ColorList.</returns>
        public ColorList GetCabinetColorList()
        {
            ColorList CL = new ColorList();

            foreach (ColorConfig CC in this)
            {
                CL.Add(CC.GetCabinetColor());
            }
            return(CL);
        }
示例#3
0
 private void NewFile(object obj)
 {
     ColorList.Clear();
     for (int i = 0; i < 50; i++)
     {
         for (int j = 0; j < 50; j++)
         {
             LiteBrite f = new LiteBrite("WHITE", i, j);
             ColorList.Add(f);
         }
     }
 }
 /// <summary>
 /// Adds all of the bitmaps colors to the ColorList.
 /// </summary>
 private void GetSourceBitmapColors()
 {
     //Iterates through each pixel adding it to the colorList
     for (int x = 0; x < currentBitmap.Width; x++)
     {
         for (int y = 0; y < currentBitmap.Height; y++)
         {
             Color pixelColor = currentBitmap.GetPixel(x, y);
             Int32 key        = pixelColor.R << 16 | pixelColor.G << 8 | pixelColor.B;
             ColorList.Add(key);
         }
     }
 }
        protected override void BuildData()
        {
            VertexList.AddRange(new Vector3[] { new Vector3(-0.4755286f, -1f, -0.1545086f), new Vector3(-0.4045088f, -1f, -0.2938928f), new Vector3(-0.2938928f, -1f, -0.4045087f), new Vector3(-0.1545086f, -1f, -0.4755285f), new Vector3(0f, -1f, -0.5000002f), new Vector3(0.1545086f, -1f, -0.4755285f), new Vector3(0.2938927f, -1f, -0.4045087f), new Vector3(0.4045086f, -1f, -0.2938927f), new Vector3(0.4755284f, -1f, -0.1545085f), new Vector3(0.5000001f, -1f, 0f), new Vector3(0.4755284f, -1f, 0.1545085f), new Vector3(0.4045086f, -1f, 0.2938927f), new Vector3(0.2938927f, -1f, 0.4045086f), new Vector3(0.1545085f, -1f, 0.4755283f), new Vector3(1.490116E-08f, -1f, 0.5000001f), new Vector3(-0.1545085f, -1f, 0.4755283f), new Vector3(-0.2938926f, -1f, 0.4045085f), new Vector3(-0.4045085f, -1f, 0.2938927f), new Vector3(-0.4755283f, -1f, 0.1545085f), new Vector3(-0.5f, -1f, 0f), new Vector3(-0.4755286f, 1f, -0.1545086f), new Vector3(-0.4045088f, 1f, -0.2938928f), new Vector3(-0.2938928f, 1f, -0.4045087f), new Vector3(-0.1545086f, 1f, -0.4755285f), new Vector3(0f, 1f, -0.5000002f), new Vector3(0.1545086f, 1f, -0.4755285f), new Vector3(0.2938927f, 1f, -0.4045087f), new Vector3(0.4045086f, 1f, -0.2938927f), new Vector3(0.4755284f, 1f, -0.1545085f), new Vector3(0.5000001f, 1f, 0f), new Vector3(0.4755284f, 1f, 0.1545085f), new Vector3(0.4045086f, 1f, 0.2938927f), new Vector3(0.2938927f, 1f, 0.4045086f), new Vector3(0.1545085f, 1f, 0.4755283f), new Vector3(1.490116E-08f, 1f, 0.5000001f), new Vector3(-0.1545085f, 1f, 0.4755283f), new Vector3(-0.2938926f, 1f, 0.4045085f), new Vector3(-0.4045085f, 1f, 0.2938927f), new Vector3(-0.4755283f, 1f, 0.1545085f), new Vector3(-0.5f, 1f, 0f), new Vector3(0f, -1f, 0f), new Vector3(0f, 1f, 0f), new Vector3(0.5000001f, -1f, 0f), new Vector3(0.5000001f, 1f, 0f), new Vector3(-0.5f, -1f, 0f), new Vector3(-0.4755286f, 1f, -0.1545086f), new Vector3(-0.4755286f, -1f, -0.1545086f), new Vector3(-0.5f, 1f, 0f), new Vector3(-0.4045088f, -1f, -0.2938928f), new Vector3(-0.4755286f, -1f, -0.1545086f), new Vector3(-0.2938928f, -1f, -0.4045087f), new Vector3(-0.1545086f, -1f, -0.4755285f), new Vector3(0f, -1f, -0.5000002f), new Vector3(0.1545086f, -1f, -0.4755285f), new Vector3(0.2938927f, -1f, -0.4045087f), new Vector3(0.4045086f, -1f, -0.2938927f), new Vector3(0.4755284f, -1f, -0.1545085f), new Vector3(0.5000001f, -1f, 0f), new Vector3(0.4755284f, -1f, 0.1545085f), new Vector3(0.4045086f, -1f, 0.2938927f), new Vector3(0.2938927f, -1f, 0.4045086f), new Vector3(0.1545085f, -1f, 0.4755283f), new Vector3(1.490116E-08f, -1f, 0.5000001f), new Vector3(-0.1545085f, -1f, 0.4755283f), new Vector3(-0.2938926f, -1f, 0.4045085f), new Vector3(-0.4045085f, -1f, 0.2938927f), new Vector3(-0.4755283f, -1f, 0.1545085f), new Vector3(-0.5f, -1f, 0f), new Vector3(-0.4755286f, 1f, -0.1545086f), new Vector3(-0.4045088f, 1f, -0.2938928f), new Vector3(-0.2938928f, 1f, -0.4045087f), new Vector3(-0.1545086f, 1f, -0.4755285f), new Vector3(0f, 1f, -0.5000002f), new Vector3(0.1545086f, 1f, -0.4755285f), new Vector3(0.2938927f, 1f, -0.4045087f), new Vector3(0.4045086f, 1f, -0.2938927f), new Vector3(0.4755284f, 1f, -0.1545085f), new Vector3(0.5000001f, 1f, 0f), new Vector3(0.4755284f, 1f, 0.1545085f), new Vector3(0.4045086f, 1f, 0.2938927f), new Vector3(0.2938927f, 1f, 0.4045086f), new Vector3(0.1545085f, 1f, 0.4755283f), new Vector3(1.490116E-08f, 1f, 0.5000001f), new Vector3(-0.1545085f, 1f, 0.4755283f), new Vector3(-0.2938926f, 1f, 0.4045085f), new Vector3(-0.4045085f, 1f, 0.2938927f), new Vector3(-0.4755283f, 1f, 0.1545085f), new Vector3(-0.5f, 1f, 0f), });
            NormalList.AddRange(new Vector3[] { new Vector3(-0.9334423f, 0f, -0.3587276f), new Vector3(-0.776903f, 0f, -0.6296204f), new Vector3(-0.5443152f, 0f, -0.8388808f), new Vector3(-0.258446f, 0f, -0.9660257f), new Vector3(0.05272146f, 0f, -0.9986092f), new Vector3(0.3587284f, 0f, -0.933442f), new Vector3(0.6296204f, 0f, -0.7769028f), new Vector3(0.8388808f, 0f, -0.5443152f), new Vector3(0.9660257f, 0f, -0.2584461f), new Vector3(0.9986093f, 0f, 0.05272135f), new Vector3(0.933442f, 0f, 0.3587283f), new Vector3(0.7769029f, 0f, 0.6296204f), new Vector3(0.5443153f, 0f, 0.8388808f), new Vector3(0.2584461f, 0f, 0.9660256f), new Vector3(-0.05272149f, 0f, 0.9986092f), new Vector3(-0.3587283f, 0f, 0.933442f), new Vector3(-0.6296203f, 0f, 0.776903f), new Vector3(-0.8388807f, 0f, 0.5443153f), new Vector3(-0.9660256f, 0f, 0.2584462f), new Vector3(-0.9986093f, 0f, -0.05272005f), new Vector3(-0.9660261f, 0f, -0.2584449f), new Vector3(-0.8388807f, 0f, -0.5443153f), new Vector3(-0.6296201f, 0f, -0.7769031f), new Vector3(-0.3587281f, 0f, -0.9334421f), new Vector3(-0.05272127f, 0f, -0.9986093f), new Vector3(0.2584463f, 0f, -0.9660256f), new Vector3(0.5443155f, 0f, -0.8388806f), new Vector3(0.7769032f, 0f, -0.6296201f), new Vector3(0.9334421f, 0f, -0.3587282f), new Vector3(0.9986093f, 0f, -0.05272135f), new Vector3(0.9660256f, 0f, 0.2584462f), new Vector3(0.8388806f, 0f, 0.5443155f), new Vector3(0.6296202f, 0f, 0.7769031f), new Vector3(0.3587282f, 0f, 0.9334421f), new Vector3(0.05272129f, 0f, 0.9986093f), new Vector3(-0.2584463f, 0f, 0.9660256f), new Vector3(-0.5443153f, 0f, 0.8388807f), new Vector3(-0.776903f, 0f, 0.6296203f), new Vector3(-0.9334421f, 0f, 0.3587282f), new Vector3(-0.9986092f, 0f, 0.05272201f), new Vector3(0f, -1f, 0f), new Vector3(0f, 1f, 0f), new Vector3(0.9986093f, 0f, 0.05272135f), new Vector3(0.9986093f, 0f, -0.05272135f), new Vector3(-0.9986093f, 0f, -0.05272005f), new Vector3(-0.9660261f, 0f, -0.2584449f), new Vector3(-0.9334423f, 0f, -0.3587276f), new Vector3(-0.9986092f, 0f, 0.05272201f), new Vector3(0f, -1f, 0f), new Vector3(0f, -1f, 0f), new Vector3(0f, -1f, 0f), new Vector3(0f, -1f, 0f), new Vector3(0f, -1f, 0f), new Vector3(0f, -1f, 0f), new Vector3(0f, -1f, 0f), new Vector3(0f, -1f, 0f), new Vector3(0f, -1f, 0f), new Vector3(0f, -1f, 0f), new Vector3(0f, -1f, 0f), new Vector3(0f, -1f, 0f), new Vector3(0f, -1f, 0f), new Vector3(0f, -1f, 0f), new Vector3(0f, -1f, 0f), new Vector3(0f, -1f, 0f), new Vector3(0f, -1f, 0f), new Vector3(0f, -1f, 0f), new Vector3(0f, -1f, 0f), new Vector3(0f, -1f, 0f), new Vector3(0f, 1f, 0f), new Vector3(0f, 1f, 0f), new Vector3(0f, 1f, 0f), new Vector3(0f, 1f, 0f), new Vector3(0f, 1f, 0f), new Vector3(0f, 1f, 0f), new Vector3(0f, 1f, 0f), new Vector3(0f, 1f, 0f), new Vector3(0f, 1f, 0f), new Vector3(0f, 1f, 0f), new Vector3(0f, 1f, 0f), new Vector3(0f, 1f, 0f), new Vector3(0f, 1f, 0f), new Vector3(0f, 1f, 0f), new Vector3(0f, 1f, 0f), new Vector3(0f, 1f, 0f), new Vector3(0f, 1f, 0f), new Vector3(0f, 1f, 0f), new Vector3(0f, 1f, 0f), new Vector3(0f, 1f, 0f), });
            for (int v = 0; v < VertexList.Count; v++)
            {
                ColorList.Add(Color.White);
            }

            TexCoordList.AddRange(new Vector2[] { new Vector2(0.1005999f, 0.0004537381f), new Vector2(0.2005054f, 0.0004537381f), new Vector2(0.300411f, 0.0004537381f), new Vector2(0.4003165f, 0.0004537381f), new Vector2(0.500222f, 0.0004537381f), new Vector2(0.6001273f, 0.0004537381f), new Vector2(0.7000327f, 0.0004537381f), new Vector2(0.799938f, 0.0004537381f), new Vector2(0.8998432f, 0.0004537381f), new Vector2(0.999749f, 0.0004537381f), new Vector2(0.1005993f, 0.0004537381f), new Vector2(0.200505f, 0.0004537381f), new Vector2(0.3004106f, 0.0004537381f), new Vector2(0.400316f, 0.0004537381f), new Vector2(0.5002215f, 0.0004537381f), new Vector2(0.6001268f, 0.0004537381f), new Vector2(0.7000322f, 0.0004537381f), new Vector2(0.7999375f, 0.0004537381f), new Vector2(0.8998428f, 0.0004537381f), new Vector2(0.9997481f, 0.0004537381f), new Vector2(0.1005996f, 0.9994308f), new Vector2(0.2005053f, 0.9994308f), new Vector2(0.300411f, 0.9994308f), new Vector2(0.4003165f, 0.9994308f), new Vector2(0.500222f, 0.9994308f), new Vector2(0.6001273f, 0.9994308f), new Vector2(0.7000328f, 0.9994308f), new Vector2(0.7999381f, 0.9994308f), new Vector2(0.8998435f, 0.9994308f), new Vector2(0.9997491f, 0.9994308f), new Vector2(0.1005996f, 0.9994308f), new Vector2(0.2005051f, 0.9994308f), new Vector2(0.3004106f, 0.9994308f), new Vector2(0.400316f, 0.9994308f), new Vector2(0.5002215f, 0.9994308f), new Vector2(0.6001268f, 0.9994308f), new Vector2(0.7000321f, 0.9994308f), new Vector2(0.7999371f, 0.9994308f), new Vector2(0.8998424f, 0.9994308f), new Vector2(0.9997478f, 0.9994308f), new Vector2(0.5002239f, 0.4999443f), new Vector2(0.5002245f, 0.4999442f), new Vector2(0.0006936856f, 0.0004537381f), new Vector2(0.0006940446f, 0.9994308f), new Vector2(0.00069427f, 0.0004537381f), new Vector2(0.1005996f, 0.9994308f), new Vector2(0.1005999f, 0.0004537381f), new Vector2(0.0006939089f, 0.9994308f), new Vector2(0.0988569f, 0.7915539f), new Vector2(0.02838877f, 0.6532523f), new Vector2(0.2086136f, 0.9013107f), new Vector2(0.3469154f, 0.971779f), new Vector2(0.500224f, 0.9960608f), new Vector2(0.6535327f, 0.971779f), new Vector2(0.7918344f, 0.9013106f), new Vector2(0.901591f, 0.7915536f), new Vector2(0.9720588f, 0.6532521f), new Vector2(0.9963405f, 0.4999437f), new Vector2(0.9720586f, 0.3466355f), new Vector2(0.9015904f, 0.2083341f), new Vector2(0.7918337f, 0.09857755f), new Vector2(0.653532f, 0.02810944f), new Vector2(0.5002234f, 0.003827875f), new Vector2(0.346915f, 0.02810972f), new Vector2(0.2086136f, 0.09857795f), new Vector2(0.09885708f, 0.2083347f), new Vector2(0.02838913f, 0.3466361f), new Vector2(0.004107505f, 0.4999442f), new Vector2(0.9720596f, 0.6532523f), new Vector2(0.9015915f, 0.7915539f), new Vector2(0.7918347f, 0.9013107f), new Vector2(0.653533f, 0.971779f), new Vector2(0.5002243f, 0.9960608f), new Vector2(0.3469157f, 0.971779f), new Vector2(0.2086142f, 0.9013106f), new Vector2(0.0988576f, 0.7915537f), new Vector2(0.0283896f, 0.6532522f), new Vector2(0.004108027f, 0.4999439f), new Vector2(0.02838971f, 0.3466356f), new Vector2(0.09885782f, 0.2083341f), new Vector2(0.2086144f, 0.09857755f), new Vector2(0.3469159f, 0.02810938f), new Vector2(0.5002242f, 0.003827723f), new Vector2(0.6535327f, 0.02810941f), new Vector2(0.7918344f, 0.09857755f), new Vector2(0.901591f, 0.2083343f), new Vector2(0.9720591f, 0.3466357f), new Vector2(0.9963408f, 0.4999439f), });

            IndexList.AddRange(new int[] { 0, 21, 1, 0, 20, 21, 1, 21, 22, 1, 22, 2, 2, 22, 23, 2, 23, 3, 3, 23, 24, 3, 24, 4, 4, 24, 25, 4, 25, 5, 5, 25, 26, 5, 26, 6, 6, 26, 27, 6, 27, 7, 7, 27, 28, 7, 28, 8, 8, 28, 29, 8, 29, 9, 42, 30, 10, 42, 43, 30, 10, 30, 31, 10, 31, 11, 11, 31, 32, 11, 32, 12, 12, 32, 33, 12, 33, 13, 13, 33, 34, 13, 34, 14, 14, 34, 35, 14, 35, 15, 15, 35, 36, 15, 36, 16, 16, 36, 37, 16, 37, 17, 17, 37, 38, 17, 38, 18, 18, 38, 39, 18, 39, 19, 44, 45, 46, 44, 47, 45, 48, 40, 49, 50, 40, 48, 51, 40, 50, 52, 40, 51, 53, 40, 52, 54, 40, 53, 55, 40, 54, 56, 40, 55, 57, 40, 56, 58, 40, 57, 59, 40, 58, 60, 40, 59, 61, 40, 60, 62, 40, 61, 63, 40, 62, 64, 40, 63, 65, 40, 64, 66, 40, 65, 67, 40, 66, 49, 40, 67, 68, 41, 69, 69, 41, 70, 70, 41, 71, 71, 41, 72, 72, 41, 73, 73, 41, 74, 74, 41, 75, 75, 41, 76, 76, 41, 77, 77, 41, 78, 78, 41, 79, 79, 41, 80, 80, 41, 81, 81, 41, 82, 82, 41, 83, 83, 41, 84, 84, 41, 85, 85, 41, 86, 86, 41, 87, 87, 41, 68, });
            IndexList.Reverse();

            CalculateTangents();
        }
示例#6
0
        public PureThemeTemplate()
            : base()
        {
            Name          = "arctic";
            IsSystemTheme = true;
            BannerImage   = "/Assets/Themes/Pure.png";

            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0x6d, 0xd0, 0xf7)));
            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0xaa, 0xe0, 0xf5)));
            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0xdb, 0xec, 0xf2)));

            foreach (var color in DefaultColorList)
            {
                ColorList.Add(color.Clone());
            }
        }
示例#7
0
        public DeepBlueThemeTemplate() : base()
        {
            Name          = "deep blue";
            IsSystemTheme = true;
            BannerImage   = "/Assets/Themes/Blue.png";

            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0x0d, 0x7e, 0xff)));
            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0x0b, 0x74, 0xe9)));
            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0x0a, 0x65, 0xcc)));
            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0x09, 0x58, 0xb3)));

            foreach (var color in DefaultColorList)
            {
                ColorList.Add(color.Clone());
            }
        }
        public StarryThemeTemplate() : base()
        {
            Name          = "starry nights";
            IsSystemTheme = true;
            BannerImage   = "/Assets/Themes/Starry.png";

            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0x00, 0xbf, 0xf3)));
            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0x00, 0xa9, 0x9d)));
            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0xf8, 0x94, 0x1d)));
            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0xf2, 0x6d, 0x7d)));
            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0x85, 0x60, 0xa9)));

            foreach (var color in DefaultColorList)
            {
                ColorList.Add(color.Clone());
            }
        }
        public DreamingThemeTemplate()
            : base()
        {
            Name          = "dreaming";
            IsSystemTheme = true;
            BannerImage   = "/Assets/Themes/Dream.png";

            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0x82, 0xca, 0x9c)));
            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0x1c, 0xbb, 0xb4)));
            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0x00, 0xbf, 0xf3)));
            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0x44, 0x8c, 0xcb)));

            foreach (var color in DefaultColorList)
            {
                ColorList.Add(color.Clone());
            }
        }
        public EhchantedThemeTemplate()
            : base()
        {
            Name          = "enchanted";
            IsSystemTheme = true;
            BannerImage   = "/Assets/Themes/Enchanted.png";

            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0xf7, 0x97, 0x79)));
            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0xf2, 0x65, 0x22)));
            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0xf4, 0x9a, 0xc2)));
            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0xf2, 0x6d, 0x7d)));
            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0xee, 0x14, 0x5b)));

            foreach (var color in DefaultColorList)
            {
                ColorList.Add(color.Clone());
            }
        }
示例#11
0
        public SerenityThemeTemplate() : base()
        {
            Name          = "serenity";
            IsSystemTheme = true;
            BannerImage   = "/Assets/Themes/Serenity.png";

            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0x92, 0x27, 0x8f)));
            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0xed, 0x00, 0x8c)));
            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0x00, 0x72, 0xbc)));
            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0x2d, 0xa0, 0xea)));
            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0x00, 0xa9, 0x9d)));
            DefaultColorList.Add(HSBColor.FromColor(Color.FromArgb(0xff, 0x39, 0xb5, 0x4a)));

            foreach (var color in DefaultColorList)
            {
                ColorList.Add(color.Clone());
            }
        }
示例#12
0
        public MainWindow()
        {
            InitializeComponent();
            this.DataContext = this;

            this.Loaded += (m, n) =>
            {
                ColorList.Add(new ColorClass {
                    IsChecked = false, Name = "#313131"
                });
            };


            btnPopup.PreviewMouseLeftButtonDown += (m, n) =>
            {
                Msg.ShowInfor("bbbbBBBBBB-------------------------------------------------------BBBBBBBBBBBBBBBBBBBBBBBBBBBBfdsafgadfgdfgffffffffffffffffffffffffffffffffffffff");
            };
            dg.SelectionChanged += Dg_SelectionChanged;
        }
示例#13
0
        public void FillImages(List <CompositeJpxImages> compositeImage)
        {
            for (int index = 0; index < compositeImage.Count; index++)
            {
                ColorList.Add(compositeImage[index].ColorImage);

                if (compositeImage[index].OpacityImage != null)
                {
                    OpacityList.Add(compositeImage[index].OpacityImage);
                }
                else
                {
                    OpacityList.Add(((MainForm)MdiParent).NoOpacityBitmap);
                }

                if (compositeImage[index].PreOpacityImage != null)
                {
                    PreOpacityList.Add(compositeImage[index].PreOpacityImage);
                }
                else
                {
                    PreOpacityList.Add(((MainForm)MdiParent).NoPreOpacityBitmap);
                }

                if (compositeImage[index].OpacityImage != null)
                {
                    RasterImage combineImage = new RasterImage(compositeImage[index].ColorImage);

                    CombineCommand command = new CombineCommand(compositeImage[index].OpacityImage,
                                                                new LeadRect(0, 0, compositeImage[index].OpacityImage.Width, compositeImage[index].OpacityImage.Height),
                                                                new LeadPoint(0, 0),
                                                                CombineCommandFlags.OperationMultiply);
                    command.Run(combineImage);

                    ImagesList.Add(combineImage);
                }
                else
                {
                    ImagesList.Add(compositeImage[index].ColorImage);
                }
            }
        }
示例#14
0
        private void OpenFile(object obj)
        {
            OpenFileDialog openDialog   = new OpenFileDialog();
            string         CombinedPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "..\\..\\..\\");

            openDialog.InitialDirectory = System.IO.Path.GetFullPath(CombinedPath);


            if (openDialog.ShowDialog() == true)
            {
                fileName = openDialog.FileName;
            }

            string excelFile = fileName;

            try
            {
                using (var reader = new StreamReader(excelFile))
                {
                    List <string> listA = new List <string>();
                    List <string> listB = new List <string>();
                    while (!reader.EndOfStream)
                    {
                        var line   = reader.ReadLine();
                        var values = line.Split(',');

                        LiteBrite lb = new LiteBrite();
                        lb.Lcolor = values[0];
                        lb.xPos   = Convert.ToInt32(values[1]);
                        lb.yPos   = Convert.ToInt32(values[2]);
                        ColorList.Add(lb);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error occured: " + ex.Message);
            }
        }
        protected override void BuildData()
        {
            int SquareSize = 10;

            int[]   index  = new int[(SquareSize - 1) * (SquareSize - 1) * 6];
            Vector2 uv     = Vector2.Zero;
            Vector3 center = new Vector3(SquareSize, 0, SquareSize) * .5f;

            for (int x = 0; x < SquareSize; x++)
            {
                for (int y = 0; y < SquareSize; y++)
                {
                    uv = new Vector2(x, y) / (float)(SquareSize - 1);
                    VertexList.Add(new Vector3(x, 0, y) - center);
                    NormalList.Add(Vector3.Up);
                    TexCoordList.Add(uv);
                    ColorList.Add(Color.White);
                }
            }

            for (int x = 0; x < SquareSize - 1; x++)
            {
                for (int y = 0; y < SquareSize - 1; y++)
                {
                    index[(x + y * (SquareSize - 1)) * 6]     = ((x + 1) + (y + 1) * SquareSize);
                    index[(x + y * (SquareSize - 1)) * 6 + 1] = ((x + 1) + y * SquareSize);
                    index[(x + y * (SquareSize - 1)) * 6 + 2] = (x + y * SquareSize);

                    index[(x + y * (SquareSize - 1)) * 6 + 3] = ((x + 1) + (y + 1) * SquareSize);
                    index[(x + y * (SquareSize - 1)) * 6 + 4] = (x + y * SquareSize);
                    index[(x + y * (SquareSize - 1)) * 6 + 5] = (x + (y + 1) * SquareSize);
                }
            }

            IndexList.AddRange(index);

            CalculateTangents();
        }
示例#16
0
        private void RandomFile(object obj)
        {
            ColorList.Clear();
            List <string> ranColorList = new List <string>
            {
                "Azure", "Gold", "Magenta", "Tan", "Violet", "Plum", "Maroon", "Red", "Orange", "Pink",
                "Yellow", "Blue", "Purple", "Green", "Brown", "Black", "Navy", "SkyBlue"
            };
            Random rnd = new Random();

            for (int i = 0; i < 50; i++)
            {
                for (int j = 0; j < 50; j++)
                {
                    int randIndex = rnd.Next(ranColorList.Count());


                    string    s = ranColorList.ElementAt(randIndex).ToString();
                    LiteBrite f = new LiteBrite(s, j, i);
                    ColorList.Add(f);
                }
            }
        }
示例#17
0
 public void AddList(LiteBrite lb)
 {
     ColorList.Add(lb);
 }
 private void AddColor(object parameter)
 {
     ColorList.Add(new CustomColor(parameter as CustomColor));
 }
示例#19
0
        /// <summary>
        /// Simple Gaussian Blur
        /// </summary>
        /// <param name="image">The image to blur</param>
        /// <param name="blurSize">The radius in pixels of the blur</param>
        /// <returns>Bitmap with the result of the blur</returns>
        public static Bitmap Gaussian(Bitmap image, int blurSize)
        {
            int blur = blurSize / 2;
            int width = image.Width;
            int height = image.Height;
            Rectangle bounds = new Rectangle(0, 0, width, height);

            Bitmap copy = new Bitmap(width, height, PixelFormat.Format32bppArgb);
            Bitmap output = new Bitmap(width, height, PixelFormat.Format32bppArgb);

            using(Graphics g = Graphics.FromImage(copy))
            {
                g.PageUnit = GraphicsUnit.Pixel;
                g.DrawImageUnscaled(image, 0, 0);
            }

            BitmapData outData = null;
            BitmapData srcData = null;
            try
            {
                outData = output.LockBits(bounds, ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
                srcData = copy.LockBits(bounds, ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);

                byte* outRow = (byte*)outData.Scan0.ToPointer();
                Int32* outPxl;

                for(int row = 0; row < height; ++row)
                {
                    outPxl = (Int32*)outRow;
                    for(int col = 0; col < width; ++col, ++outPxl)
                    {
                        ColorList list = new ColorList();
                        int x1 = col - blur < 0 ? 0 : col - blur;
                        int x2 = col + blur > width ? width : col + blur;
                        int y1 = row - blur < 0 ? 0 : row - blur;
                        int y2 = row + blur > height ? height : row + blur;

                        byte* srcRow = (byte*)srcData.Scan0.ToPointer();
                        Int32* srcPxl;

                        srcRow += (srcData.Stride * y1);
                        for(int y = y1; y < y2; ++y)
                        {
                            srcPxl = (Int32*)srcRow;
                            srcPxl += x1;
                            for(int x = x1; x < x2; ++x, ++srcPxl)
                            {
                                list.Add(new XColor((Color32*)srcPxl));
                            }

                            srcRow += srcData.Stride;
                        }

                        ((Color32*)outPxl)->ARGB = list.average().col32.ARGB;
                    }

                    outRow += outData.Stride;
                }
            }
            finally
            {
                output.UnlockBits(outData);
                copy.UnlockBits(srcData);
            }

            copy.Dispose();
            return output;
        }
示例#20
0
        public VModel()
        {
            vm          = this;
            vm.DrawRect = new Rect()
            {
                Width = 800, Height = 800
            };
            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

            act();

            if (Data["ColorList"] is string[] cs)
            {
                foreach (var item in cs)
                {
                    ColorList.Add(new SolidColorBrush(Color.FromData(item)));
                }
            }
            if (ColorList.Count < 1)
            {
                foreach (var i in App1.Vendor.ColorList.List())
                {
                    ColorList.Add(new SolidColorBrush {
                        Color = Color.FromData(i)
                    });
                }
            }
            if ((Data["MainColor"] is string a) && (Data["BackColor"] is string b))
            {
                MainBrush.Color = Color.FromData(a);
                BackBrush.Color = Color.FromData(b);
            }

            if (Data["ToolsList"] is string[] ts)
            {
                foreach (var s in ts)
                {
                    var t = ToolsModel.Create(s);
                    if (t != null)
                    {
                        ToolsList.Add(t);
                    }
                }
            }
            if (ToolsList.Count < 2)
            {
                ToolsList.Add(new Model.Tools.Pen9Model()
                {
                    Name = "pen1",
                });
                ToolsList.Add(new Model.Tools.EraserModel()
                {
                    Name = "eras",
                });
            }
            if (ToolsList.Count > 0)
            {
                CurrentTools = ToolsList[1];
                CurrentTools = ToolsList[0];
            }
            if (Data["Error"] is string ee)
            {
                Data.Remove("Error");
                var em = new EmailMessage();
                em.Subject = "Prpaint Crash Report";
                em.Body    = ee;
                em.To.Add(new EmailRecipient("*****@*****.**"));
                EmailManager.ShowComposeNewEmailAsync(em).ToString();
            }

            Window.Current.VisibilityChanged += (s, e) => {
                if (e.Visible)
                {
                    return;
                }
                Window.Current.Activate();
                backup();
                var c = ColorList.Select(x => {
                    return(Color.ToData(x.Color));
                });
                if (c.Count() > 1)
                {
                    Data["ColorList"] = c.ToArray();
                }
                var t = ToolsList.Select(x => {
                    return(x.ToData());
                });
                if (t.Count() > 1)
                {
                    Data["ToolsList"] = t.ToArray();
                }

                Data["MainColor"] = Color.ToData(MainBrush.Color);
                Data["BackColor"] = Color.ToData(BackBrush.Color);
            };

            App.Current.UnhandledException += (sender, e) => {
                Data["Error"] = e.Exception.ToString();
                vm.backup();
            };
        }
示例#21
0
 public void AddColor(ControlColor color)
 {
     ColorList.Add(color);
     color.SetName = Name;
 }
示例#22
0
 public void GetNewColor()
 {
     ColorList.Add(Random.ColorHSV(0, 1, 0.2f, 0.3f, 0.7f, 1.0f, 0.8f, 1.0f));
 }