private void PaintExtensionsFill(IGraphics graphics, FillPrimitive titleBarFill) { this.ribbonCaptionFillBitmap = titleBarFill.GetAsBitmap(Brushes.Transparent, 0.0f, new SizeF(1f, 1f)); if (this.ribbonCaptionFillBitmap == null) { return; } Point location = titleBarFill.ControlBoundingRectangle.Location; location.Offset(new Point(0, 1)); graphics.DrawBitmap((Image)this.ribbonCaptionFillBitmap, location.X, location.Y, this.Size.Width, titleBarFill.ControlBoundingRectangle.Height); this.ribbonCaptionFillBitmap.Dispose(); }
public override void PaintValue(PaintValueEventArgs e) { if (e.Value != null && e.Value is FillPrimitive) { FillPrimitive fill = (e.Value as FillPrimitive); using (Brush b = new SolidBrush(Color.Transparent)) { Bitmap bmp = fill.GetAsBitmap(b, 0f, new SizeF(1, 1)); if (bmp != null) { e.Graphics.DrawImage(bmp, e.Bounds); bmp.Dispose(); } } } }