/*
         * public void SetLinerPoints(Rect rect)
         * {
         *  StartPoint = new Vector2((float)rect.Left, (float)rect.Top);
         *  EndPoint = new Vector2((float)rect.Right, (float)rect.Bottom);
         * }
         */
        public PenModel Copy()
        {
            var pm = new PenModel
            {
                //BrushType = BrushType,

                /*
                 * CanvasColorStops = CanvasColorStops?.Select(ccs => new CanvasGradientStop()
                 * {
                 *  Color = new Color()
                 *  {
                 *      R = ccs.Color.R,
                 *      G = ccs.Color.G,
                 *      A = ccs.Color.A,
                 *      B = ccs.Color.B
                 *  },
                 *  Position = ccs.Position
                 * }).ToArray(),
                 */
                StrokeWidth = StrokeWidth,
                BlurAmount  = BlurAmount,
                Rotation    = Rotation,
                //StartPoint = new Vector2(StartPoint.X, StartPoint.Y),
                //EndPoint = new Vector2(StartPoint.X, StartPoint.Y),

                /*
                 * BlurAmount = new GaussianBlurEffect()
                 * {
                 *  BlurAmount = BlurAmount.BlurAmount,
                 *  BorderMode = BlurAmount.BorderMode,
                 *  BufferPrecision = BlurAmount.BufferPrecision,
                 *  CacheOutput = BlurAmount.CacheOutput,
                 *  Optimization = BlurAmount.Optimization
                 * },*/
                SelectColor = new Color()
                {
                    R = SelectColor.R,
                    G = SelectColor.G,
                    A = SelectColor.A,
                    B = SelectColor.B
                }/*,
                  * StrokeStyle = new CanvasStrokeStyle()
                  * {
                  * CustomDashStyle = (from data in StrokeStyle.CustomDashStyle select data).ToArray(),
                  * DashCap = StrokeStyle.DashCap,
                  * DashOffset = StrokeStyle.DashOffset,
                  * DashStyle = StrokeStyle.DashStyle,
                  * EndCap = StrokeStyle.EndCap,
                  * LineJoin = StrokeStyle.LineJoin,
                  * MiterLimit = StrokeStyle.MiterLimit,
                  * StartCap = StrokeStyle.StartCap,
                  * TransformBehavior = StrokeStyle.TransformBehavior
                  * }
                  */
            };

            pm.StrokeWidth = pm.StrokeWidth;
            return(pm);
        }
 public static InkDrawingAttributes ToInkDrawingAttributes(PenModel pen, XmlDocument xmldoc = null)
 {
     return(new InkDrawingAttributes()
     {
         Size = new Size(pen.StrokeWidth, pen.StrokeWidth),
         Color = pen.SelectColor,
     });
 }
Beispiel #3
0
 public PenModelChangedEventArgs(PenModel pm)
 {
     NewPenModel = pm;
 }