本文整理汇总了C#中System.Windows.Shapes.Shape类的典型用法代码示例。如果您正苦于以下问题:C# Shape类的具体用法?C# Shape怎么用?C# Shape使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Shape类属于System.Windows.Shapes命名空间,在下文中一共展示了Shape类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnApplyTemplate
/// <summary>
/// This gets called when the template has been applied and we have our visual tree
/// </summary>
public override void OnApplyTemplate()
{
m_paintArea = Template.FindName("PART_PaintArea", this) as Shape;
m_mainContent = Template.FindName("PART_MainContent", this) as ContentPresenter;
base.OnApplyTemplate();
}
开发者ID:guipasmoi,项目名称:MangaTracker,代码行数:10,代码来源:AnimatedContentControl.cs
示例2: rect1_MouseDown
private void rect1_MouseDown(object sender, MouseButtonEventArgs e)
{
Shape s = (Shape)sender;
startx = Canvas.GetLeft(s);
starty = Canvas.GetTop(s);
s.MouseMove += rect1_MouseMove;
s.CaptureMouse();
e.Handled = true;
Point p = e.GetPosition((IInputElement)canvas1);
deltax = p.X - Canvas.GetLeft(s);
deltay = p.Y - Canvas.GetTop(s);
if (last != null)
{
if (last.Effect != null)
{
last.Effect = null;
Canvas.SetZIndex(last, 0);
}
}
last = s;
DropShadowEffect ef = new DropShadowEffect();
ef.Color = Colors.Red;
ef.BlurRadius = 30;
ef.ShadowDepth = 0;
s.Effect = ef;
Canvas.SetZIndex(last, 10);
}
开发者ID:tpsa,项目名称:pwsg,代码行数:27,代码来源:MainWindow.xaml.cs
示例3: removeFromBoard
internal void removeFromBoard(Shape shape)
{
if (plane.Children.Contains(shape))
{
plane.Children.Remove(shape);
}
}
开发者ID:RadoslawRusiniak,项目名称:jnp2c-,代码行数:7,代码来源:Board.cs
示例4: setOnBoard
internal void setOnBoard(Shape shape, Point position)
{
removeFromBoard(shape);
Canvas.SetLeft(shape, position.X);
Canvas.SetTop(shape, position.Y);
plane.Children.Add(shape);
}
开发者ID:RadoslawRusiniak,项目名称:jnp2c-,代码行数:7,代码来源:Board.cs
示例5: Control_MouseDown
private void Control_MouseDown(object sender, MouseButtonEventArgs e)
{
var shape = (sender as Shape);
if (shape.Name.Contains("Play"))
{
mouseUpBrush = elPlay.Fill;
mouseUpEllipse = elPlay;
elPlay.OpacityMask = pathPlay.OpacityMask = Brushes.Black;
elPlay.Fill = Brushes.Blue;
}
if (shape.Name.Contains("Stop"))
{
mouseUpBrush = elStop.Fill;
mouseUpEllipse = elStop;
elStop.OpacityMask = pathStop.OpacityMask = Brushes.Black;
elStop.Fill = Brushes.Blue;
}
if (shape.Name.Contains("Pause"))
{
mouseUpBrush = elPause.Fill;
mouseUpEllipse = elPause;
elPause.OpacityMask = pathPause.OpacityMask = Brushes.Black;
elPause.Fill = Brushes.Blue;
}
}
开发者ID:A-n-d-r-e-y,项目名称:VISLAB,代码行数:29,代码来源:PlayerControl.xaml.cs
示例6: Stand
public Stand(int _ID, String _Name, String _Info, Shape _Shape)
{
ST_ID = _ID;
ST_Name = _Name;
ST_Info = _Info;
ST_Shape = _Shape;
}
开发者ID:Joniras,项目名称:Tatue-Organiser,代码行数:7,代码来源:Stand.cs
示例7: Add
public void Add(Shape Bob)
{
Bob.MouseLeftButtonDown += new MouseButtonEventHandler(Bob_MouseLeftButtonDown);
Bob.MouseLeftButtonUp += new MouseButtonEventHandler(Bob_MouseLeftButtonUp);
Bob.MouseMove += new MouseEventHandler(Bob_MouseMove);
_shapes.Add(Bob);
}
开发者ID:lostbearlabs,项目名称:lostbearlabs.github.io,代码行数:8,代码来源:ShapeManager.cs
示例8: ReceiveObject
public virtual void ReceiveObject(object obj)
{
if (obj is Shape)
{
_symbolShape = obj as Shape;
UpdateSymbolShape();
}
}
开发者ID:Esri,项目名称:arcgis-viewer-silverlight,代码行数:8,代码来源:ShapeMarkerSymbol.cs
示例9: Rondje
public Rondje(double x, double y, double width, double height, Shape Rondje)
{
this.height = height;
this.x = x;
this.y = y;
this.width = width;
this.Graphics = Rondje;
}
开发者ID:hen31,项目名称:DEP,代码行数:8,代码来源:Ellipse.cs
示例10: SetStyle
public static void SetStyle(Shape shape, ElementBase element)
{
shape.Fill = new SolidColorBrush(element.BackgroundColor);
shape.Stroke = new SolidColorBrush(element.BorderColor);
shape.StrokeThickness = element.BorderThickness;
if (element.BackgroundPixels != null)
shape.Fill = PainterHelper.CreateBrush(element.BackgroundPixels);
}
开发者ID:hjlfmy,项目名称:Rubezh,代码行数:8,代码来源:PainterHelper.cs
示例11: OnApplyTemplate
public override void OnApplyTemplate()
{
stateIndicator = GetTemplateChild("PART_StateIndicator") as Shape;
if (stateIndicator != null)
{
stateIndicator.SetBinding(Shape.FillProperty, new Binding("State") { Converter = StateConverter, Source = this });
}
}
开发者ID:karl-barkmann,项目名称:LeenLeen,代码行数:8,代码来源:MultipeStateControl.cs
示例12: ConfiguraComponenteVisualArticulacao
private void ConfiguraComponenteVisualArticulacao(Shape forma, int diametroArticulacao, int larguraDesenho, Brush corDesenho)
{
forma.Height = diametroArticulacao;
forma.Width = diametroArticulacao;
forma.StrokeThickness = larguraDesenho;
forma.Stroke = corDesenho;
}
开发者ID:jorgeLuizChaves,项目名称:MSKinect,代码行数:8,代码来源:EsqueletoUsuarioAuxiliar.cs
示例13: Vierkant
public Vierkant(double x, double y, double width, double height, Shape rectangle)
{
this.height = height;
this.x = x;
this.y = y;
this.width = width;
this.Graphics = rectangle;
}
开发者ID:hen31,项目名称:DEP,代码行数:8,代码来源:Rectangle.cs
示例14: ConfigurarComponenteVisualArticulacao
private void ConfigurarComponenteVisualArticulacao(Shape pForma, int pDiametroArticulacao,
int pLarguraDesenho, Brush pCorDesenho, bool pPreencheComGradiente, bool pColorirGradienteMesmaCorDoPincel)
{
pForma.Height = pDiametroArticulacao;
pForma.Width = pDiametroArticulacao;
pForma.StrokeThickness = pLarguraDesenho;
if (pPreencheComGradiente)
{
pForma.Stroke = Brushes.Black;
RadialGradientBrush lGradiente = new RadialGradientBrush();
lGradiente.GradientOrigin = new Point(0.5, 0.5);
lGradiente.Center = new Point(0.5, 0.5);
lGradiente.RadiusX = 0.5;
lGradiente.RadiusY = 0.5;
Color lCor1;
Color lCor2;
if (pColorirGradienteMesmaCorDoPincel)
{
if (pCorDesenho == Brushes.Green)
{
lCor1 = Colors.Lime;
lCor2 = Colors.DarkGreen;
}
else if (pCorDesenho == Brushes.Blue)
{
lCor1 = Colors.RoyalBlue;
lCor2 = Colors.DarkBlue;
}
else
{
lCor1 = Colors.OrangeRed;
lCor2 = Colors.DarkRed;
}
}
else
{
lCor1 = Colors.OrangeRed;
lCor2 = Colors.DarkRed;
}
//lCor1 = Colors.Lime;
//lCor2 = Colors.DarkGreen;
lGradiente.GradientStops.Add(new GradientStop(lCor1, 0.5));
lGradiente.GradientStops.Add(new GradientStop(lCor2, 1));
pForma.Fill = lGradiente;
}
else
{
pForma.Stroke = pCorDesenho;
}
}
开发者ID:nunesrenato86,项目名称:TCC,代码行数:58,代码来源:EsqueletoUsuarioAuxiliar.cs
示例15: areColliding
public bool areColliding(Shape shape1, Point position1, Shape shape2, Point position2)
{
if (Math.Pow(position1.X - position2.X, 2) + Math.Pow(position1.Y - position2.Y, 2)
<= Math.Pow((shape1.Width + shape2.Width) / 2, 2))
{
return true;
}
return false;
}
开发者ID:RadoslawRusiniak,项目名称:jnp2c-,代码行数:9,代码来源:Board.cs
示例16: ShapeElement
/// <summary>${WP_mapping_ShapeElement_Constructors_D}</summary>
protected ShapeElement(Shape shape)
{
shape.Stretch = Stretch.None;
shape.RenderTransform = new ScaleTransform();
base.Content = this.shape = shape;
pathIsInvalid = true;
this.ClipBox = Rectangle2D.Empty;
}
开发者ID:SuperMap,项目名称:iClient-for-Win8,代码行数:10,代码来源:ShapeElement.cs
示例17: PathPoint
public PathPoint(Point point, Object @object, Object parentObject, Action<Point> setLambda, Action save, Shape shape)
{
this._point = point;
this._setLambda = setLambda;
this.Object = @object;
this.ParentObject = parentObject;
this._shape = shape;
this._save = save;
}
开发者ID:modulexcite,项目名称:WpfDesigner,代码行数:9,代码来源:PathHandlerExtension.cs
示例18: ShapeCursorTarget
public ShapeCursorTarget(Shape shape, Canvas canvas, Point center, int width, int height)
{
this.canvas = canvas;
this.Shape = shape;
this.Shape.Fill = this.NonSelectedFill = Brushes.DarkBlue;
this.Shape.Stroke = this.NonSelectedStroke = Brushes.WhiteSmoke;
this.SelectedFill = Brushes.OrangeRed;
this.SelectedStroke = Brushes.OrangeRed;
SetBounds(center, width, height);
}
开发者ID:dandelarosa,项目名称:KinectGestureDectection,代码行数:10,代码来源:ShapeCursorTarget.cs
示例19: MoveShapeAdorner
public MoveShapeAdorner(Canvas canvas, Shape adornedElement)
: base(adornedElement)
{
Point point = Mouse.GetPosition(adornedElement);
mouseLeft = point.X;
mouseTop = point.Y;
this.canvas = canvas;
canvas.MouseMove += new System.Windows.Input.MouseEventHandler(Canvas_MouseMove);
}
开发者ID:mkandroid15,项目名称:Samples,代码行数:10,代码来源:MoveShapeAdorner.cs
示例20: edge_view
public edge_view(graph_view _graph, node_view from_node, node_view to_node, string weight)
{
this._graph = _graph;
if (from_node != to_node)
{
Line = new Line();
Line.MouseEnter += new MouseEventHandler(Line_MouseEnter);
Line.MouseLeave += new MouseEventHandler(Line_MouseLeave);
Line.MouseLeftButtonDown += new MouseButtonEventHandler(Line_MouseLeftButtonDown);
Line.Stroke = Brushes.Black;
Line.StrokeThickness = 1;
((Line)Line).X1 = 0;
((Line)Line).Y1 = 0;
LeftLine = new Line();
RightLine = new Line();
RightLine.Stroke = LeftLine.Stroke = Brushes.Black;
RightLine.StrokeThickness = LeftLine.StrokeThickness = 6;
_graph.GRCanvas.Children.Add(LeftLine);
_graph.GRCanvas.Children.Add(RightLine);
if (Lines == null)
{
Lines = new List<Shape>();
Lines.Add(Line);
Lines.Add(LeftLine);
Lines.Add(RightLine);
}
textBox1 = new TextBox();
textBox1.Width = 50;
br = new SolidColorBrush(Colors.Transparent);
textBox1.BorderBrush = br;
textBox1.VerticalContentAlignment = VerticalAlignment.Center;
textBox1.HorizontalContentAlignment = HorizontalAlignment.Center;
textBox1.FontSize = 14;
TxtBox1_TextChanged(null, null);
textBox1.PreviewMouseLeftButtonDown += new MouseButtonEventHandler(TxtBox1_PreviewMouseLeftButtonDown);
textBox1.TextChanged += new TextChangedEventHandler(TxtBox1_TextChanged);
textBox1.Text = weight;
edge_weight = int.Parse(textBox1.Text);
opaqueBrush = new SolidColorBrush(Colors.Black);
opaqueBrush.Opacity = 0;
textBox1.Background = opaqueBrush;
_graph.GRCanvas.Children.Add(textBox1);
_graph.GRCanvas.Children.Add(Line);
Canvas.SetZIndex(Line, 0);
Canvas.SetZIndex(textBox1, 2);
this.from_node = from_node;
this.to_node = to_node;
to_node.pointPositionChange += new graph_view.PointPositionChanged(OnPointPositionChanged);
from_node.pointPositionChange += new graph_view.PointPositionChanged(OnPointPositionChanged);
OnPointPositionChanged(to_node);
OnPointPositionChanged(from_node);
}
else
MessageBox.Show("Граф задачі має бути ациклічним!");
}
开发者ID:EmporioVento,项目名称:VSAS,代码行数:55,代码来源:edge_view.cs
注:本文中的System.Windows.Shapes.Shape类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论