public class CaptchaGenerator
Public Class CaptchaGenerator
Dim instance As CaptchaGenerator
public ref class CaptchaGenerator
type CaptchaGenerator = class end
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
Dim rng As New Random
Dim captchaGen As New CaptchaGenerator
With captchaGen
.Size = Me.PictureBox1.Size
.TextLength = 5
.TextColor = Color.White
.TextAlignmentEnabled = True
.Fonts = {SystemFonts.DefaultFont.FontFamily}
.FontStyle = FontStyle.Bold
.BackgroundColor1 = Color.FromKnownColor(DirectCast(rng.Next([Enum].GetValues(GetType(KnownColor)).Length), KnownColor))
.BackgroundColor2 = Color.FromKnownColor(DirectCast(rng.Next([Enum].GetValues(GetType(KnownColor)).Length), KnownColor))
.GridEnabled = True
.GridColor = Color.DimGray
.GridWidth = 1.0F
.GridSpacing = 3
.CurveEnabled = True
.CurveColor = Color.Black
.CurveWidth = 2.5F
.CurveTension = 8.0F
End With
Dim captcha As Captcha = captchaGen.Generate
Me.PictureBox1.BackgroundImage = captcha.Image
' captcha.Dispose()
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
CaptchaGenerator | Initializes a new instance of the CaptchaGenerator class. |
BackgroundColor1 | Gets or sets the first background color. |
BackgroundColor2 | Gets or sets the second background color. |
Characters | Gets or sets the character set to build the captcha text. |
CurveColor | Gets or sets the color of the curve. |
CurveEnabled | Gets or sets a value indicating whether curve drawing is enabled in the captcha image. |
CurveTension | Gets or sets the curve tension. |
CurveWidth | Gets or sets the width of the curve. |
Fonts | Gets or sets the fonts to use in the captcha generation. |
FontStyle | Gets or sets the font style of the captcha text. |
GridColor | Gets or sets the color of the grid. |
GridEnabled | Gets or sets a value indicating whether grid drawing is enabled in the captcha image. |
GridSpacing | Gets or sets the grid spacing. |
GridWidth | Gets or sets the width of the grid. |
Size | Gets or sets the size of the captcha image. |
TextAlignmentEnabled | Gets or sets a value indicating whether text alignment is enabled in the captcha image. |
TextColor | Gets or sets the color of the captcha text. |
TextLength | Gets or sets the length of the captcha text. |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
Generate | Generates the Captcha. |
GetHashCode | Serves as the default hash function. (Inherited from Object) |
GetType | Gets the Type of the current instance. (Inherited from Object) |
ToString | Returns a string that represents the current object. (Inherited from Object) |
CanConvertTo |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
CanConvertToT |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, an exception is thrown.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, returns the specified default value.
(Defined by ObjectExtensions) |
IsDisposable |
Determines whether the specified object is a disposable type
(i.e., it implements IDisposable interface).
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
ThrowIfNullTException |
Throws the specified exception if the source object is null.
(Defined by ObjectExtensions) |