本文整理汇总了C#中Windows.UI.Xaml.Shapes.Ellipse类的典型用法代码示例。如果您正苦于以下问题:C# Ellipse类的具体用法?C# Ellipse怎么用?C# Ellipse使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Ellipse类属于Windows.UI.Xaml.Shapes命名空间,在下文中一共展示了Ellipse类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnTapped
protected override void OnTapped(TappedRoutedEventArgs e) {
Point pt = e.GetPosition(this);
// Create dot
Ellipse ellipse = new Ellipse {
Width = 3,
Height = 3,
Fill = this.Foreground
};
Canvas.SetLeft(ellipse, pt.X);
Canvas.SetTop(ellipse, pt.Y);
canvas.Children.Add(ellipse);
// Create text
TextBlock txtblk = new TextBlock {
Text = String.Format("{0}", pt),
FontSize = 24
};
Canvas.SetLeft(txtblk, pt.X);
Canvas.SetTop(txtblk, pt.Y);
canvas.Children.Add(txtblk);
e.Handled = true;
base.OnTapped(e);
}
示例2: 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;
}
示例3: MainPage
public MainPage()
{
Debug.WriteLine("Phone MainPage");
this.InitializeComponent();
this.NavigationCacheMode = NavigationCacheMode.Required;
client = new Client(username, address, port);
client.Connected += Client_Connected;
client.Error += Client_Error;
client.MessageReceived += Client_MessageReceived;
MeasureButton.Click += MeasureButton_Click;
MeasureButton_Hx.Click += MeasureButton_Hx_Click;
GoToHxButton.Click += GoToHxButton_Click;
// manual rfid button
ScanText.PointerReleased += ScanText_PointerReleased;
touchPoint = new Ellipse()
{
Width = 25,
Height = 25,
Fill = new SolidColorBrush(Windows.UI.Colors.Red),
RenderTransform = new CompositeTransform()
};
touchPoint.Visibility = Visibility.Collapsed;
Container.Children.Add(touchPoint);
Container.PointerReleased += Container_PointerReleased;
Debug.WriteLine("Phone MainPage End");
}
示例4: CreateMarker
private UIElement CreateMarker() {
Canvas marker = new Canvas();
Ellipse outer = new Ellipse() {
Width = 25,
Height = 25,
};
outer.Fill = new SolidColorBrush(Color.FromArgb(255,240,240,240));
outer.Margin = new Thickness(-12.5, -12.5, 0, 0);
Ellipse inner = new Ellipse() {
Width = 20,
Height = 20,
};
inner.Fill = new SolidColorBrush(Colors.Black);
inner.Margin = new Thickness(-10, -10, 0, 0);
Ellipse core = new Ellipse() {
Width = 10,
Height = 10,
};
core.Fill = new SolidColorBrush(Colors.White);
core.Margin = new Thickness(-5, -5, 0, 0);
marker.Children.Add(outer);
marker.Children.Add(inner);
marker.Children.Add(core);
return marker;
}
示例5: BlankPage_Loaded
void BlankPage_Loaded(object sender, RoutedEventArgs e)
{
PointerMoved += BlankPage_PointerMoved;
for (var i = 0; i < Items.Length; i++)
{
var g = new Grid { Width = 30, Height = 30 };
var ball = new Ellipse { Fill = new SolidColorBrush(Colors.Red), Opacity = .2 };
var tb = new TextBlock { Text = "" + i, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };
Canvas.SetLeft(g, 0D);
Canvas.SetTop(g, 0D);
Items[i] = g;
g.Children.Add(ball);
g.Children.Add(tb);
g.RenderTransformOrigin = new Point(.5, .5);
//g.Effect = new DropShadowEffect();
LayoutRoot.Children.Add(g);
}
CompositionTarget.Rendering += (s, args) =>
{
//countTxt.Text = "EaseObjects in memory = " + EaseObject.EaseObjectRunningCount;
};
}
示例6: ItemContainerGenerator_ItemsChanged
private void ItemContainerGenerator_ItemsChanged(object sender, ItemsChangedEventArgs e)
{
if (e.Action == 1)
{
Position item = lstPositions.Items.Last() as Position;
layers = new MapLayer();
image = new BitmapImage();
image.UriSource = (new Uri(SelectedFriend.Picture, UriKind.Absolute));
grid = new Grid();
grid.DataContext = item;
grid.RightTapped += grid_RightTapped;
textBlock = new TextBlock();
textBlock.Text = item.Counter.ToString();
textBlock.VerticalAlignment = VerticalAlignment.Bottom;
textBlock.HorizontalAlignment = HorizontalAlignment.Center;
brush = new ImageBrush();
brush.ImageSource = image;
ellipse = new Ellipse();
ellipse.Height = 100;
ellipse.Width = 100;
ellipse.Fill = brush;
grid.Children.Add(ellipse);
grid.Children.Add(textBlock);
layers.Children.Add(grid);
MapLayer.SetPosition(grid, new Location(item.Latitude, item.Longitude));
myMap.Children.Add(layers);
}
}
示例7: 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();
}
示例8: StarControlFactory
public static UIElement StarControlFactory(double scale)
{
// Draw star shape
Array starShapes = Enum.GetValues(typeof(StarShape));
StarShape randomShape = (StarShape)starShapes.GetValue(_random.Next(0, starShapes.Length));
UIElement starControl; //ISSUE: Is this type good?
switch (randomShape)
{
case StarShape.Rectangle:
starControl = new Rectangle()
{Fill = new SolidColorBrush(RandomColor()) };
break;
case StarShape.Ellipse:
starControl = new Ellipse()
{ Fill = new SolidColorBrush(RandomColor()) };
break;
case StarShape.Star:
starControl = new Star()
{ Fill = new SolidColorBrush(RandomColor()) };
break;
default:
starControl = new Star()
{ Fill = new SolidColorBrush(RandomColor()) };
break;
}
return starControl;
}
示例9: UpdateStations
public void UpdateStations()
{
double minlon = 12.18;
double minlat = 48.50;
double maxlon = 18.93;
double maxlat = 51.02;
//lat - zespodu - nahoru
//lon - zleva - doprava
double lonC = overlay.Width / (maxlon - minlon);
double latC = overlay.Height / (maxlat - minlat);
double y;
ColorQualityConverter ccq = new ColorQualityConverter();
overlay.Children.Clear();
foreach (Station s in App.ViewModel.Stations)
{
Ellipse el = new Ellipse();
el.Width = 32;
el.Height = 32;
el.Fill = (Brush)ccq.Convert(s.Quality, typeof(Brush), null, null);
if (s.Quality >= 7) el.Opacity = 0.5;
Canvas.SetLeft(el, (s.Position.Longitude - minlon) * lonC);
Canvas.SetTop(el, overlay.Height - ((s.Position.Latitude - minlat) * latC));
overlay.Children.Add(el);
}
}
示例10: 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);
}
}
}
示例11: Block
public Block(Ellipse q1, Ellipse q2, Ellipse q3, Ellipse q4)
{
foo = new Ellipse[4];
foo[0] = q1;
foo[1] = q2;
foo[2] = q3;
foo[3] = q4;
}
示例12: NPCHitAnimation
public NPCHitAnimation(int hitatX, int hitatY)
{
Animations = new List<Shape>();
Ellipse el = new Ellipse();
el.Width = hitatX;
el.Height = hitatY;
Animations.Add(el);
}
示例13: canvas_PointerMoved
private void canvas_PointerMoved(object sender, PointerRoutedEventArgs e)
{
nextPoint = e.GetCurrentPoint(canvas).Position;
//Line l = new Line { X1 = prePoint.X, Y1 = prePoint.Y, X2 = nextPoint.X, Y2 = nextPoint.Y, StrokeThickness=5
// ,Stroke=new SolidColorBrush(Colors.Red )};
Ellipse ellipse = new Ellipse { Width = 100, StrokeThickness = 5, Stroke = new SolidColorBrush(Colors.Red),Fill=new SolidColorBrush(Colors.Yellow )};
canvas.Children.Add(ellipse);
//prePoint = nextPoint;
}
示例14: GetCircle
private static UIElement GetCircle()
{
Ellipse ellipse = new Ellipse();
ellipse.Fill = new SolidColorBrush(Colors.Red);
ellipse.Stroke = new SolidColorBrush(Colors.Red);
ellipse.Width = 50;
ellipse.Height = 50;
return ellipse;
}
示例15: DoDrawEllipse
//draw a ellipse using windows store graphics
protected override void DoDrawEllipse(Point topLeftPoint, Point bottomRightPoint)
{
Windows.UI.Xaml.Shapes.Ellipse ellipse = new Windows.UI.Xaml.Shapes.Ellipse();
ellipse.Fill = new SolidColorBrush(Colors.Blue);
ellipse.Width = bottomRightPoint.X - topLeftPoint.X;
ellipse.Height = bottomRightPoint.Y - topLeftPoint.Y;
Canvas.SetLeft(ellipse, topLeftPoint.X);
Canvas.SetTop(ellipse, topLeftPoint.Y);
_canvas.Children.Add(ellipse);
}