本文整理汇总了C#中Windows.UI.Xaml.Media.SolidColorBrush类的典型用法代码示例。如果您正苦于以下问题:C# SolidColorBrush类的具体用法?C# SolidColorBrush怎么用?C# SolidColorBrush使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SolidColorBrush类属于Windows.UI.Xaml.Media命名空间,在下文中一共展示了SolidColorBrush类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SubredditSideBar
public SubredditSideBar()
{
this.InitializeComponent();
// Get the accent color
Color accentColor = ((SolidColorBrush)App.Current.Resources["SystemControlBackgroundAccentBrush"]).Color;
// Set the title color
Color darkAccent = accentColor;
darkAccent.A = 170;
ui_titleHeaderContainer.Background = new SolidColorBrush(darkAccent);
// Set the button container background
Color darkerAccent = accentColor;
darkerAccent.A = 90;
ui_buttonContainer.Background = new SolidColorBrush(darkerAccent);
// Set the active button background
Color buttonActive = accentColor;
buttonActive.A = 200;
m_buttonActive = new SolidColorBrush(buttonActive);
// Get the button inactive color
Color buttonAccent = accentColor;
buttonAccent.A = 90;
m_buttonInactive = new SolidColorBrush(buttonAccent);
// Set the submit link and text colors
ui_submitPostButton.Background = m_buttonInactive;
ui_searchSubreddit.Background = m_buttonInactive;
}
开发者ID:Arthur-Lee,项目名称:Baconit,代码行数:31,代码来源:SubredditSideBar.xaml.cs
示例2: PerformFaceAnalysis
private async void PerformFaceAnalysis(StorageFile file)
{
var imageInfo = await FileHelper.GetImageInfoForRendering(file.Path);
NewImageSizeWidth = 300;
NewImageSizeHeight = NewImageSizeWidth*imageInfo.Item2/imageInfo.Item1;
var newSourceFile = await FileHelper.CreateCopyOfSelectedImage(file);
var uriSource = new Uri(newSourceFile.Path);
SelectedFileBitmapImage = new BitmapImage(uriSource);
// start face api detection
var faceApi = new FaceApiHelper();
DetectedFaces = await faceApi.StartFaceDetection(newSourceFile.Path, newSourceFile, imageInfo, "4c138b4d82b947beb2e2926c92d1e514");
// draw rectangles
var color = Color.FromArgb(125, 255, 0, 0);
var bg = new SolidColorBrush(color);
DetectedFacesCanvas = new ObservableCollection<Canvas>();
foreach (var detectedFace in DetectedFaces)
{
var margin = new Thickness(detectedFace.RectLeft, detectedFace.RectTop, 0, 0);
var canvas = new Canvas()
{
Background = bg,
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Top,
Height = detectedFace.RectHeight,
Width = detectedFace.RectWidth,
Margin = margin
};
DetectedFacesCanvas.Add(canvas);
}
}
开发者ID:modulexcite,项目名称:ProjectOxford,代码行数:35,代码来源:MainPage.xaml.cs
示例3: DrawGrid
private void DrawGrid()
{
int index = 0;
SolidColorBrush black = new SolidColorBrush(Colors.Black);
SolidColorBrush white = new SolidColorBrush(Colors.White);
// Set colors of each rectangle based on grid values
for (int r = 0; r < gridWidth; r++)
for (int c = 0; c < gridWidth; c++)
{
Rectangle rect = paintCanvas.Children[index] as Rectangle;
index++;
if (grid[r, c])
{
// On
rect.Fill = white;
rect.Stroke = black;
}
else
{
// Off
rect.Fill = black;
rect.Stroke = white;
}
}
}
开发者ID:jgreenlee24,项目名称:LightsOut_WinStore,代码行数:28,代码来源:MainPage.xaml.cs
示例4: init
void init()
{
Background = new SolidColorBrush(ColorHelper.FromArgb(70, 0, 0, 0));
progressbar = new ProgressBar() { IsIndeterminate =true };
Children.Add(progressbar);
}
开发者ID:Milton761,项目名称:mLearningCoreEN,代码行数:7,代码来源:HorizontalLoading.cs
示例5: Convert
//public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
//{
// int CURRENT_DEGREE = System.Convert.ToInt32(value);
// RadialGradientBrush gb = parameter as RadialGradientBrush;
// switch (CURRENT_DEGREE)
// {
// case 0:
// //return gb;
// RadialGradientBrush rb = new RadialGradientBrush();
// //rb.GradientStops.Add(new GradientStop() { Color = Colors.Transparent, Offset = 0 });
// return rb;
// case 1:
// foreach (GradientStop s in gb.GradientStops)
// {
// Color c = Colors.Yellow;
// c.A = s.Color.A;
// s.Color = c;
// }
// return gb;
// case 2:
// foreach (GradientStop s in gb.GradientStops)
// {
// Color c = Colors.Orange;
// c.A = s.Color.A;
// s.Color = c;
// }
// return gb;
// case 3:
// foreach (GradientStop s in gb.GradientStops)
// {
// Color c = Colors.Red;
// c.A = s.Color.A;
// s.Color = c;
// }
// return gb;
// default:
// return new RadialGradientBrush();
// }
// throw new NotImplementedException();
//}
public object Convert(object value, Type targetType, object parameter, string language)
{
int CURRENT_DEGREE = System.Convert.ToInt32(value);
// SolidColorBrush gb = parameter as SolidColorBrush;
switch (CURRENT_DEGREE)
{
case 0:
//return gb;
SolidColorBrush rb = new SolidColorBrush(Colors.Transparent);
//rb.GradientStops.Add(new GradientStop() { Color = Colors.Transparent, Offset = 0 });
return rb;
case 1:
return new SolidColorBrush(Colors.Yellow);
case 2:
return new SolidColorBrush(Colors.Orange);
case 3:
return new SolidColorBrush(Colors.Red);
default:
return new SolidColorBrush(Colors.Transparent);
}
}
开发者ID:ufjl0683,项目名称:sshmc,代码行数:65,代码来源:Converters.cs
示例6: ButtonGenerate_Click
private void ButtonGenerate_Click(object sender, RoutedEventArgs e)
{
// Generate points for graph
var points = new List<Point>();
for (var connectivity = 0; connectivity <= 100; connectivity += 1)
{
var possibility = .0;
for (var testNumber = 0; testNumber < TestsCount; testNumber++)
if (CheckBoxType.IsChecked != null && (!CheckBoxType.IsChecked.Value && _schedule.CheckConflict(Convert.ToInt16(SliderSize.Value), connectivity) ||
CheckBoxType.IsChecked.Value && _schedule.CheckNecessary(Convert.ToInt16(SliderSize.Value), connectivity)))
possibility++;
possibility /= TestsCount;
points.Add(new Point((int)(connectivity * CanvasGraph.RenderSize.Width * .01), (int)(CanvasGraph.RenderSize.Height - possibility * CanvasGraph.RenderSize.Height)));
}
// Draw graph
var b = new SolidColorBrush(_colors[_colorIdx++ % _colors.Count]);
for (var i = 0; i < points.Count - 1; i++)
{
var line = new Line
{
Stroke = b,
X1 = points[i].X,
X2 = points[i + 1].X,
Y1 = points[i].Y,
Y2 = points[i + 1].Y,
StrokeThickness = 2
};
CanvasGraph.Children.Add(line);
}
}
开发者ID:MaxBondarchuk,项目名称:T7_SSW_Lab4,代码行数:32,代码来源:MainPage.xaml.cs
示例7: Contact
public Contact(SolidColorBrush foregroundColor, SolidColorBrush backgroundColor, bool imageMirrored = false)
{
this.InitializeComponent();
SetColors(foregroundColor, backgroundColor);
SetFooterImage(imageMirrored);
}
开发者ID:Prog-Party,项目名称:ProgParty.BoredPanda,代码行数:7,代码来源:Contact.xaml.cs
示例8: init
void init()
{
Background = new SolidColorBrush(Colors.Transparent);
HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Left;
_transform = new CompositeTransform() { CenterX = DeviceWidth / 2, CenterY = DeviceHeight / 2 };
RenderTransform = _transform;
_backimage = new Image() { Stretch = Stretch.UniformToFill };
Children.Add(_backimage);
//just bytes
//_blackgrid = new Grid() { Width = DeviceWidth, Height = DeviceHeight, Background = new SolidColorBrush(Colors.Black), Opacity = 0.4 };
//Children.Add(_blackgrid);
//just bytes
//_backtext = new CoverTextSlide();
//Children.Add(_backtext);
_pagegrid = new Grid() { Width = DeviceWidth, Height = DeviceHeight };
Children.Add(_pagegrid);
Canvas.SetZIndex(_pagegrid, -10);
//just bytes
//_loadingview = new LoadingView() { Width = 1600, Height = 900 };
//Children.Add(_loadingview);
}
开发者ID:Milton761,项目名称:mLearningCoreEN,代码行数:28,代码来源:LOReaderScrollElement.cs
示例9: AppSettings_PropertyChanged
private void AppSettings_PropertyChanged( object sender, global::System.ComponentModel.PropertyChangedEventArgs e )
{
if( e.PropertyName == Parameters.APPEARANCE_CONTENTREADER_NAVBG )
{
BackgroundBrush = new SolidColorBrush( Properties.APPEARANCE_CONTENTREADER_NAVBG );
}
}
开发者ID:tgckpg,项目名称:wenku10,代码行数:7,代码来源:NavPaneSection.cs
示例10: AuthorFlairKindConverter
static AuthorFlairKindConverter()
{
if (Application.Current.Resources.ContainsKey("SystemColorControlAccentColor"))
bg_op = Application.Current.Resources["SystemColorControlAccentColor"] as SolidColorBrush;
else
bg_op = Utility.GetColorFromHexa("#FFDAA520");
}
开发者ID:hippiehunter,项目名称:Baconography,代码行数:7,代码来源:AuthorFlairKindConverter.cs
示例11: Convert
/// <summary>
/// Convert a hexadecimal color string to a corresponding brush
/// </summary>
/// <param name="value">Value to convert</param>
/// <param name="targetType">Target type requiered</param>
/// <param name="parameter">Converter parameter</param>
/// <param name="language">language information</param>
/// <returns>The corresponding brush</returns>
public object Convert(object value,
Type targetType,
object parameter,
String language)
{
String color = ((String)value).Replace("#",
"");
Brush colorBrush = null;
if (color.Length == 6)
{
if (Brushes.ContainsKey(color))
{
return Brushes[color];
}
colorBrush = new SolidColorBrush(Color.FromArgb(255,
byte.Parse(color.Substring(0,
2),
NumberStyles.HexNumber),
byte.Parse(color.Substring(2,
2),
NumberStyles.HexNumber),
byte.Parse(color.Substring(4,
2),
NumberStyles.HexNumber)));
Brushes[color] = colorBrush;
}
return colorBrush;
}
开发者ID:dinord2005,项目名称:MyUniversalConverters,代码行数:40,代码来源:HexStringToSolidColorBrushConverter.cs
示例12: Page_LayoutUpdated
private void Page_LayoutUpdated(object sender, object e)
{
if (new RepositorioConfig().ObterTodos().Any())
{
var solidbrush = new SolidColorBrush(
Color.FromArgb(
Convert.ToByte(
new RepositorioConfig().ObterTodos()
.FirstOrDefault(c => c.Componente.Equals(StackPanelMenu.Name.ToString()))
.ColorA),
Convert.ToByte(
new RepositorioConfig().ObterTodos()
.FirstOrDefault(c => c.Componente.Equals(StackPanelMenu.Name.ToString()))
.ColorR),
Convert.ToByte(
new RepositorioConfig().ObterTodos()
.FirstOrDefault(c => c.Componente.Equals(StackPanelMenu.Name.ToString()))
.ColorG),
Convert.ToByte(
new RepositorioConfig().ObterTodos()
.FirstOrDefault(c => c.Componente.Equals(StackPanelMenu.Name.ToString()))
.ColorB)));
StackPanelMenu.Background = solidbrush;
HeaderPanel.Background = solidbrush;
UpdateLayout();
}
}
开发者ID:carloshenriquecarniatto,项目名称:Podcasts,代码行数:27,代码来源:MainPage.xaml.cs
示例13: MoviePlayer
public MoviePlayer(ref Popup Popup)
{
this.popup = Popup;
this.InitializeComponent();
string youTubeId = "VXPoJAyeF8k";
TestImage.Source = image;
TestImage.Height = 500;
TestImage.Width = 340;
var url = YouTube.GetVideoUriAsync(youTubeId);
var url2 = YouTube.GetVideoUri(youTubeId, YouTubeQuality.Quality1080P, null);
MovieContainer.Source = url.Result.Uri;
MovieContainer.Play();
MovieContainer.Width = baseMovieWidth;
MovieContainer.Height = baseMovieHeight;
LikeActive = new SolidColorBrush();
LikeActive.Color = Colors.ForestGreen;
LikeInactive = new SolidColorBrush();
LikeInactive.Color = Colors.White;
DislikeActive = new SolidColorBrush();
DislikeActive.Color = Colors.Red;
DislikeInactive = new SolidColorBrush();
DislikeInactive.Color = Colors.White;
}
开发者ID:alexsb92,项目名称:TheMovieTrailerApp,代码行数:28,代码来源:MoviePlayer.xaml.cs
示例14: Convert
public object Convert(object value, Type targetType, object parameter, string language)
{
var state = value.ToString();
SolidColorBrush returnValue = null;
if (state != null)
{
switch (state)
{
case "Nothing":
returnValue = new SolidColorBrush(Functions.FromStringColor("#00FFFFFF"));
break;
case "ChoiceNobodyNormal":
returnValue = new SolidColorBrush(Functions.FromStringColor("#FF7392CB"));
break;
case "ChoiceNobodyCouple":
returnValue = new SolidColorBrush(Functions.FromStringColor("#FFF77979"));
break;
case "ChoiceNobodyOldWeak":
returnValue = new SolidColorBrush(Functions.FromStringColor("#FFB8DD8C"));
break;
case "ChoiceMe":
returnValue = new SolidColorBrush(Functions.FromStringColor("#FFF9B196"));
break;
case "ChoiceOther":
returnValue = new SolidColorBrush(Functions.FromStringColor("#FFD1D1D1"));
break;
}
}
return returnValue;
}
开发者ID:vapps,项目名称:RMovie,代码行数:30,代码来源:SeatStateToColorConverter.cs
示例15: MapControl
public MapControl()
{
Background = new SolidColorBrush(Colors.White); // DON'T REMOVE! Touch events do not work without a background
Children.Add(_renderTarget);
Children.Add(_bboxRect);
Children.Add(_attributionPanel);
_renderTarget.PaintSurface += _renderTarget_PaintSurface;
Map = new Map();
Loaded += MapControlLoaded;
SizeChanged += MapControlSizeChanged;
CompositionTarget.Rendering += CompositionTarget_Rendering;
_renderer = new MapRenderer();
PointerWheelChanged += MapControl_PointerWheelChanged;
ManipulationMode = ManipulationModes.Scale | ManipulationModes.TranslateX | ManipulationModes.TranslateY;
ManipulationDelta += OnManipulationDelta;
ManipulationCompleted += OnManipulationCompleted;
ManipulationInertiaStarting += OnManipulationInertiaStarting;
var orientationSensor = SimpleOrientationSensor.GetDefault();
if (orientationSensor != null)
orientationSensor.OrientationChanged += (sender, args) =>
Task.Run(() => Dispatcher.RunAsync(CoreDispatcherPriority.Normal, Refresh))
.ConfigureAwait(false);
}
开发者ID:pauldendulk,项目名称:Mapsui,代码行数:29,代码来源:MapControl.cs
示例16: init
void init()
{
Background = new SolidColorBrush(Colors.Transparent);
VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Top;
HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Left;
_transform = new CompositeTransform();
_c_transform = new CompositeTransform();
RenderTransform = _transform;
//scroll
_scroll = new ScrollViewer()
{
HorizontalScrollMode = ScrollMode.Enabled,
VerticalScrollMode = ScrollMode.Enabled,
HorizontalScrollBarVisibility = ScrollBarVisibility.Hidden,
VerticalScrollBarVisibility = ScrollBarVisibility.Hidden
};
Children.Add(_scroll);
//content
_content = new Grid() { HorizontalAlignment = HorizontalAlignment.Left, ManipulationMode = ManipulationModes.All };
_content.RenderTransform = _c_transform;
_image = new Image() { Stretch = Stretch.UniformToFill };
_border = new Border() { CornerRadius = new Windows.UI.Xaml.CornerRadius(10) };
_content.Children.Add(_image);
_content.Children.Add(_border);
_scroll.Content = _content;
}
开发者ID:Milton761,项目名称:mLearningCoreEN,代码行数:27,代码来源:AnimatedBorderImage.cs
示例17: DeleteFile
private async void DeleteFile(object sender, RoutedEventArgs e)
{
var file = await ApplicationData.Current.LocalFolder.GetFileAsync(_fileName);
await file.DeleteAsync();
IsEnabled = false;
Background = new SolidColorBrush(Colors.DarkGray);
}
开发者ID:Mordonus,项目名称:MALClient,代码行数:7,代码来源:CachedEntryItem.xaml.cs
示例18: Avalon
public Avalon(GeometryFactory Segments, Activation Attach, Activation Detach, ManipulationDeltaEventHandler Router,byte definition , bool Real = false)
{
if (!Real)
{
this.definition = definition;
Data = Segments.Pattern();
ManipulationMode = Windows.UI.Xaml.Input.ManipulationModes.All;
RenderTransform = new CompositeTransform();
RenderTransformOrigin = new Windows.Foundation.Point(0.5, 0.5);
Fill = new SolidColorBrush(new Color { A = 0, R = 0, G = 0, B = 0 });
this.Attach = Attach;
this.Detach = Detach;
this.Router = Router;
Tapped += Avalon_Tapped;
Holding += Avalon_Holding;
Loaded += Avalon_Loaded;
Unloaded += Avalon_Unloaded;
ManipulationDelta += Avalon_ManipulationDelta;
this.Real = new Avalon(Segments, Attach, Detach, null, definition,true);
this.Real.RenderTransform = RenderTransform;
this.Real.RenderTransformOrigin = RenderTransformOrigin;
this.Real.Data = Segments.Pattern();
this.Real.Fill = new SolidColorBrush(Colors.RosyBrown);
Canvas.SetZIndex(this, 2);
Canvas.SetZIndex(this.Real, 0);
Avalon_Holding(null, null);
}
}
开发者ID:MohammedAbuissa,项目名称:Avalon,代码行数:28,代码来源:Avalon.cs
示例19: calculateModulo
public void calculateModulo(int val)
{
seed = val;
brushList.Clear();
int moddedNumber = 0;
for (int i = 1; i < (seed/2)+1; i++)
{
brushList.Add(new List<SolidColorBrush>());
for (int j = 1; j < seed; j++)
{
SolidColorBrush b = new SolidColorBrush();
moddedNumber = (i * j) % seed;
//convert from old to new range
//NewValue = (((OldValue - OldMin) * (NewMax - NewMin)) / (OldMax - OldMin)) + NewMin
long newValue = (((moddedNumber) * (byteMax)) / seed + (byteMax / 4));
//convert newValue to byte array
byte[] bytes = BitConverter.GetBytes(newValue);
//first byte is transparency, so we only use
//the range of bytes 1-3 to generate the color
b.Color = (Color.FromArgb(BitConverter.GetBytes(byteMax)[0], bytes[1], bytes[2], bytes[3]));
brushList.ElementAt(i - 1).Add(b);
}
}
}
开发者ID:erikmhauck,项目名称:Modulo-Table-Visualizer-WindowsUniversal,代码行数:27,代码来源:Table.cs
示例20: MapViewerControl
public MapViewerControl()
{
this.InitializeComponent();
MarkerVisibility = Visibility.Visible;
MarkerFill = new SolidColorBrush(Color.FromArgb(70, 255, 0, 0));
MarkerStroke = new SolidColorBrush(Color.FromArgb(255, 255, 0, 0));
MarkerScale = 1d;
if (DesignMode.DesignModeEnabled) return;
var dispatcher = Windows.UI.Core.CoreWindow.GetForCurrentThread().Dispatcher;
DataContextChanged += (sender, args) =>
{
if (ViewModel == null || _isLoaded) return;
_isLoaded = true;
ServiceLocator.Current.AsyncImageLoaderService.LoadImageAsync(ViewModel.Entity.Image.Id)
.ContinueWith(async imageTask =>
{
await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
E_Image_Map.ImageOpened += (s1, a1) => {
MapImageLoadedEvent?.Invoke(this, null);
};
E_Image_Map.Source = imageTask.Result;
});
});
};
}
开发者ID:eurofurence,项目名称:ef-app_wp,代码行数:33,代码来源:MapViewerControl.xaml.cs
注:本文中的Windows.UI.Xaml.Media.SolidColorBrush类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论