示例#1
0
 public Color(System.Windows.Media.Brush brush)
 {
     A = ((System.Windows.Media.Color)brush.GetValue(SolidColorBrush.ColorProperty)).A;
     R = ((System.Windows.Media.Color)brush.GetValue(SolidColorBrush.ColorProperty)).R;
     G = ((System.Windows.Media.Color)brush.GetValue(SolidColorBrush.ColorProperty)).G;
     B = ((System.Windows.Media.Color)brush.GetValue(SolidColorBrush.ColorProperty)).B;
 }
示例#2
0
        public static int ColorToInt(System.Windows.Media.Brush brush)
        {
            Color color = ((SolidColorBrush)brush).Color;

            //byte a = ((Color)br.GetValue(System.Windows.Media.SolidColorBrush.ColorProperty)).A;
            byte g = ((Color)brush.GetValue(SolidColorBrush.ColorProperty)).G;
            byte r = ((Color)brush.GetValue(SolidColorBrush.ColorProperty)).R;
            byte b = ((Color)brush.GetValue(SolidColorBrush.ColorProperty)).B;

            return(r | (g << 8) | (b << 16));
        }
示例#3
0
        public static byte[] Barvy(System.Windows.Media.Brush stetec)
        {
            byte A = ((System.Windows.Media.Color)stetec
                      .GetValue(SolidColorBrush.ColorProperty)).A;
            byte R = ((System.Windows.Media.Color)stetec
                      .GetValue(SolidColorBrush.ColorProperty)).R;
            byte G = ((System.Windows.Media.Color)stetec
                      .GetValue(SolidColorBrush.ColorProperty)).G;
            byte B = ((System.Windows.Media.Color)stetec
                      .GetValue(SolidColorBrush.ColorProperty)).B;

            byte[] vysledek = { A, R, G, B };

            return(vysledek);
        }
示例#4
0
 public void setNodePreColor(Brush _color)
 {
     byte r = ((Color)_color.GetValue(SolidColorBrush.ColorProperty)).R;
     byte b = ((Color)_color.GetValue(SolidColorBrush.ColorProperty)).B;
     byte g = ((Color)_color.GetValue(SolidColorBrush.ColorProperty)).G;
     Node.preColor.R = r;
     Node.preColor.B = b;
     Node.preColor.G = g;
 }
示例#5
0
 public byte GetAlpha()
 {
     return(((Color)mediaBrush.GetValue(SolidColorBrush.ColorProperty)).A);
 }