HtmlForgeX

API Reference

Class

EmailBackgroundImageBox

Namespace HtmlForgeX.Email
Assembly HtmlForgeX.Email
Implements
ILayoutAware ISpacingContainer IRoundable<EmailBackgroundImageBox> IRoundable
Modifiers sealed

Email-safe background image container. Renders CSS background-image for modern clients and a VML v:rect/v:fill fallback for Outlook (MSO).

Inheritance

Constructors

public EmailBackgroundImageBox() #

Creates a new EmailBackgroundImageBox.

Methods

public override Void EvaluateLayout(LayoutContext context) #
Returns: Void

Parameters

context HtmlForgeX.Email.LayoutContext requiredposition: 0
public override String ToString() #
Returns: String
public EmailBackgroundImageBox WithBackgroundImage(String src) #
Returns: EmailBackgroundImageBox

Sets background image.

Parameters

src System.String requiredposition: 0
public EmailBackgroundImageBox WithBorderRadius(String radius) #
Returns: EmailBackgroundImageBox

Sets border radius.

Parameters

radius System.String requiredposition: 0
public EmailBackgroundImageBox WithMinHeight(Int32 px) #
Returns: EmailBackgroundImageBox

Sets minimum height.

Parameters

px System.Int32 requiredposition: 0
public virtual EmailBackgroundImageBox WithRoundingMode(RoundingMode mode) #
Returns: EmailBackgroundImageBox

Sets rounding mode.

Parameters

mode HtmlForgeX.Email.RoundingMode requiredposition: 0

Properties

public String BackgroundImage { get; set; } #

Background image URL (https://, cid:, data:).

public String BackgroundColor { get; set; } #

Fallback background color behind the image.

public String BackgroundPosition { get; set; } #

CSS background-position (e.g. "center center").

public String BackgroundSize { get; set; } #

CSS background-size (e.g. "cover").

public String BackgroundRepeat { get; set; } #

CSS background-repeat (e.g. "no-repeat").

public Int32 MinHeightPx { get; set; } #

Minimum height in pixels (also used for the Outlook VML shape).

public Int32 OutlookWidthPx { get; set; } #

Optional fixed width for Outlook VML rendering (in pixels). When 0, falls back to MaxWidth (or 600px).

public String BorderRadius { get; set; } #

Border radius (non-Outlook clients; Outlook may ignore).

public virtual RoundingMode RoundingMode { get; set; } #

Controls default rounding when no explicit radius is set.