C# Class Framework.Mvc.Captcha.CaptchaImage

CAPTCHA Image.
显示文件 Open project: coreframework/Core-Framework Class Usage Examples

Public Properties

Property Type Description
CaptchaImageGuidKey String

Public Methods

Method Description
GetCachedCaptcha ( String guid ) : CaptchaImage

Gets the cached captcha.

RenderImage ( ) : Bitmap

Forces a new Captcha image to be generated using current property value settings.

Private Methods

Method Description
AddLine ( Graphics g, Rectangle rect ) : void

Add variable level of curved lines to the image.

AddNoise ( Graphics g, Rectangle rect ) : void

Add a variable level of graphic noise to the image.

CaptchaImage ( ) : System

Initializes static members of the CaptchaImage class.

GenerateImagePrivate ( ) : Bitmap

Renders the CAPTCHA image.

GenerateRandomText ( ) : String

Generate random text for the CAPTCHA.

GetFont ( ) : Font

Returns the CAPTCHA font in an appropriate size.

GetRandomColor ( ) : Color

Randoms the color.

GetRandomFontFamily ( ) : String

Returns a random font family from the font whitelist.

RandomPoint ( Rectangle rect ) : PointF

Returns a random point within the specified rectangle.

RandomPoint ( int xmin, int xmax, int ymin, int ymax ) : PointF

Returns a random point within the specified x and y ranges.

TextPath ( String s, Font f, Rectangle r ) : GraphicsPath

Returns a GraphicsPath containing the specified String and font.

WarpText ( GraphicsPath textPath, Rectangle rect ) : void

Warp the provided text GraphicsPath by a variable amount.

Method Details

GetCachedCaptcha() public static method

Gets the cached captcha.
public static GetCachedCaptcha ( String guid ) : CaptchaImage
guid String The GUID of the Captcha.
return CaptchaImage

RenderImage() public method

Forces a new Captcha image to be generated using current property value settings.
public RenderImage ( ) : Bitmap
return System.Drawing.Bitmap

Property Details

CaptchaImageGuidKey public_oe static_oe property

Captcha image guid key.
public static String CaptchaImageGuidKey
return String