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


C# StrokeCollection.GetBounds方法代码示例

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


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

示例1: Empty_GetBounds

		public void Empty_GetBounds ()
		{
			StrokeCollection sc = new StrokeCollection ();
			Assert.Throws<ArgumentException> (delegate {
				sc.GetBounds ();
			}, "GetBounds");
		}
开发者ID:dfr0,项目名称:moon,代码行数:7,代码来源:StrokeCollectionTest.cs

示例2: InkQueryRegionStruct

        public InkQueryRegionStruct(StrokeCollection strokes)
        {
            _equalStrokes = strokes;
            _children = new VisualCollection(this);

            EqualRect = strokes.GetBounds();
            LeftSideRegionRect = new Rect(new Point(EqualRect.TopLeft.X - EqualRect.Width * 5, EqualRect.TopLeft.Y - EqualRect.Height * 2), new Size(EqualRect.Width * 4, EqualRect.Height * 4));
            RightSideRegionRect = new Rect(new Point(EqualRect.BottomRight.X + EqualRect.Width, EqualRect.BottomRight.Y - EqualRect.Height * 3), new Size(EqualRect.Width * 4, EqualRect.Height * 4));
        }
开发者ID:buptkang,项目名称:LogicPad,代码行数:9,代码来源:InkQueryRegionStruct.cs

示例3: CheckOutputValue

        private void CheckOutputValue(StrokeCollection myStrokes, String recognizedCharacter)
        {
            Rect rect = myStrokes.GetBounds();

            SubCanvasEventArgs args;

            switch(recognizedCharacter)
            {
                case "T":                    
                    args = new SubCanvasEventArgs(LogicCanvasType.TruthTable, rect, myStrokes);
                    OnSubCanvasGenerated(args);
                    break;
                case "e":                  
                    args = new SubCanvasEventArgs(LogicCanvasType.Expression, rect, myStrokes);
                    OnSubCanvasGenerated(args);
                    break;
                case "D":
                    args = new SubCanvasEventArgs(LogicCanvasType.Diagram, rect, myStrokes);
                    OnSubCanvasGenerated(args);           
                    break;
                case "d":
                    args = new SubCanvasEventArgs(LogicCanvasType.Diagram, rect, myStrokes);
                    OnSubCanvasGenerated(args);           
                    break;
                case "=":
                    args = new SubCanvasEventArgs(LogicCanvasType.EqualSign, rect, myStrokes);
                    OnSubCanvasGenerated(args);
                    break;
                case "?":
                    args = new SubCanvasEventArgs(LogicCanvasType.Question, rect, myStrokes);
                    OnSubCanvasGenerated(args);
                    break;
                default:
                    break;
            }
        }
开发者ID:buptkang,项目名称:LogicPad,代码行数:36,代码来源:InkAnalysisFeedbackAdorner.cs

示例4: FreeDrawingMode

        private void FreeDrawingMode(bool doEnter)
        {
            if (doEnter)
            {
                _ink.IsHitTestVisible = true;
                _inkPalette.Visibility = Visibility.Visible;
                _palette.Visibility = Visibility.Hidden;

                //set drawing attributes of current palette owner
                var da = _ink.DefaultDrawingAttributes.Clone();
                da.Width = 4;
                da.Height = 4;
                _inkPalette.OnDrawingStarted();
                da.Color = DaoUtils.UserIdToColor(_palette.GetOwnerId());
                _ink.DefaultDrawingAttributes = da;
            }
            else
            {
                _ink.IsHitTestVisible = false;
                _inkPalette.Visibility = Visibility.Hidden;
                _palette.Visibility = Visibility.Visible;
                _modeMgr.Mode = ShapeInputMode.ManipulationExpected;

                //create free form shape if we have locally created strokes
                var ownColor = DaoUtils.UserIdToColor(_palette.GetOwnerId());

                //while we have been drawing, somebody else could draw and still hasn't finalized drawing, so ink canvas can contain
                //strokes from multiple authors
                var ownStrokes = _ink.Strokes.Where(st => st.DrawingAttributes.Color == ownColor);
                if (ownStrokes.Count() > 0)
                {
                    //don't take cursor for free draw
                    var freeFrmSh =
                        (VdFreeForm) _doc.BeginCreateShape(VdShapeType.FreeForm, 0, 0, false, DocTools.TAG_UNDEFINED);
                    freeFrmSh.locallyJustCreated = true; //enable one-time stroke send
                    var ownStrokeCollection = new StrokeCollection(ownStrokes);
                    freeFrmSh.extractGeomtry(ownStrokeCollection, ownStrokeCollection.GetBounds());

                    //but set focus
                    _doc.VolatileCtx.UnfocusAll();
                    freeFrmSh.SetFocus();

                    //send state update to other clients
                    SendSyncState(freeFrmSh);

                    //remove own strokes
                    var notOwnStrokes = _ink.Strokes.Where(st => st.DrawingAttributes.Color != ownColor);
                    _ink.Strokes = new StrokeCollection(notOwnStrokes);

                    TryEndHostCaption(freeFrmSh, CaptionType.FreeDraw);
                }

                //update ink on other clients
                sendLocalInk();
            }
        }
开发者ID:gdlprj,项目名称:duscusys,代码行数:56,代码来源:SceneManager.cs


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