public void AddFooter(Image footer, FooterPosition position) { int x; switch (position) { case FooterPosition.Right: x = CurrentImage.Width - footer.Width; break; case FooterPosition.Center: x = (CurrentImage.Width / 2) - (footer.Width / 2); break; case FooterPosition.Left: default: x = 0; break; } var newImage = new Bitmap(CurrentImage.Width, CurrentImage.Height + footer.Height); using (var graphics = Graphics.FromImage(newImage)) { SetHighQuality(graphics); graphics.DrawImage(CurrentImage, 0, 0, CurrentImage.Width, CurrentImage.Height); graphics.DrawImage(footer, x, CurrentImage.Height + 1, footer.Width, footer.Height); } CurrentImage.Dispose(); CurrentImage = newImage; }
public override void Assign(DevExpress.Utils.Controls.BaseOptions options) { BeginUpdate(); try { base.Assign(options); GridFooterOnTopOptionsView opt = options as GridFooterOnTopOptionsView; if (opt == null) { return; } this.footerPosition = opt.footerPosition; } finally { EndUpdate(); } }
public GridFooterOnTopOptionsView() : base() { this.footerPosition = FooterPosition.Bottom; }