protected override void OnRender(System.Windows.Media.DrawingContext drawingContext) { if (_image != null) { ImageDecoration profileImage = Visual as ImageDecoration; drawingContext.DrawRoundedRectangle(_imageBrush, _borderPen, _imageRect, profileImage.CornerRadius, profileImage.CornerRadius); } }
protected override void OnRender(System.Windows.Media.DrawingContext drawingContext) { RectangleDeocration profileRectangle = Visual as RectangleDeocration; drawingContext.DrawRoundedRectangle(_fillBrush, _borderPen, _imageRect, profileRectangle.CornerRadius, profileRectangle.CornerRadius); }
protected override void OnRender(System.Windows.Media.DrawingContext drawingContext) { drawingContext.DrawRectangle(new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(0,255, 0, 0)), null, new Rect(RenderSize)); if (this.TextView == null||this.TextView.VisualLinesValid==false) return; foreach (VisualLine l in this.TextView.VisualLines) { if (_break.Contains(l.FirstDocumentLine.LineNumber)) { Point lt = new Point(1, l.VisualTop - this.TextView.VerticalOffset + 1); Point rb = new Point(lt.X + this.RenderSize.Width - 4, lt.Y + l.Height - 2); drawingContext.DrawRoundedRectangle(new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(255, 0, 0)), null, new Rect(lt, rb), (rb.X - lt.X) / 2, (rb.Y - lt.Y) / 2); } } //base.OnRender(drawingContext); }
protected override void OnRender(System.Windows.Media.DrawingContext drawingContext) { double startX = MARGIN_X; double startY = MARGIN_X; switch (this.Location) { case AdornerLocation.TopLeft: startX = MARGIN_X; startY = MARGIN_Y; break; case AdornerLocation.TopRight: startX = this.ActualWidth - MARGIN_X - DIMENSION_X; startY = MARGIN_Y; break; case AdornerLocation.BottomLeft: startX = MARGIN_X; startY = this.ActualHeight - MARGIN_Y - DIMENSION_Y; break; case AdornerLocation.BottomRight: startX = this.ActualWidth - MARGIN_X - DIMENSION_X; startY = this.ActualHeight - MARGIN_Y - DIMENSION_Y; break; } LinearGradientBrush lockRectangleBrush = new LinearGradientBrush(); lockRectangleBrush.StartPoint = new Point(0, 0.4); lockRectangleBrush.EndPoint = new Point(1, 0.6); lockRectangleBrush.GradientStops.Add(new GradientStop(Colors.OrangeRed, 0)); lockRectangleBrush.GradientStops.Add(new GradientStop(Colors.Red, 0.3)); lockRectangleBrush.GradientStops.Add(new GradientStop(Colors.Red, 0.6)); lockRectangleBrush.GradientStops.Add(new GradientStop(Colors.DarkRed, 1)); Pen lockRectanglePen = new Pen(Brushes.DimGray, 0.5); drawingContext.DrawRoundedRectangle(lockRectangleBrush, lockRectanglePen, new Rect(startX + 1, startY, 6, 6), ROUND_CORNER, ROUND_CORNER); }
protected override void OnRender(System.Windows.Media.DrawingContext drawingContext) { if (Behaviour == DockTargetAdornerBehavior.InnerSmall) { //Point center = new Point(RenderSize.Width * 0.5, RenderSize.Height * 0.5); //Rect targetRect = new Rect(center.X - _DockTargetSmallBrush.Width * 0.5, // center.Y - _DockTargetSmallBrush.Height * 0.5, // _DockTargetSmallBrush.Width, // _DockTargetSmallBrush.Height); //drawingContext.DrawImage(_DockTargetSmallBrush, targetRect); //} //if (Behaviour == DockTargetAdornerBehavior.Tab) //{ Rect outerRect = new Rect(AdornedElement.RenderSize); Rect innerRect = new Rect { X = outerRect.X + 6, Y = outerRect.Y + 6, Width = outerRect.Width - 12, Height = outerRect.Height - 12 }; SolidColorBrush outerBrush = new SolidColorBrush(Colors.Gray) { Opacity = 0.5 }; SolidColorBrush innerBrush = new SolidColorBrush(Colors.AliceBlue) { Opacity = 0.5 }; drawingContext.DrawRoundedRectangle(outerBrush, null, outerRect, 2, 2); drawingContext.DrawRectangle(innerBrush, null, innerRect); //base.OnRender(); } }