Hi,
Im creating a CAPTCHA control and are stuck on the GDI part.
I get the correct image loaded, but I dont know how to write the image to the final image.
If anybody out there could help me with this I will be very thankfull.
Im creating a CAPTCHA control and are stuck on the GDI part.
I get the correct image loaded, but I dont know how to write the image to the final image.
If anybody out there could help me with this I will be very thankfull.
C#:
Bitmap bmp = new Bitmap(imageLength, 78);
Random rnd = new Random();
for (int i = 0; i <= length; i++)
{
int r = rnd.Next(0, 25);
string letter = letters.Substring(r, 1);
sCode += letter;
System.Reflection.Assembly thisExe;
thisExe = System.Reflection.Assembly.GetExecutingAssembly();
System.IO.Stream file = thisExe.GetManifestResourceStream("LCTools.Service.Captcha.Gfx." + letter + ".jpg");
int angl = rnd.Next(-15, 15);
System.Drawing.Image img = System.Drawing.Image.FromStream(file);
Graphics gfx = Graphics.FromImage(img);
gfx.RotateTransform(angl);
gfx.DrawImage(img, 0, 0);
//DRAW IMAGE TO bmp
}