public void DrawImage(Graphics g, Rectangle destRect) { if (Image == null) { return; } DrawUtil.DrawImage(g, Image, destRect, SizeMode, StretchMargins); }
protected override void OnPaintBackground(PaintEventArgs e) { base.OnPaintBackground(e); if (ActiveFormSkin == null || ActiveFormSkin.NormalState.Image == null) { return; } Rectangle srcRect = DrawUtil.ExcludePadding(new Rectangle(Point.Empty, ActiveFormSkin.NormalState.Image.Size), ActiveFormSkin.ClientAreaPadding); Padding margins = DrawUtil.SubstractPadding(ActiveFormSkin.NormalState.StretchMargins, ActiveFormSkin.ClientAreaPadding); DrawUtil.DrawImage(e.Graphics, ActiveFormSkin.NormalState.Image, srcRect, ClientRectangle, null, margins); }