Beispiel #1
0
        private static void CacheInvalidationThresholdMaximumPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            TileBrush target = ((TileBrush)d);


            target.PropertyChanged(RenderOptions.CacheInvalidationThresholdMaximumProperty);
        }
Beispiel #2
0
        private static void ViewportPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            TileBrush target = ((TileBrush)d);


            target.PropertyChanged(ViewportProperty);
        }
Beispiel #3
0
        private static void CachingHintPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            TileBrush target = ((TileBrush)d);


            target.PropertyChanged(RenderOptions.CachingHintProperty);
        }
Beispiel #4
0
        private static void AlignmentYPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            TileBrush target = ((TileBrush)d);


            target.PropertyChanged(AlignmentYProperty);
        }
Beispiel #5
0
        /// <summary>
        /// Construct new SelectionRectVisual object for the given rectangle
        /// </summary>
        public SelectionRectVisual(Point firstPointP, Point secondPointP, double zoomP)
        {
            DrawingGroup drawing = new DrawingGroup();
            DrawingContext context = drawing.Open();
            context.DrawRectangle(Brushes.White, null, new Rect(-1, -1, 3, 3));
            context.DrawRectangle(Brushes.Black, null, new Rect(0.25, -1, 0.5, 3));
            context.Close();
            drawing.Freeze();

            // Create a drawing brush that tiles the unit square from the drawing created above.
            // The size of the viewport and the rotation angle will be updated as we use the
            // dashed pen.
            DrawingBrush drawingBrush = new DrawingBrush(drawing);
            drawingBrush.ViewportUnits = BrushMappingMode.Absolute;
            drawingBrush.Viewport = new Rect(0, 0, _dashRepeatLength, _dashRepeatLength);
            drawingBrush.ViewboxUnits = BrushMappingMode.Absolute;
            drawingBrush.Viewbox = new Rect(0, 0, 1, 1);
            drawingBrush.Stretch = Stretch.Uniform;
            drawingBrush.TileMode = TileMode.Tile;

            // Store the drawing brush and a copy that's rotated by 90 degrees.
            _horizontalDashBrush = drawingBrush;
            _verticalDashBrush = drawingBrush.Clone();
            _verticalDashBrush.Transform = new RotateTransform(90);

            this._firstPoint = firstPointP;
            this._secondPoint = secondPointP;
            this._zoom = zoomP;
            _visualForRect = new DrawingVisual();
            this.AddVisualChild(_visualForRect);
            this.AddLogicalChild(_visualForRect);      
        }
		public void UpdateLayoutPart()
		{
			var brush = ImageHelper.GetResourceBrush(_properties.ReferenceUID, _properties.ImageType);
			if (brush != null)
				brush.Stretch = _properties.Stretch.ToWindowsStretch();
			ImageBrush = brush;
		}
        public TestModelVisual3D()
        {
            _visualChild = new ModelVisual3D();
            Children.Add(_visualChild);

            _realRect3D = new Rect3D(-1, -0.75, -0.5, 2, 1.5, 1);

            TopBrush = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/pz.bmp")));

            UpdateModel();
        }