Dim strFileName As String ' Declare variable, for picture path
Dim i as System.Drawing.Image ' create. NET Framework image Processing object instance
Dim imgg1 As Integer =cint (Int ((6 * RND ()) + 1) ' generates a random number of 1-6
Dim oydj As String=imgg1
strFileName = "d:\o123\" +oydj+ ". jpg" ' Loaded picture path, where the OYDJ represent randomly generated variables for generating random pictures
i = System.Drawing.Image.FromFile (strFileName)
Dim b As New System.Drawing.Bitmap (I.width, I.height, Pixelformat.format24bpprgb)
Dim g As Graphics = Graphics.fromimage (b)
G.clear (color.blue) ' Background color is blue
Dim Sss=request.servervariables ("Remote_addr")
G.drawimage (i,new Point (0,0))
' Here represents the generation of a character, # 9th Bold White, PointF (160,50) for the coordinates on the screen
g.DrawString (SSS, New Font ("XXFarEastFont-Arial", 9,fontstyle.bold), New SolidBrush (Color.White), New PointF (160,50))
g.DrawString (SSS, New Font ("XXFarEastFont-Arial", 9,fontstyle.bold), New SolidBrush (Color.White), New PointF (161,51))
Response.contenttype= ' image/jpeg ' specifies the output format as a graphic
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.