Hey WP,
- Your code rotates the characters abour a random angle between 0 and 60 degrees, i.e. always in the same direction. My code rotates in both directions, about an angle between -60 and +60 degrees (by default).
Yeap, that makes a lot more sense and I'll maybe adopt your method.
- Your code has hard-coded spacings (25 * i - 15, in RefreshBitmap), i.e. works only with that specific font size. My code calculates the boundary rectangle of the rotated character (which is a bit wider than the unrotated character), and puts the characters at a variable spacing defined by the width of the boundary rectangle so that the characters do not overlap.
Hummm, so that's what the pi over 180 thing is all about
Gotcha!!
While I admire the fact that you made the extra effort to keep them apart, I still think that a bit of overlap isn't that bad, but to be honest it's just a matter of taste and is irrelevant.
I think that the lines will produce enough noise that both my version and yours would be very computationally intensive to suss out by a computer, so it doesn't matter what the chars look like.
Next thing I'll do is, for sure, adopt using
TFont instead of
TLogFont. But I'm still gonna try and mimic the overlapping and the general appearance of my version.
Again, and I can't say this enough, your code will be invaluable for me to up my ante and make my version a component!!
Another thing that I really liked about your solution is that you don't care about the component size, you just draw the CAPTCHA in the middle, Vertically and Horizontally, of the available space.
This eliminates the aspect ratio question I had and makes it easier to always have the necessary size without going into complicated calculations of aspect ratio!!
Cheers,
Gus