本文整理汇总了C#中System.Windows.Media.SolidColorBrush类的典型用法代码示例。如果您正苦于以下问题:C# SolidColorBrush类的具体用法?C# SolidColorBrush怎么用?C# SolidColorBrush使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SolidColorBrush类属于System.Windows.Media命名空间,在下文中一共展示了SolidColorBrush类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: PkgCreateWin
public PkgCreateWin()
{
InitializeComponent();
EnabledColor = SnapshotBtn.Foreground;
DisabledColor = new SolidColorBrush(System.Windows.Media.Colors.LightGray);
SetUiMode(UiMode.WaitingForFile);
}
开发者ID:vaginessa,项目名称:cameyo,代码行数:7,代码来源:PkgCreateWin.xaml.cs
示例2: Create
public Model3DGroup Create(Color modelColor,string pictureName, Point3D startPos, double maxHigh)
{
try
{
Uri inpuri = new Uri(@pictureName, UriKind.Relative);
BitmapImage bi = new BitmapImage();
bi.BeginInit();
bi.UriSource = inpuri;
bi.EndInit();
ImageBrush imagebrush = new ImageBrush(bi);
imagebrush.Opacity = 100;
imagebrush.Freeze();
Point[] ptexture0 = { new Point(0, 0), new Point(0, 1), new Point(1, 0) };
Point[] ptexture1 = { new Point(1, 0), new Point(0, 1), new Point(1, 1) };
SolidColorBrush modelbrush = new SolidColorBrush(modelColor);
Model3DGroup cube = new Model3DGroup();
Point3D uppercircle = startPos;
modelbrush.Freeze();
uppercircle.Y = startPos.Y + maxHigh;
cube.Children.Add(CreateEllipse2D(modelbrush, uppercircle, _EllipseHigh, new Vector3D(0, 1, 0)));
cube.Children.Add(CreateEllipse2D(modelbrush, startPos, _EllipseHigh, new Vector3D(0, -1, 0)));
cube.Children.Add(CreateEllipse3D(imagebrush, startPos, _EllipseHigh, maxHigh, ptexture0));
return cube;
}
catch (Exception ex)
{
throw ex;
}
}
开发者ID:kse-jp,项目名称:RM-3000,代码行数:31,代码来源:EllipseModel.cs
示例3: WatchViewFullscreen
public WatchViewFullscreen()
{
InitializeComponent();
MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(view_MouseButtonIgnore);
MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(view_MouseButtonIgnore);
MouseRightButtonUp += new System.Windows.Input.MouseButtonEventHandler(view_MouseRightButtonUp);
PreviewMouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(view_PreviewMouseRightButtonDown);
MenuItem mi = new MenuItem();
mi.Header = "Zoom to Fit";
mi.Click += new RoutedEventHandler(mi_Click);
MainContextMenu.Items.Add(mi);
System.Windows.Shapes.Rectangle backgroundRect = new System.Windows.Shapes.Rectangle();
Canvas.SetZIndex(backgroundRect, -10);
backgroundRect.IsHitTestVisible = false;
BrushConverter bc = new BrushConverter();
Brush strokeBrush = (Brush)bc.ConvertFrom("#313131");
backgroundRect.Stroke = strokeBrush;
backgroundRect.StrokeThickness = 1;
SolidColorBrush backgroundBrush = new SolidColorBrush(System.Windows.Media.Color.FromRgb(250, 250, 216));
backgroundRect.Fill = backgroundBrush;
inputGrid.Children.Add(backgroundRect);
}
开发者ID:romeo08437,项目名称:Dynamo,代码行数:27,代码来源:WatchViewFullscreen.xaml.cs
示例4: WorkshopViewModelBase
protected WorkshopViewModelBase()
{
if (IsInDesignModeStatic)
{
Head = "X:123, Y:456, Z:7890";
Neck = "X:123, Y:456, Z:7890";
LeftShoulder = "X:123, Y:456, Z:7890";
RightShoulder = "X:123, Y:456, Z:7890";
Torso = "X:123, Y:456, Z:7890";
LeftElbow = "X:123, Y:456, Z:7890";
RightElbow = "X:123, Y:456, Z:7890";
LeftHand = "X:123, Y:456, Z:7890";
RightHand = "X:123, Y:456, Z:7890";
LeftHand = "X:123, Y:456, Z:7890";
RightHand = "X:123, Y:456, Z:7890";
LeftHip = "X:123, Y:456, Z:7890";
RightHip = "X:123, Y:456, Z:7890";
LeftKnee = "X:123, Y:456, Z:7890";
RightKnee = "X:123, Y:456, Z:7890";
LeftFoot = "X:123, Y:456, Z:7890";
RightFoot = "X:123, Y:456, Z:7890";
}
else
{
Kinect = MyKinect.Instance;
PointerColor = new SolidColorBrush(Color.FromRgb(139, 0, 0));
Messages = new ObservableCollection<string>();
Start = new RelayCommand<RoutedEventArgs>(e => SafeStartKinect());
Stop = new RelayCommand<RoutedEventArgs>(e => SafeStopKinect());
}
}
开发者ID:atosorigin,项目名称:Kinect,代码行数:31,代码来源:WorkshopViewModelBase.cs
示例5: PageHeader
public PageHeader()
{
Brush brush = new SolidColorBrush(Colors.DarkGray);
brush.Opacity = 0.60;
this.Background = brush;
Border frameBorder = new Border();
frameBorder.BorderBrush = Brushes.Gray;
frameBorder.BorderThickness = new Thickness(2);
DockPanel panelMain = new DockPanel();
panelMain.Margin = new Thickness(5, 5, 5, 5);
panelMain.VerticalAlignment = System.Windows.VerticalAlignment.Bottom;
txtText = new TextBlock();
txtText.FontSize = 32;
txtText.Margin = new Thickness(5, 0, 0, 0);
txtText.SetResourceReference(TextBlock.ForegroundProperty, "HeaderTextColor");
txtText.VerticalAlignment = System.Windows.VerticalAlignment.Bottom;
panelMain.Children.Add(txtText);
frameBorder.Child = panelMain;
this.Content = frameBorder;
}
开发者ID:rhgtvcx,项目名称:tap-desktop,代码行数:27,代码来源:PageHeader.cs
示例6: ActivateStack
public void ActivateStack()
{
SolidColorBrush scb = new SolidColorBrush(Colors.Black);
r_TileRect.Fill = scb;
c_StackCanvas.IsHitTestVisible = true;
c_StackCanvas.IsEnabled = true;
c_StackCanvas.Background = scb;
c_StackCanvas.BeginAnimation(Canvas.HeightProperty, a_Open);
c_StackCanvas.BeginAnimation(Canvas.WidthProperty, a_OpenW);
int posX = xBuff;
int posY = 40;
foreach (StackItem si in si_StackItems)
{
Canvas.SetLeft(si, posX);
Canvas.SetTop(si, posY);
c_StackCanvas.Children.Add(si);
posX += siWidth;
if (posX > 300)
{
posX = xBuff;
posY += siHeight;
}
}
b_isOpened = true;
l_StackPath.IsEnabled = true;
l_StackPath.Visibility = Visibility.Visible;
l_DecoStack.IsEnabled = true;
l_DecoStack.Visibility = Visibility.Visible;
}
开发者ID:Foda,项目名称:Tide,代码行数:35,代码来源:StackTile.xaml.cs
示例7: BackgroundSetThroughCode
public void BackgroundSetThroughCode()
{
GridSplitter splitter = new GridSplitter();
Brush b = new SolidColorBrush(Colors.Black);
splitter.Background = b;
Assert.AreEqual(b, splitter.GetValue(GridSplitter.BackgroundProperty), "Setting Background property should set backing dependency property.");
}
开发者ID:dfr0,项目名称:moon,代码行数:7,代码来源:GridSplitterTest.cs
示例8: Brique
//Constructeur
public Brique(Grid parent, double posX, double posY, bool cassable)
{
//Création de l'ellipse
this._forme = new Rectangle();
//Ajout au parent
parent.Children.Add(this._forme);
//Taille de la Brique
this._forme.Height = 20;
this._forme.Width = 60;
//Position de la Brique
this._forme.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
this._forme.VerticalAlignment = System.Windows.VerticalAlignment.Top;
this._forme.Margin = new System.Windows.Thickness(posX, posY, 0, 0);
this.Cassable = cassable;
//Couleur de la Brique
//Couleur de fond
Thread.Sleep(1);
Random R = new Random(unchecked((int)DateTime.Now.Ticks));
SolidColorBrush couleurFond = new SolidColorBrush();
byte Red = (byte)(R.Next(253) + 1);
byte Green = (byte)(R.Next(253) + 1);
byte Blue = (byte)(R.Next(253) + 1);
//Noire si incassable
couleurFond.Color = cassable ? Color.FromRgb(Red, Green, Blue) : Color.FromRgb(0, 0, 0);
this._forme.Fill = couleurFond;
//Couleur de bordure
SolidColorBrush couleurBord = new SolidColorBrush();
couleurBord.Color = Color.FromRgb(255, 255, 255);
this._forme.Stroke = couleurBord;
}
开发者ID:mbonitho,项目名称:ClockTwo,代码行数:36,代码来源:Brique.cs
示例9: Convert
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
SolidColorBrush brush = new SolidColorBrush(Colors.Red);
if ((bool)value)
brush = new SolidColorBrush(Colors.Black);
return brush;
}
开发者ID:JohnDMathis,项目名称:Pippin,代码行数:7,代码来源:Bool2RedBlack.cs
示例10: ProvideValue
public override object ProvideValue(IServiceProvider serviceProvider)
{
SolidColorBrush brush = new SolidColorBrush(GetColor());
brush.Freeze();
return brush;
}
开发者ID:spiked3,项目名称:ConeMapper,代码行数:7,代码来源:WpfExtensions.cs
示例11: CheckPostalCode
private void CheckPostalCode()
{
if (appSettings.PostalCodeSetting == "")
{
PostalCodeSet.Text = "*Required";
SolidColorBrush Brush1 = new SolidColorBrush();
Brush1.Color = Colors.Red;
PostalCodeSet.Foreground = Brush1;
ValidPC.Visibility = System.Windows.Visibility.Collapsed;
IsValidPC.Visibility = System.Windows.Visibility.Collapsed;
}
else if (!IsPostalCode(appSettings.PostalCodeSetting))
{
SolidColorBrush Brush1 = new SolidColorBrush();
Brush1.Color = Colors.Red;
PostalCodeSet.Foreground = Brush1;
PostalCodeSet.Text = appSettings.PostalCodeSetting;
ValidPC.Visibility = System.Windows.Visibility.Visible;
}
else
{
PostalCodeSet.Text = appSettings.PostalCodeSetting;
SolidColorBrush Brush1 = new SolidColorBrush();
Brush1.Color = Colors.Green;
PostalCodeSet.Foreground = Brush1;
ValidPC.Visibility = System.Windows.Visibility.Collapsed;
IsValidPC.Visibility = System.Windows.Visibility.Collapsed;
}
}
开发者ID:john0320,项目名称:WindowsPhone8Final,代码行数:30,代码来源:MainSettings.xaml.cs
示例12: Cabecera
public Cabecera()
{
Background = new SolidColorBrush(Colors.White);
Orientation = Orientation.Vertical;
var nombreJuego = new TextBlock { Text = "Tres en Línea", FontSize = 78, Foreground = new SolidColorBrush(Colors.Black), HorizontalAlignment = HorizontalAlignment.Center};
Children.Add(nombreJuego);
var nuevoJuego = new Button {Content = "Iniciar nuevo Juego", Background = new SolidColorBrush(Colors.Black)};
nuevoJuego.Tap += nuevoJuego_Tap;
Children.Add(nuevoJuego);
Grid resultadoGrid = new Grid{Background = new SolidColorBrush(Colors.White), ShowGridLines = false};
resultadoGrid.ColumnDefinitions.Add(new ColumnDefinition());
resultadoGrid.ColumnDefinitions.Add(new ColumnDefinition{Width = new GridLength(2, GridUnitType.Star)});
resultadoGrid.RowDefinitions.Add(new RowDefinition());
var labelResultado = new TextBlock { Text = "Resultado:", FontSize = 22, Foreground = new SolidColorBrush(Colors.Black), HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };
resultadoGrid.Children.Add(labelResultado);
Grid.SetColumn(labelResultado, 0);
resultado = new TextBlock { Text = "En proceso.", FontSize = 22, Foreground = new SolidColorBrush(Colors.Black), HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };
resultadoGrid.Children.Add(resultado);
Grid.SetColumn(resultado, 1);
Children.Add(resultadoGrid);
}
开发者ID:douglaszuniga,项目名称:Gato,代码行数:28,代码来源:Cabecera.cs
示例13: BottomMargin
public BottomMargin(IWpfTextView textView, IClassifierAggregatorService classifier, ITextDocumentFactoryService documentService)
{
_textView = textView;
_classifier = classifier.GetClassifier(textView.TextBuffer);
_foregroundBrush = new SolidColorBrush((Color)FindResource(VsColors.CaptionTextKey));
_backgroundBrush = new SolidColorBrush((Color)FindResource(VsColors.ScrollBarBackgroundKey));
this.Background = _backgroundBrush;
this.ClipToBounds = true;
_lblEncoding = new TextControl("Encoding");
this.Children.Add(_lblEncoding);
_lblContentType = new TextControl("Content type");
this.Children.Add(_lblContentType);
_lblClassification = new TextControl("Classification");
this.Children.Add(_lblClassification);
_lblSelection = new TextControl("Selection");
this.Children.Add(_lblSelection);
UpdateClassificationLabel();
UpdateContentTypeLabel();
UpdateContentSelectionLabel();
if (documentService.TryGetTextDocument(textView.TextDataModel.DocumentBuffer, out _doc))
{
_doc.FileActionOccurred += FileChangedOnDisk;
UpdateEncodingLabel(_doc);
}
textView.Caret.PositionChanged += CaretPositionChanged;
}
开发者ID:modulexcite,项目名称:ExtensibilityTools,代码行数:34,代码来源:BottomMargin.cs
示例14: for_MouseDown
private void for_MouseDown(object sender, MouseButtonEventArgs e)
{
SolidColorBrush[] brushes = new SolidColorBrush[]
{ Brushes.Green, Brushes.BurlyWood,Brushes.CadetBlue,
Brushes.Gray,Brushes.Chartreuse,Brushes.Chocolate,
Brushes.AliceBlue,Brushes.Coral,Brushes.CornflowerBlue,
Brushes.AntiqueWhite,Brushes.Cornsilk,Brushes.Crimson,
Brushes.Aqua,Brushes.Cyan,Brushes.DarkBlue,Brushes.DarkCyan,
Brushes.Aquamarine,Brushes.DarkGoldenrod,Brushes.DarkGray,
Brushes.Azure,Brushes.DarkGreen,Brushes.DarkKhaki,
Brushes.Beige,Brushes.DarkMagenta,Brushes.DarkOliveGreen,
Brushes.Bisque,Brushes.DarkOrange,Brushes.DarkOrchid,
Brushes.Black,Brushes.DarkRed,Brushes.DarkSalmon,
Brushes.BlanchedAlmond,Brushes.DarkSeaGreen,Brushes.DarkSlateBlue,
Brushes.Blue,Brushes.DarkSlateGray,Brushes.DarkTurquoise,
Brushes.BlueViolet,Brushes.Brown,Brushes.DarkViolet
};
TextBox b = new TextBox() { Text = "Label " + contC };
b.Name = "s" + contador;
b.Background = brushes[new Random().Next(brushes.Length)];
b.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
b.VerticalAlignment = System.Windows.VerticalAlignment.Top;
b.PreviewMouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.TextBox_PreviewMouseLeftButtonDown);
b.PreviewMouseDown += new System.Windows.Input.MouseButtonEventHandler(this.TextBox_PreviewDown);
this.workSpace.Children.Add(b);
b.Margin = new Thickness(0, 0, 0, 0);
contC++;
}
开发者ID:RobertCalbul,项目名称:Hilos,代码行数:28,代码来源:MainWindow.xaml.cs
示例15: GetBrush
internal static Brush GetBrush(this ResourceDictionary dictionary, string brushName, string colorName, Brush defaultBrush)
{
if (dictionary == null)
{
return defaultBrush;
}
var obj = dictionary[brushName];
if (obj is Brush)
{
return (Brush)obj;
}
obj = dictionary[colorName];
if (obj is Color?)
{
var color = (Color?)obj;
if (color.HasValue)
{
var brush = new SolidColorBrush(color.Value);
brush.Freeze();
return brush;
}
}
return defaultBrush;
}
开发者ID:bordev,项目名称:EasyMotion,代码行数:27,代码来源:Extensions.cs
示例16: MainViewModel
/// <summary>
/// Initializes a new instance of the MainViewModel class.
/// </summary>
public MainViewModel()
{
scoreStorage = new ScoreStorage();
HighScores = new ObservableCollection<Score>(scoreStorage.GetScores());
game = new Game();
game.PlayerLost += GameOnPlayerLost;
game.PlayerTooFast += GameOnPlayerTooFast;
game.PlayerWon += GameOnPlayerWon;
game.CountdownTick += GameOnCountdownTick;
game.WaitForItStarted += GameOnWaitForItStarted;
game.TapDanceStarted += GameOnTapDanceStarted;
game.ButtonsCanBeClickedChanged += GameOnButtonsCanBeClickedChanged;
patternTimer = new DispatcherTimer();
patternTimer.Tick += PatternTimerOnTick;
patternTimer.Interval = buttonLightingTime;
Button1Command = new RelayCommand(() => game.ButtonClicked(0), () => game.ButtonsCanBeClicked);
Button2Command = new RelayCommand(() => game.ButtonClicked(1), () => game.ButtonsCanBeClicked);
Button3Command = new RelayCommand(() => game.ButtonClicked(2), () => game.ButtonsCanBeClicked);
Button4Command = new RelayCommand(() => game.ButtonClicked(3), () => game.ButtonsCanBeClicked);
StartRetryCommand = new RelayCommand(() => StartNewPattern(game.GetNewPattern()), () => true);
Button1BackColor = new SolidColorBrush(Colors.Black);
Button2BackColor = new SolidColorBrush(Colors.Black);
Button3BackColor = new SolidColorBrush(Colors.Black);
Button4BackColor = new SolidColorBrush(Colors.Black);
StartRetryText = "Start";
SetNumberButtonsToDefault();
}
开发者ID:koenmetsu,项目名称:WP7.TapDance,代码行数:33,代码来源:MainViewModel.cs
示例17: EllipseItemsFactory
/// <summary>
/// Initializes a new instance of the <see cref="DW.WPFToolkit.Controls.EllipseItemsFactory" /> class.
/// </summary>
public EllipseItemsFactory()
{
Color = new SolidColorBrush(Colors.Red);
ItemsCount = 10;
OpacityShrinking = 0.1;
Size = 8;
}
开发者ID:bisato,项目名称:DW.WPFToolkit,代码行数:10,代码来源:EllipseItemsFactory.cs
示例18: MainWindow
public MainWindow()
{
InitializeComponent();
DispatcherTimer timer = new DispatcherTimer();
Random rnd = new Random();
timer.Interval = TimeSpan.FromSeconds(1.0);
timer.Tick += (s, e) =>
{
TestTimer++;
TestBackground = new SolidColorBrush(Color.FromRgb(
(byte)rnd.Next(0, 255), (byte)rnd.Next(0, 255), (byte)rnd.Next(0, 255)));
FocusedElement = Keyboard.FocusedElement == null ? string.Empty : Keyboard.FocusedElement.ToString();
//Debug.WriteLine(string.Format("ActiveContent = {0}", dockManager.ActiveContent));
};
timer.Start();
this.DataContext = this;
winFormsHost.Child = new UserControl1();
}
开发者ID:VoronFX,项目名称:AvalonDock.Themes.VS2013,代码行数:26,代码来源:MainWindow.xaml.cs
示例19: Create
public static Uri Create(string filename, string text, SolidColorBrush backgroundColor, double textSize, Size size)
{
var background = new Rectangle();
background.Width = size.Width;
background.Height = size.Height;
background.Fill = backgroundColor;
var textBlock = new TextBlock();
textBlock.Width = 500;
textBlock.Height = 500;
textBlock.TextWrapping = TextWrapping.Wrap;
textBlock.Text = text;
textBlock.FontSize = textSize;
textBlock.Foreground = new SolidColorBrush(Colors.White);
textBlock.FontFamily = new FontFamily("Segoe WP");
var tileImage = "/Shared/ShellContent/" + filename;
using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
{
var bitmap = new WriteableBitmap((int)size.Width, (int)size.Height);
bitmap.Render(background, new TranslateTransform());
bitmap.Render(textBlock, new TranslateTransform() { X = 39, Y = 88 });
var stream = store.CreateFile(tileImage);
bitmap.Invalidate();
bitmap.SaveJpeg(stream, (int)size.Width, (int)size.Height, 0, 99);
stream.Close();
}
return new Uri("ms-appdata:///local" + tileImage, UriKind.Absolute);
}
开发者ID:halllo,项目名称:DailyQuote,代码行数:29,代码来源:LockScreenImage.cs
示例20: MouseHandler
static MouseHandler()
{
_brHighlight = new SolidColorBrush(Color.FromArgb(128, 255, 215, 140));
_brHighlight.Freeze();
_brInsert = new SolidColorBrush(Color.FromArgb(128, 0, 0, 0));
_brInsert.Freeze();
}
开发者ID:mdjabirov,项目名称:C1Decompiled,代码行数:7,代码来源:MouseHandler.cs
注:本文中的System.Windows.Media.SolidColorBrush类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论