當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。