No flush imitation Google waveform distorted color asp.net verification code

Source: Internet
Author: User
Tags flush net

Online about ASP.net Verification code example is in a lot, some time ago I released the "51aspx implementation of the ASP.net no refreshing Chinese verification Code" by the vast number of Web sites reproduced, but there is no flash and distortion of the article few, examples are almost difficult to find, So I collected some information to write a sample for free to everyone, the main features are as follows:

Effect Chart:

No refresh: That is, the general site have "see unclear, click to replace", "replace the verification code" that kind of function, a JS script to fix!
Waveform distortion: Similar to Google verification code, this can be more effective to prevent the verification code by the robot to break, the specific degree of distortion can be set up (sine wave distorted image waveform filter effect), Gaga parameters can be changed to MSN kind of ah, their extrapolate bar!

Color: The color of the characters is random
Case: is also random, of course, in order to enter the convenience of not the case to limit, you can modify the OH
Note details: Each parameter has a very detailed description, easy to start

To display a skew effect, the default font size is 40 pixels and can be modified by itself

About the distorted source code:

The following are the referenced contents:
1/**////<summary>
2///sine wave distorted picture (Edit by 51aspx.com)
3///</summary>
4///<param name= "srcbmp" > Picture path </param>
5///<param name= "Bxdir" > If distorted then select as True</param>
6///<param name= "Nmultvalue" > Waveform amplitude multiples, the greater the degree of distortion of the higher, generally 3</param>
7///<param name= "Dphase" > Waveform starting phase, value interval [0-2*pi) </param>
8///<returns></returns>
9 Public System.Drawing.Bitmap Twistimage (Bitmap srcbmp, bool Bxdir, double dmultvalue, double dphase)
10 {
One System.Drawing.Bitmap destbmp = new Bitmap (srcbmp.width, srcbmp.height);
12
13////fill the bitmap background with white
System.Drawing.Graphics graph = System.Drawing.Graphics.FromImage (destbmp);
Graph. FillRectangle (New SolidBrush (System.Drawing.Color.White), 0, 0, destbmp.width, destbmp.height);
Graph. Dispose ();
17
Double Dbaseaxislen = Bxdir? (double) Destbmp.height: (double) destbmp.width;
19
for (int i = 0; i < destbmp.width i++)
21 {
for (int j = 0; J < Destbmp.height; J + +)
23 {
Double dx = 0;
DX = Bxdir? (PI2 * (double) j)/Dbaseaxislen: (PI2 * (double) i)/Dbaseaxislen;
DX + + dphase;
Double dy = math.sin (dx);
28
29//Get the color of the current point
int noldx = 0, Noldy = 0;
NOLDX = Bxdir? i + (int) (DY * dmultvalue): i;
Noldy = Bxdir? J:j + (int) (DY * dmultvalue);
33
System.Drawing.Color Color = Srcbmp.getpixel (i, j);
if (noldx >= 0 && noldx < destbmp.width
&& noldy >= 0 && noldy < destbmp.height)
37 {
Destbmp.setpixel (NOLDX, noldy, color);
39}
40}
41}
42
Destbmp return;
44}
45

About no refreshes I found a lot of articles are very complicated, and then came up with an easy way

The following are the referenced contents:


A section of JS code to fix, I do not know what other people have any ideas? Welcome to the Exchange



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.