Exemplo n.º 1
0
        static FeedbackHelper()
        {
            FeedbackHelper.DefaultAdornerBrush.Freeze();
            FeedbackHelper.DefaultThinPen = new Pen((Brush)Brushes.CornflowerBlue, 1.0);
            FeedbackHelper.DefaultThinPen.Freeze();
            FeedbackHelper.DefaultMediumPen = new Pen((Brush)Brushes.CornflowerBlue, 2.0);
            FeedbackHelper.DefaultMediumPen.Freeze();
            FeedbackHelper.DefaultThickPen = new Pen((Brush)Brushes.CornflowerBlue, 3.0);
            FeedbackHelper.DefaultThickPen.Freeze();
            FeedbackHelper.InactiveBrush = (Brush) new SolidColorBrush(Color.FromArgb(byte.MaxValue, (byte)150, (byte)150, (byte)150));
            FeedbackHelper.InactiveBrush.Freeze();
            FeedbackHelper.InactiveThinPen = new Pen(FeedbackHelper.InactiveBrush, 1.0);
            FeedbackHelper.InactiveThinPen.Freeze();
            FeedbackHelper.MultipleElementThinPen = new Pen((Brush)Brushes.CornflowerBlue, 1.0);
            FeedbackHelper.MultipleElementThinPen.Freeze();
            FeedbackHelper.MultipleElementMediumPen = new Pen((Brush)Brushes.CornflowerBlue, 2.0);
            FeedbackHelper.MultipleElementMediumPen.Freeze();
            FeedbackHelper.ClipPathBrush = (Brush) new SolidColorBrush(Color.FromArgb(byte.MaxValue, (byte)173, (byte)42, (byte)140));
            FeedbackHelper.ClipPathBrush.Freeze();
            FeedbackHelper.ClipPathThinPen = new Pen(FeedbackHelper.ClipPathBrush, 1.0);
            FeedbackHelper.ClipPathThinPen.Freeze();
            FeedbackHelper.ClipPathThickPen = new Pen(FeedbackHelper.ClipPathBrush, 3.0);
            FeedbackHelper.ClipPathThickPen.Freeze();
            FeedbackHelper.MotionPathThinPen = new Pen((Brush)Brushes.CornflowerBlue, 1.0);
            FeedbackHelper.MotionPathThinPen.Freeze();
            FeedbackHelper.WhiteBrush = (Brush) new SolidColorBrush(Color.FromArgb(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue));
            FeedbackHelper.WhiteBrush.Freeze();
            FeedbackHelper.MotionPathSegmentThinPen           = new Pen((Brush)Brushes.CornflowerBlue, 1.0);
            FeedbackHelper.MotionPathSegmentThinPen.DashStyle = new DashStyle((IEnumerable <double>) new double[2]
            {
                6.0,
                6.0
            }, 1.0);
            FeedbackHelper.MotionPathSegmentThinPen.Freeze();
            FeedbackHelper.MotionPathThickPen = new Pen((Brush)Brushes.CornflowerBlue, 3.0);
            FeedbackHelper.MotionPathThickPen.Freeze();
            FeedbackHelper.MotionPathSegmentThickPen           = new Pen((Brush)Brushes.CornflowerBlue, 3.0);
            FeedbackHelper.MotionPathSegmentThickPen.DashStyle = new DashStyle((IEnumerable <double>) new double[2]
            {
                2.0,
                2.0
            }, 1.0);
            FeedbackHelper.MotionPathSegmentThickPen.Freeze();
            FeedbackHelper.DefaultThinPenZoomCache = new PenZoomCache(FeedbackHelper.GetThinPen(AdornerType.Default));
            DrawingGroup   drawingGroup   = new DrawingGroup();
            DrawingContext drawingContext = drawingGroup.Open();

            drawingContext.DrawRectangle((Brush)Brushes.White, (Pen)null, new Rect(-1.0, -1.0, 3.0, 3.0));
            drawingContext.DrawRectangle((Brush)Brushes.Black, (Pen)null, new Rect(0.25, -1.0, 0.5, 3.0));
            drawingContext.Close();
            drawingGroup.Freeze();
            DrawingBrush drawingBrush = new DrawingBrush((Drawing)drawingGroup);

            drawingBrush.ViewportUnits                 = BrushMappingMode.Absolute;
            drawingBrush.Viewport                      = new Rect(0.0, 0.0, 8.0, 8.0);
            drawingBrush.ViewboxUnits                  = BrushMappingMode.Absolute;
            drawingBrush.Viewbox                       = new Rect(0.0, 0.0, 1.0, 1.0);
            drawingBrush.Stretch                       = Stretch.Uniform;
            drawingBrush.TileMode                      = TileMode.Tile;
            FeedbackHelper.horizontalDashBrush         = (TileBrush)drawingBrush;
            FeedbackHelper.verticalDashBrush           = (TileBrush)drawingBrush.Clone();
            FeedbackHelper.verticalDashBrush.Transform = (Transform) new RotateTransform(90.0);
        }
Exemplo n.º 2
0
 public static Brush GetActiveBrush()
 {
     return(FeedbackHelper.GetActiveBrush(AdornerType.Default));
 }