<%@ Page Trace="False" Language="vb" aspcompat="false" debug="true" validateRequest="false"%> <%@ Import Namespace=System.Drawing %> <%@ Import Namespace=System.Drawing.Imaging %> <%@ Import Namespace=System %> <%@ Import Namespace=System.Web %> <% Dim font_style As System.Drawing.FontStyle Dim isTurning_Enabled as Boolean Dim font_size As Single Dim GAGB_key as String Dim new_rn As String Dim str_tn_encode As String Dim gennumber as String Dim ffont(6) Dim fcolor(6) Dim fYpos(6) %> <% new_rn = RandomNumber str_tn_encode = RC4_tn(new_rn, GAGB_key) str_tn_encode = AsciiToHex_tn(str_tn_encode) If Request.Cookies("rainforest") Is Nothing Then Response.Cookies.Set(New HttpCookie("rainforest", str_tn_encode)) Response.Cookies("rainforest").Path = "/" Else Response.Cookies("rainforest").Value = str_tn_encode Response.Cookies("rainforest").Path = "/" End If gennumber = new_rn ffont(1) = "Arial" ffont(2) = "Comic Sans MS" ffont(3) = "Verdana" ffont(4) = "Georgia" ffont(5) = "Roman" ffont(6) = "Arial Narrow" fcolor(1) = "Navy" fcolor(2) = "DarkOliveGreen" fcolor(3) = "DarkCyan" fcolor(4) = "Coral" fcolor(5) = "CornflowerBlue" fcolor(6) = "Peru" fYpos(1) = -1 fYpos(2) = 0 fYpos(3) = -2 fYpos(4) = -3 fYpos(5) = -4 fYpos(6) = -5 font_style = 1 font_size = 14 Dim originalimg As Drawing.Image Dim nextFont As String Dim nextColor As String Dim nextYpos As Single Dim nextDigit As String Dim gl As Integer originalimg = System.Drawing.Image.FromFile(Server.MapPath("Images/tn.jpg")) Dim full_thumb As New Bitmap(80, 20) Dim gr_dest1 As Graphics = Graphics.FromImage(full_thumb) Dim sb1 = New SolidBrush(System.Drawing.Color.White) gr_dest1.FillRectangle(sb1, 0, 0, full_thumb.Width, full_thumb.Height) gr_dest1.DrawImage(originalimg, 0, 0, full_thumb.Width, full_thumb.Height) gr_dest1.SmoothingMode = Drawing.Text.TextRenderingHint.AntiAlias For gl = 1 To 6 nextFont = ffont(RandomDigits) nextColor = fcolor(RandomDigits) nextYpos = fYpos(RandomDigits) nextDigit = Mid(gennumber, gl, 1) Dim fontcolor As Drawing.Color = Drawing.Color.FromName(nextColor) gr_dest1.DrawString(nextDigit, New Font(nextFont, font_size, font_style), _ New Drawing.SolidBrush(fontcolor), New PointF(((gl - 1) * 12) + 2, nextYpos)) Next Dim eps As EncoderParameters = New EncoderParameters(1) eps.Param(0) = New EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 100) Dim ici As ImageCodecInfo = GetEncoderInfo("image/jpeg") full_thumb.Save(Response.OutputStream, ici, eps) %>