CaptchaImageProperties.BackgroundColor Property
Namespace: DevExpress.Web.Captcha
Assembly:
DevExpress.Web.v24.2.dll
Declaration
[DefaultValue(typeof(Color), "#eeeeee")]
public Color BackgroundColor { get; set; }
<DefaultValue(GetType(Color), "#eeeeee")>
Public Property BackgroundColor As Color
Property Value
Type |
Default |
Description |
Color |
"#eeeeee" |
A Color value which specifies the background color.
|
Example
The following part of the ASPxCaptcha - Features online demo illustrates how to customize the challenge image‘s style settings.
These settings are specified within a panel (ASPxComboBox, ASPxColorEdit editors) and applied to the captcha control via the Apply button (ASPxButton).
protected void btnApply_Click(object sender, EventArgs e) {
...
int parseResult = 0;
Captcha.ChallengeImage.FontFamily = cbFontFamily.Value.ToString();
Captcha.ChallengeImage.ForegroundColor = ceForegroundColor.Color;
Captcha.ChallengeImage.BackgroundColor = ceBackgroundColor.Color;
Captcha.ChallengeImage.BorderColor = ceBorderColor.Color;
if (int.TryParse(seBorderWidth.Text, out parseResult))
Captcha.ChallengeImage.BorderWidth = parseResult;
...
}
<dx:ASPxCaptcha ID="Captcha" runat="server" Width="402px">
<ValidationSettings ErrorDisplayMode="Text">
</ValidationSettings>
</dx:ASPxCaptcha>
...
<dx:ASPxComboBox ID="cbFontFamily" runat="server" Width="170px" ValueType="System.String">
<Items>
<dx:ListEditItem Text="Times New Roman" Value="Times New Roman" />
<dx:ListEditItem Text="Courier New" Value="Courier New" />
<dx:ListEditItem Text="Georgia" Value="Georgia" />
<dx:ListEditItem Text="Tahoma" Value="Tahoma" />
<dx:ListEditItem Text="Verdana" Value="Verdana" />
</Items>
</dx:ASPxComboBox>
...
<dx:ASPxColorEdit ID="ceForegroundColor" runat="server" Width="170px">
</dx:ASPxColorEdit>
...
<dx:ASPxColorEdit ID="ceBackgroundColor" runat="server" Width="170px">
</dx:ASPxColorEdit>
...
<dx:ASPxColorEdit ID="ceBorderColor" runat="server" Width="170px">
</dx:ASPxColorEdit>
...
<dx:ASPxSpinEdit ID="seBorderWidth" Width="50px" runat="server" MaxValue="10">
</dx:ASPxSpinEdit>
...
<dx:ASPxButton ID="btnApply" CssClass="DemoButton" runat="server" Text="Apply"
Width="70px" OnClick="btnApply_Click" />
See Also