public override void Paint(System.Drawing.Graphics g) { base.Paint(g); float f1 = Width * 2 / 3; System.Drawing.RectangleF r1 = new System.Drawing.RectangleF(this.Rectangle.Location, new System.Drawing.SizeF(f1, this.Rectangle.Height * 3 / 5)); System.Drawing.RectangleF r2 = new System.Drawing.RectangleF(new PointF(this.Rectangle.X, this.Rectangle.Y + this.Height * 2 / 5), new System.Drawing.SizeF(f1, this.Height * 3 / 5)); System.Drawing.RectangleF r3= new System.Drawing.RectangleF(new PointF(this.Rectangle.X+this.Width/3, this.Rectangle.Y + this.Height * 1 / 5), new System.Drawing.SizeF(f1, this.Height * 3 / 5)); GraphicsContainer gc = g.BeginContainer(Rectangle,Rectangle,GraphicsUnit.Pixel); g.SmoothingMode = SmoothingMode.HighQuality; g.Transform = GetTransForm(); g.DrawEllipse(this.Pen, r1); g.DrawEllipse(this.Pen, r2); g.DrawEllipse(this.Pen, r3); g.EndContainer(gc); }
protected override void Paint(System.Drawing.Graphics graphics, System.Drawing.Rectangle clipBounds, System.Drawing.Rectangle cellBounds, int rowIndex, DataGridViewElementStates cellState, object value, object formattedValue, string errorText, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts) { base.Paint(graphics, clipBounds, cellBounds, rowIndex, cellState, value, formattedValue, errorText, cellStyle, advancedBorderStyle, paintParts); if (this.Icon != null) { System.Drawing.Drawing2D.GraphicsContainer container = graphics.BeginContainer(); graphics.SetClip(cellBounds); // Point p = new Point(); p = cellBounds.Location; p.Offset(iconLeftPad, iconTopPad); graphics.DrawImageUnscaled(this.Icon, p); graphics.EndContainer(container); } }
/// <summary> /// Paints the entity using the given graphics object /// </summary> /// <param name="g"></param> public override void Paint(System.Drawing.Graphics g) { if (!Visible) return; //g.DrawRectangle(Pens.OrangeRed, Rectangle); GraphicsContainer cto = g.BeginContainer(); g.SetClip(Shape.Rectangle); plusminus.Paint(g); header.Paint(g); if (!mCollapsed && mShowLines) { g.DrawLine( ArtPalette.FolderLinesPen, Rectangle.X + 7, plusminus.Rectangle.Bottom, Rectangle.X + 7, plusminus.Rectangle.Bottom + mEntries.Count * (ItemHeight + ItemSpacing)); } int k = 1; foreach (IShapeMaterial material in mEntries) { material.Paint(g); if (!mCollapsed && mShowLines) { g.DrawLine( ArtPalette.FolderLinesPen, Rectangle.X + 7, plusminus.Rectangle.Bottom + k * (ItemHeight + ItemSpacing), Rectangle.X + 16, plusminus.Rectangle.Bottom + k * (ItemHeight + ItemSpacing)); k++; } } g.EndContainer(cto); }