• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# StrokeCollection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: SelectionMovedOrResizedStroke

		public SelectionMovedOrResizedStroke(CommandStack commandStack, StrokeCollection selection, Rect newrect, Rect oldrect, int editingOperationCount)
			: base(commandStack) {
			_selection = selection;
			_newrect = newrect;
			_oldrect = oldrect;
			_editingOperationCount = editingOperationCount;
		}
开发者ID:paradoxfm,项目名称:ledx2,代码行数:7,代码来源:UndoInkStroke.cs


示例2: CheckOutputValue

 private void CheckOutputValue(Rect rect, String recognizedCharacter, bool isError, StrokeCollection removedStrokes)
 {
     //Check out if it is header box
     if (!_truthTable.IsHeaderBox(rect))
     {
         if (recognizedCharacter.Equals("1") || recognizedCharacter.Equals("l")
             || recognizedCharacter.Equals("|"))
         {
             _truthTable.insertValue(rect, "1");
         }
         else if (recognizedCharacter.Equals("0") || recognizedCharacter.Equals("O"))
         {
             _truthTable.insertValue(rect, "0");
         }
         else
         {
             _truthTable.DisplayInputErrorInfo(rect, removedStrokes);
         }
     }else {
         if (!isError)
         {
             if (_truthTable.default_terms_names.Contains(recognizedCharacter))
             {
                 _truthTable.insertValue(rect, recognizedCharacter);
             }
             else {
                 _truthTable.DisplayInputErrorInfo(rect, removedStrokes);
             }
         }
         else {
             _truthTable.DisplayInputErrorInfo(rect, removedStrokes);
         }      
     }
 }
开发者ID:buptkang,项目名称:LogicPad,代码行数:34,代码来源:InkAnalysisFeedbackAdorner.cs


示例3: SelectionAdorner

 public SelectionAdorner(StrokeCollection selectedStrokes, InkCanvas inkcanvas)
 {
     InitializeComponent();
     referencedStrokes = selectedStrokes;
     referencedCanvas = inkcanvas;
     setupSelectionAdorner();
 }
开发者ID:StackableRegiments,项目名称:metl2011,代码行数:7,代码来源:SelectionAdorner.xaml.cs


示例4: Representation

 public StrokeCollection Representation()
 {
     StrokeCollection strokes = new StrokeCollection();
     foreach (var data in stylusStrokes)
         strokes.Add(data.Representation());
     return strokes;
 }
开发者ID:rudi-c,项目名称:htn-stylus,代码行数:7,代码来源:InkData.cs


示例5: Empty_HitTest

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


示例6: Empty_GetBounds

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


示例7: UserDefinedShape

		public UserDefinedShape()
		{
			if (_strokes == null) {
				_strokes = new StrokeCollection();
			}
			(_strokes as INotifyCollectionChanged).CollectionChanged += StrokesChangedEventHandler;
		}
开发者ID:stewmc,项目名称:vixen,代码行数:7,代码来源:UserDefinedShape.cs


示例8: updateStrokePrivacy

        private void updateStrokePrivacy(object obj)
        {
            ClearAdorners();

            var newStrokes = new StrokeCollection(Strokes.Select(s => (Stroke)new PrivateAwareStroke(s, target)));
            Strokes.Clear();
            Strokes.Add(newStrokes);
        }
开发者ID:StackableRegiments,项目名称:metl2011,代码行数:8,代码来源:HandWriting.cs


示例9: AddAllStrokesAtOriginalIndex

		private void AddAllStrokesAtOriginalIndex(StrokeCollection toBeAdded) {
			foreach (Stroke stroke in toBeAdded) {
				int strokeIndex = (int)stroke.GetPropertyData(STROKE_INDEX_PROPERTY);
				if (strokeIndex > _commandStack.StrokeCollection.Count)
					strokeIndex = _commandStack.StrokeCollection.Count;
				_commandStack.StrokeCollection.Insert(strokeIndex, stroke);
			}
		}
开发者ID:paradoxfm,项目名称:ledx2,代码行数:8,代码来源:UndoInkStroke.cs


示例10: StrokesAddedOrRemovedStroke

		public StrokesAddedOrRemovedStroke(CommandStack commandStack, InkCanvasEditingMode editingMode, StrokeCollection added, StrokeCollection removed, int editingOperationCount)
			: base(commandStack) {
			_editingMode = editingMode;

			_added = added;
			_removed = removed;

			_editingOperationCount = editingOperationCount;
		}
开发者ID:paradoxfm,项目名称:ledx2,代码行数:9,代码来源:UndoInkStroke.cs


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


示例12: StrokeCollectionChangedEventArgs

 /// <summary>Constructor</summary> 
 public StrokeCollectionChangedEventArgs(StrokeCollection added, StrokeCollection removed)
 {
     if ( added == null && removed == null )
     { 
         throw new ArgumentException(SR.Get(SRID.CannotBothBeNull, "added", "removed"));
     } 
     _added = ( added == null ) ? null : new StrokeCollection.ReadOnlyStrokeCollection(added); 
     _removed = ( removed == null ) ? null : new StrokeCollection.ReadOnlyStrokeCollection(removed);
 } 
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:10,代码来源:Events.cs


示例13: DoCommandStack

 /// <summary>
 /// Initialization.
 /// </summary>
 /// <param name="strokes"></param>
 public DoCommandStack(StrokeCollection strokes)
 {
     if (strokes == null)
     {
         return;
     }
     _strokeCollection = strokes;
     _undoStack = new Stack<CommandItem>();
     _redoStack = new Stack<CommandItem>();
     _disableChangeTracking = false;
 }
开发者ID:sonicrang,项目名称:RangPaint,代码行数:15,代码来源:RedoUndo.cs


示例14: RefreshPattern

 public void RefreshPattern()
 {
     if (Pattern != null) {
         StrokeCollection collection = new StrokeCollection();
         for (int i = 0; i < Count; i++) {
             foreach (var stroke in Pattern[i]) {
                 collection.Add(stroke);
             }
         }
         inkPresenter.Strokes = collection;
     }
 }
开发者ID:shadowfox3141,项目名称:HuaZhengZi,代码行数:12,代码来源:InkPattern.xaml.cs


示例15: extractGeomtry

        //local calls only 
        public void extractGeomtry(StrokeCollection strokes, Rect bounds)
        {
            _bounds = bounds;

            _strokes = strokes.Clone();
            foreach (Stroke strk in strokes)
            {                
                var brush = new SolidColorBrush(strk.DrawingAttributes.Color);             
                drawGrp.Children.Add(  new GeometryDrawing( brush, null, strk.GetGeometry())  );
            }

            SetMarkers();
            SetBounds();
        }
开发者ID:gdlprj,项目名称:duscusys,代码行数:15,代码来源:VdFreeForm.cs


示例16: Whiteboard

        public Whiteboard()
        {
            base.CanScale = true;

            _grid = new Grid()
            {
                VerticalAlignment = System.Windows.VerticalAlignment.Stretch,
                Background = new SolidColorBrush(Color.FromArgb(200, 50, 50, 50))
            };
            _grid.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            _grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1, GridUnitType.Star) });
            base.Content = _grid;

            _canvas = new SurfaceInkCanvas()
            {
                Background = new SolidColorBrush(Colors.Black),
                VerticalAlignment = System.Windows.VerticalAlignment.Stretch,
                Margin = new Thickness(12, 0, 12, 12)
            };

            _privateStrokeCollection = _canvas.Strokes;

            Grid.SetRow(_canvas, 1);
            _grid.Children.Add(_canvas);

            StackPanel buttons = new StackPanel()
            {
                Orientation = System.Windows.Controls.Orientation.Horizontal,
                HorizontalAlignment = System.Windows.HorizontalAlignment.Right
            };
            Grid.SetRow(buttons, 0);
            _grid.Children.Add(buttons);

            _eraseButton = new MyButton("Erase.png");
            _eraseButton.SelectedChanged += new EventHandler(_eraseButton_SelectedChanged);
            buttons.Children.Add(_eraseButton);

            _drawButton = new MyButton("167-Painting.png") { IsSelected = true };
            _drawButton.SelectedChanged += new EventHandler(_drawButton_SelectedChanged);
            buttons.Children.Add(_drawButton);

            _typeButton = new SwitchButton("109-AdminUser.png", "108-Group.png")
            {
                Margin = new Thickness(12,0,0,0)
            };
            _typeButton.DisplayedSwitched += new EventHandler(_typeButton_DisplayedSwitched);
            buttons.Children.Add(_typeButton);
        }
开发者ID:sgianelli,项目名称:CoLab,代码行数:48,代码来源:Whiteboard.cs


示例17: StrokestoXML

        public static XElement StrokestoXML(StrokeCollection mystrokes)
        {
            string xmlnsString = "http://schemas.microsoft.com/client/2007";

            XNamespace xmlns = xmlnsString;
            XElement XMLStrokes = new XElement(xmlns + "StrokeCollection",
                new XAttribute("xmlns", xmlnsString));

            //create stroke, then add to collection element
            XElement mystroke;
            foreach (Stroke s in mystrokes)
            {
                mystroke = new XElement(xmlns + "Stroke",
                  new XElement(xmlns + "Stroke.DrawingAttributes",
                    new XElement(xmlns + "DrawingAttributes",
                       new XElement("Color",
                                new XAttribute("A", s.DrawingAttributes.Color.A),
                                new XAttribute("R", s.DrawingAttributes.Color.R),
                                new XAttribute("G", s.DrawingAttributes.Color.G),
                                new XAttribute("B", s.DrawingAttributes.Color.B)
                            ),
                       new XElement("OutlineColor",
                                new XAttribute("A", s.DrawingAttributes.OutlineColor.A),
                                new XAttribute("R", s.DrawingAttributes.OutlineColor.R),
                                new XAttribute("G", s.DrawingAttributes.OutlineColor.G),
                                new XAttribute("B", s.DrawingAttributes.OutlineColor.B)
                            ),
                       new XAttribute("Width", s.DrawingAttributes.Width),
                       new XAttribute("Height", s.DrawingAttributes.Height))));

                //create points separately then add to mystroke XElement
                XElement myPoints = new XElement(xmlns + "Stroke.StylusPoints");
                foreach (StylusPoint sp in s.StylusPoints)
                {
                    XElement mypoint = new XElement(xmlns + "StylusPoint",
                      new XAttribute("X", sp.X.ToString()),
                      new XAttribute("Y", sp.Y.ToString()));
                    //add the new point to the points collection of the stroke
                    myPoints.Add(mypoint);
                }
                //add the new points collection to the stroke
                mystroke.Add(myPoints);
                //add the stroke to the collection
                XMLStrokes.Add(mystroke);
            }
            return XMLStrokes;
        }
开发者ID:disbitski,项目名称:DoodlePad,代码行数:47,代码来源:XMLHelpers.cs


示例18: StrokesToBase64

 public string StrokesToBase64(StrokeCollection inkStrokes)
 {
     try
     {
         using (MemoryStream ms = new MemoryStream())
         {
             // Save strokes from InkCanvas to a stream as ISF.
             inkStrokes.Save(ms);
             // Convert bytes from stream to Base64 text.
             byte[] isfBytes = ms.ToArray();
             return Convert.ToBase64String(isfBytes,
                    Base64FormattingOptions.InsertLineBreaks);
         }
     }
     catch
     {
         return "";
     }
 }
开发者ID:smallcube,项目名称:EHealthCarePatientApp,代码行数:19,代码来源:InkCanvasHelper.cs


示例19: GetStrokeCollectionFromPoints

        private StrokeCollection GetStrokeCollectionFromPoints(dynamic strokePoints)
        {
            var strokeCollection = new StrokeCollection();

            foreach (var stroke in strokePoints.Strokes)
            {
                var points = new StylusPointCollection();

                foreach (var point in stroke.Points)
                {
                    var x = (float)point.X;
                    var y = (float)point.Y;

                    points.Add(new StylusPoint(x, y));
                }

                strokeCollection.Add(new Stroke(points));
            }

            return strokeCollection;
        }
开发者ID:brenoferreira,项目名称:Canvas-Handwriting-Recognition,代码行数:21,代码来源:RecognitionController.cs


示例20: Convert

 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     var strokeCollection = new StrokeCollection();
     var inkData = value as byte[];
     if (inkData != null)
     {
         Stream strokesStream = StreamHelper.FromArray(inkData);
         if (strokesStream != null && strokesStream.Length > 1)
         {
             strokesStream.Seek(0, 0);
             try
             {
                 strokeCollection = new StrokeCollection(strokesStream);
             }
             catch
             {
             }
         }
     }
     return strokeCollection;
 }
开发者ID:RookieOne,项目名称:XPS-Generation,代码行数:21,代码来源:InkDataToStrokeCollectionConverter.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Struct类代码示例发布时间:2022-05-24
下一篇:
C# Stroke类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap