예제 #1
0
        /*
         * 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);
        }
예제 #2
0
 public static InkDrawingAttributes ToInkDrawingAttributes(PenModel pen, XmlDocument xmldoc = null)
 {
     return(new InkDrawingAttributes()
     {
         Size = new Size(pen.StrokeWidth, pen.StrokeWidth),
         Color = pen.SelectColor,
     });
 }
예제 #3
0
 public PenModelChangedEventArgs(PenModel pm)
 {
     NewPenModel = pm;
 }