当前位置: 首页>>代码示例>>C#>>正文


C# Shapes.Shape类代码示例

本文整理汇总了C#中System.Windows.Shapes.Shape的典型用法代码示例。如果您正苦于以下问题:C# Shape类的具体用法?C# Shape怎么用?C# Shape使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Shape类属于System.Windows.Shapes命名空间,在下文中一共展示了Shape类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: removeFromBoard

 internal void removeFromBoard(Shape shape)
 {
     if (plane.Children.Contains(shape))
     {
         plane.Children.Remove(shape);
     }
 }
开发者ID:RadoslawRusiniak,项目名称:jnp2c-,代码行数:7,代码来源:Board.cs

示例3: 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

示例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


注:本文中的System.Windows.Shapes.Shape类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。