Windows.UI.Input.Inking.InkStroke.Clone C# (CSharp) 메소드

Clone() 공개 메소드

public Clone ( ) : InkStroke
리턴 InkStroke
		public extern InkStroke Clone();
	}

Usage Example

        public void SyncStroke(InkStrokeContainer containner,double currentCanvasWidth,bool syncAll = true, InkStroke stroke = null)
        {
            lock(locker)
            {
                try
                {
                    if (syncAll)
                    {
                        Strokes.Clear();
                        foreach (var item in containner.GetStrokes())
                        {
                            InkStroke strokeClone = item.Clone();
                            strokeClone.PointTransform = System.Numerics.Matrix3x2.CreateScale((float)(currentCanvasWidth / originalCanvasWidth));
                            Strokes.Add(strokeClone);
                        }
                    }
                    else
                    {
                        if (null != stroke)
                        {
                            InkStroke strokeClone = stroke.Clone();
                            strokeClone.PointTransform = System.Numerics.Matrix3x2.CreateScale((float)(currentCanvasWidth / originalCanvasWidth));
                            Strokes.Add(strokeClone);
                        }
                        else
                        {
                            containner.Clear();
                            foreach (var item in Strokes)
                            {
                                InkStroke strokeClone = item.Clone();
                                strokeClone.PointTransform = System.Numerics.Matrix3x2.CreateScale((float)(currentCanvasWidth / originalCanvasWidth));
                                containner.AddStroke(strokeClone);
                            }
                        }
                    }
                }
                catch(Exception e)
                {
#if DEBUG
                    System.Diagnostics.Debug.WriteLine(e.Message);

#endif
                }                           
            }
        }