예제 #1
0
 public static LinearBrush GetLinearR()
 {
     if (Lbrush_R == null)
     {
         Lbrush_R = DX_Core.CreateLinearBrush(ldR);
     }
     return(Lbrush_R);
 }
예제 #2
0
 public static LinearBrush GetLinearB()
 {
     if (Lbrush_B == null)
     {
         Lbrush_B = DX_Core.CreateLinearBrush(ld2);
     }
     return(Lbrush_B);
 }
예제 #3
0
 public static LinearBrush GetLinearG()
 {
     if (Lbrush_G == null)
     {
         Lbrush_G = DX_Core.CreateLinearBrush(ldG);
     }
     return(Lbrush_G);
 }
예제 #4
0
 public static LinearBrush GetLinearA()
 {
     if (Lbrush_A == null)
     {
         Lbrush_A = DX_Core.CreateLinearBrush(ld1);
     }
     return(Lbrush_A);
 }
예제 #5
0
        public void InitCollection()
        {
            List <Color> colors = new List <Color>()
            {
                Color.FromArgb(255, 255, 0, 0),
                Color.FromArgb(255, 0, 255, 0),
                Color.FromArgb(255, 0, 0, 255),
                Color.FromArgb(255, 0, 0, 0),
                Color.FromArgb(255, 0, 255, 255),
                Color.FromArgb(255, 255, 255, 0),
                Color.FromArgb(255, 255, 0, 255),
                Color.FromArgb(255, 255, 255, 255)
            };


            foreach (var item1 in colors)
            {
                foreach (var item2 in colors)
                {
                    LinearBitmap linearWriteableBitmap = new LinearBitmap(128 * 2);

                    {
                        LinearBrush linearBrush = new LinearBrush();

                        linearBrush.GradientStops.Add(new GradientStop(item1, 0.0));

                        linearBrush.GradientStops.Add(new GradientStop(item2, 1.0));

                        linearBrush.Start = 0;

                        linearBrush.End = 128 * 2;

                        linearWriteableBitmap.LinearBrushs.Add(linearBrush);
                    }

                    linearWriteableBitmap.Draw();

                    this.LinearWriteableBitmaps.Add(linearWriteableBitmap);
                }
            }
        }