本文整理汇总了C#中Windows.UI.Xaml.Shapes.Ellipse.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# Ellipse.SetValue方法的具体用法?C# Ellipse.SetValue怎么用?C# Ellipse.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Windows.UI.Xaml.Shapes.Ellipse
的用法示例。
在下文中一共展示了Ellipse.SetValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MainPage
public MainPage()
{
this.InitializeComponent();
initLedMatrixDevice();
for (int i = 0; i < MATRIX_SIZE; i++)
{
TextBlock tb = new TextBlock();
tb.Text = "0x00";
tb.HorizontalAlignment = HorizontalAlignment.Center;
tb.VerticalAlignment = VerticalAlignment.Center;
tb.SetValue(Grid.RowProperty, i);
tb.SetValue(Grid.ColumnProperty, MATRIX_SIZE);
_matrix.Children.Add(tb);
_matrixRowValue[i] = tb;
for (int j = 0; j < MATRIX_SIZE; j++)
{
Ellipse led = new Ellipse();
led.Width = 40;
led.Height = 40;
led.HorizontalAlignment = HorizontalAlignment.Center;
led.VerticalAlignment = VerticalAlignment.Center;
led.Fill = _off;
led.SetValue(Grid.RowProperty, i);
led.SetValue(Grid.ColumnProperty, j);
led.PointerPressed += Led_PointerPressed;
_matrix.Children.Add(led);
setMatrixData(i, j, 0);
}
}
}
示例2: MainPage_Loaded
private async void MainPage_Loaded(object sender, RoutedEventArgs e)
{
var width = this.ActualWidth;
var height = this.ActualHeight;
var min = Math.Min(width, height);
var cwidth = min/8;
for (var r = 0; r < 8; r++)
{
for (var c = 0; c < 8; c++)
{
var ellipse = new Ellipse() {Width = cwidth, Height = cwidth};
grid.Children.Add(ellipse);
ellipse.Tag = r*8 + c;
ellipse.Stroke = new SolidColorBrush(Colors.White);
ellipse.Fill = _offBrush;
ellipse.PointerPressed += Ellipse_PointerPressed;
ellipse.SetValue(Grid.RowProperty, r);
ellipse.SetValue(Grid.ColumnProperty, c);
}
}
_backpack = new Adafrut8x8LEDBackpack();
await _backpack.initializeAsync();
}
示例3: Activate
private void Activate(Point2D item)
{
if (Map == null || Map.Layers == null)
{
return;
}
ellipse = new Ellipse();
#region 所有风格的控制
ellipse.Stroke = Stroke;
ellipse.StrokeThickness = StrokeThickness;
ellipse.Fill = Fill;
ellipse.StrokeMiterLimit = StrokeMiterLimit;
ellipse.StrokeDashOffset = StrokeDashOffset;
ellipse.StrokeDashArray = StrokeDashArray;
ellipse.StrokeDashCap = StrokeDashCap;
ellipse.StrokeEndLineCap = StrokeEndLineCap;
ellipse.StrokeLineJoin = StrokeLineJoin;
ellipse.StrokeStartLineCap = StrokeStartLineCap;
ellipse.Opacity = Opacity;
#endregion
DrawLayer = new ElementsLayer();
Map.Layers.Add(DrawLayer);
ellipse.SetValue(ElementsLayer.BBoxProperty, new Rectangle2D(item, item));
DrawLayer.Children.Add(ellipse);
isActivated = true;
isDrawing = true;
}
示例4: createGameGrid
private void createGameGrid(int gridSize)
{
int cols, rows;
// create row and col definitions
for( cols=0; cols < gridSize; cols++)
{
contentGrid.RowDefinitions.Add(new RowDefinition());
contentGrid.ColumnDefinitions.Add(new ColumnDefinition());
}
// add rectangle to the grid squares
// make them a little smaller
Rectangle myR;
for (cols = 0; cols < gridSize; cols++)
{
for (rows = 0; rows < gridSize; rows++)
{
myR = new Rectangle();
myR.Name = "r" + cols.ToString() + "_" + rows.ToString(); // r0_1
myR.Width = (contentGrid.Width / gridSize) - 4;
myR.Height = (contentGrid.Height / gridSize) - 4;
myR.HorizontalAlignment = HorizontalAlignment.Center;
myR.VerticalAlignment = VerticalAlignment.Center;
myR.SetValue(Grid.RowProperty, rows);
myR.SetValue(Grid.ColumnProperty, cols);
myR.Fill = new SolidColorBrush(Colors.LightGray);
myR.Tapped += MyR_Tapped;
contentGrid.Children.Add(myR);
}
}
Ellipse myE;
//TransformGroup myTransformGroup = new TransformGroup();
//TranslateTransform transTransForm;
//transTransForm = new TranslateTransform();
//transTransForm.X = contentGrid.Width * ((gridSize - 1) / gridSize);
//transTransForm.Y = contentGrid.Height* ((gridSize - 1) / gridSize);
//transTransForm.SetValue(NameProperty, "myTranslateTransform");
//myTransformGroup.Children.Add(transTransForm);
for (cols = 0; cols < 2; cols++)
{
myE = new Ellipse();
myE.Name = "piece" + cols.ToString();
myE.Height = (contentGrid.Height / gridSize) - 6;
myE.Width = (contentGrid.Width / gridSize) - 6;
myE.Stroke = new SolidColorBrush(Colors.Red);
myE.StrokeThickness = 0;
myE.Fill = new SolidColorBrush(Colors.Yellow);
myE.SetValue(Grid.RowProperty, cols);
myE.SetValue(Grid.ColumnProperty, cols);
myE.Tapped += MyE_Tapped;
//myE.RenderTransform = myTransformGroup;
_ellipseHeight = myE.Height;
_ellipseWidth = myE.Width;
contentGrid.Children.Add(myE);
}
}
示例5: AddBackgroundRings
private void AddBackgroundRings()
{
//Add outer background circle
var outerRingBackground = new Ellipse
{
Width = (OuterRingRadius * 2) + StripWidth,
Height = (OuterRingRadius * 2) + StripWidth,
Stroke = new SolidColorBrush(Color.FromArgb(255, 30, 30, 30)),
StrokeThickness = StripWidth
};
//Ensure these are drawn behind everything
outerRingBackground.SetValue(ZIndexProperty, -5);
SetLeft(outerRingBackground, (CentreX - OuterRingRadius - (StripWidth / 2)));
SetTop(outerRingBackground, (CentreY - OuterRingRadius - (StripWidth / 2)));
outerRingBackground.IsHitTestVisible = false;
Children.Add(outerRingBackground);
//Add inner background circle
var innerRingBackground = new Ellipse
{
Width = (InnerRingRadius * 2) + StripWidth,
Height = (InnerRingRadius * 2) + StripWidth,
Stroke = new SolidColorBrush(Color.FromArgb(255, 50, 50, 50)),
StrokeThickness = StripWidth
};
//Ensure these are drawn behind everything
innerRingBackground.SetValue(ZIndexProperty, -5);
SetLeft(innerRingBackground, (CentreX - InnerRingRadius - (StripWidth / 2)));
SetTop(innerRingBackground, (CentreY - InnerRingRadius - (StripWidth / 2)));
innerRingBackground.IsHitTestVisible = false;
Children.Add(innerRingBackground);
}