Exemple #1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="options"></param>
        public void Remove(Options options)
        {
            if (options == null)
                return;

            if (options.PointShape != null)
            {
                Remove(options.PointShape);
            }

            if (options.PointStyle != null)
            {
                Remove(options.PointStyle);
            }

            if (options.SelectionStyle != null)
            {
                Remove(options.SelectionStyle);
            }

            if (options.HelperStyle != null)
            {
                Remove(options.HelperStyle);
            }
        }
Exemple #2
0
        /// <summary>
        /// Opacity %   255 Step        2 digit HEX prefix
        /// 0%          0.00            00
        /// 5%          12.75           0C
        /// 10%         25.50           19
        /// 15%         38.25           26
        /// 20%         51.00           33
        /// 25%         63.75           3F
        /// 30%         76.50           4C
        /// 35%         89.25           59
        /// 40%         102.00          66
        /// 45%         114.75          72
        /// 50%         127.50          7F
        /// 55%         140.25          8C
        /// 60%         153.00          99
        /// 65%         165.75          A5
        /// 70%         178.50          B2
        /// 75%         191.25          BF
        /// 80%         204.00          CC
        /// 85%         216.75          D8
        /// 90%         229.50          E5
        /// 95%         242.25          F2
        /// 100%        255.00          FF
        /// </summary>
        /// <returns></returns>
        public static Options Create()
        {
            var options = new Options()
            {
                SnapToGrid = true,
                SnapX = 15.0,
                SnapY = 15.0,
                HitTreshold = 7.0,
                MoveMode = MoveMode.Point,
                DefaultIsStroked = true,
                DefaultIsFilled = false,
                DefaultIsClosed = true,
                DefaultIsSmoothJoin = true,
                DefaultFillRule = XFillRule.EvenOdd,
                TryToConnect = true
            };

            options.SelectionStyle =
                ShapeStyle.Create(
                    "Selection",
                    0xBF, 0x33, 0x99, 0xFF,
                    0x19, 0x33, 0x99, 0xFF,
                    0.1);

            options.HelperStyle =
                ShapeStyle.Create(
                    "Helper",
                    0xFF, 0x33, 0x99, 0xFF,
                    0xFF, 0x00, 0x00, 0x00,
                    0.1);

            options.PointStyle =
                ShapeStyle.Create(
                    "Point",
                    0xFF, 0x33, 0x99, 0xFF,
                    0xFF, 0x00, 0x00, 0x00,
                    0.1);

            options.PointShape = EllipsePointShape(options.PointStyle);
            return options;
        }