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


C# Rectangle.SetValue方法代码示例

本文整理汇总了C#中Rectangle.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# Rectangle.SetValue方法的具体用法?C# Rectangle.SetValue怎么用?C# Rectangle.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Rectangle的用法示例。


在下文中一共展示了Rectangle.SetValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreatePart

        /// <summary>
        /// Create a visual for single Series Part
        /// </summary>
        /// <returns>
        /// UIElement
        /// </returns>
        public override UIElement CreatePart()
        {
            Rect rect = new Rect(new Point(X1, Y1), new Point(X2, Y2));
            RectPart = new Rectangle {Height = rect.Height, Width = rect.Width};
            RectPart.SetValue(Canvas.LeftProperty, rect.X);
            RectPart.SetValue(Canvas.TopProperty, rect.Y);

            SetBindingForStrokeandStrokeThickness(RectPart);
            return RectPart;
        }
开发者ID:jcw-,项目名称:sparrowtoolkit,代码行数:16,代码来源:ColumnPart.cs

示例2: MonitorControl

        public void MonitorControl(Panel panel)
        {
            Monitor = new Rectangle {Fill = new SolidColorBrush(Color.FromArgb(0, 0, 0, 0))};
            Monitor.SetValue(Grid.RowSpanProperty, int.MaxValue - 1);
			Monitor.SetValue(Grid.ColumnSpanProperty, int.MaxValue - 1);

#if WINDOWS_STORE || WINDOWS_PHONE_APP
            Monitor.PointerPressed += Monitor_PointerPressed;
            Monitor.PointerReleased += Monitor_PointerReleased;
            Monitor.PointerMoved += Monitor_PointerMoved;
#elif WINDOWS_PHONE
            Monitor.ManipulationStarted += MonitorManipulationStarted;
            Monitor.ManipulationDelta += MonitorManipulationDelta;
#endif
            panel.Children.Add(Monitor);
        }
开发者ID:selaromdotnet,项目名称:Coding4FunToolkit,代码行数:16,代码来源:MovementMonitor.cs

示例3: NOPH_Graphics_fillRect

    public static void NOPH_Graphics_fillRect(int __graphics, int x, int y, int width, int height)
    {
        int copy_graphics, copy_x, copy_y, copy_width, copy_height;
        copy_graphics = __graphics; copy_x = x; copy_y = y; copy_width = width; copy_height = height;
        Color curr_pen = curr_color;

        //mre.Reset();

        System.Windows.Deployment.Current.Dispatcher.BeginInvoke(() =>
        {

            if (copy_x == 0 && copy_y == 0 && copy_width == FreeMapMainScreen.get().getVisibleWidth() && copy_height == FreeMapMainScreen.get().getVisibleHeight())
            {
                children_list.Clear();
            }

            Canvas graphics = (Canvas)CRunTime.objectRepository[copy_graphics];

            Rectangle r = new Rectangle();
            r.SetValue(Canvas.LeftProperty, (double)copy_x);
            r.SetValue(Canvas.TopProperty, (double)copy_y);
            r.SetValue(Canvas.HeightProperty, (double)copy_height);
            r.SetValue(Canvas.WidthProperty, (double)copy_width);
            r.Fill = new SolidColorBrush(curr_pen);
            children_list.Add(r);
            //mre.Set();
        });
        //mre.WaitOne();
    }
开发者ID:meniz,项目名称:WazeWP7,代码行数:29,代码来源:Syscalls.cs

示例4: Board_SizeChanged

 private void Board_SizeChanged(object sender, SizeChangedEventArgs e)
 {
     Board.Children.Clear();
     double wi = Board.ActualHeight / 12;
     for (int x=0;x<12;x++)
     {
         for (int y=0;y<12;y++)
         {
             double top, left;
             top = y * wi;
             left = x * wi;
             Rectangle rect = new Rectangle();
             rect.Width = rect.Height = wi;
             rect.SetValue(Canvas.TopProperty, top);
             rect.SetValue(Canvas.LeftProperty, left);
             rect.Fill = Brushes.White;
             if ((x+y)%2==0)
             {
                 rect.Fill = Brushes.Gray;
             }
             Board.Children.Add(rect);
         }
     }
     for(int i=0;i<12;i++)
     {
         for(int j=0;j<12;j++)
         {
             if(banco[i,j]==1)
             {
                 drawelip(i, j, Brushes.Red);
             }
             else if(banco[i,j]==2)
             {
                 drawelip(i, j, Brushes.Blue);
             }
         }
     }
 }
开发者ID:Kieukhanhnguyen,项目名称:Gomoku,代码行数:38,代码来源:MainWindow.xaml.cs


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