コード例 #1
0
        public PianoKeyWPF(PianoControlWPF.KeyType keyType)
        {
            this.keyType = keyType;
            whiteKeyOnBrush = new LinearGradientBrush();
            whiteKeyOnBrush.GradientStops.Add(new GradientStop(Colors.White, 0.0));
            whiteKeyOnBrush.GradientStops.Add(new GradientStop(Color.FromArgb(0xFF, 0x20, 0x20, 0x20), 1.0));

            blackKeyOnBrush = new LinearGradientBrush();
            blackKeyOnBrush.GradientStops.Add(new GradientStop(Colors.LightGray, 0.0));
            blackKeyOnBrush.GradientStops.Add(new GradientStop(Colors.Black, 1.0));

            InitializeComponent();
        }
コード例 #2
0
        public PianoKeyWPF(PianoControlWPF.KeyType keyType)
        {
            this.keyType    = keyType;
            whiteKeyOnBrush = new LinearGradientBrush();
            whiteKeyOnBrush.GradientStops.Add(new GradientStop(Colors.White, 0.0));
            whiteKeyOnBrush.GradientStops.Add(new GradientStop(Color.FromArgb(0xFF, 0x20, 0x20, 0x20), 1.0));

            blackKeyOnBrush = new LinearGradientBrush();
            blackKeyOnBrush.GradientStops.Add(new GradientStop(Colors.LightGray, 0.0));
            blackKeyOnBrush.GradientStops.Add(new GradientStop(Colors.Black, 1.0));

            InitializeComponent();
        }