protected override void OnPaint(PaintEventArgs e) { Graphics g = e.Graphics; g.Clear(Color.White); if (_bitmap != null) { g.DrawImage(_bitmap, 0, 0); } ThumbUtil.DrawBitmapRect(g, this, _thumbResult); base.OnPaint(e); }
public override void OnPaint(Graphics graphics) { base.OnPaint(graphics); if (_bitmap == null && CellData.Value != null) { ReloadBitmap(); } int thumbX = Bounds.X + ((Bounds.Width / 2) - (ThumbUtil.ThumbWidth / 2)); int thumbY = Bounds.Y + ((Bounds.Height / 2) - (ThumbUtil.ThumbHeight / 2)); if (_bitmap != null) { graphics.DrawImage(_bitmap, thumbX, thumbY); } else { var brsh = new SolidBrush(Color.White); graphics.FillRectangle(brsh, new Rectangle(thumbX, thumbY, Width, Height)); brsh.Dispose(); } ThumbUtil.DrawBitmapRect(graphics, this, CellFFmpegResult, thumbX, thumbY); }