主要用到的是:System.Drawing
代码如下:
代码如下:
<meta name="Author" content="ensonfly"/>
<%@ Import Namespace =Namespace="System" %>
<%@ Import Namespace =Namespace="System.IO" %>
<%@ Import Namespace =Namespace="System.Drawing" %>
<%@ Page language="vb" %>
<script runat="server">
Dim FilePath As String = Server.MapPath("photo001.jpg")
Sub Page_Load()Sub Page_Load(ByVal Sender As Object, ByVal E As EventArgs)
Dim image As System.Drawing.Image = System.Drawing.Image.FromFile(FilePath)
Dim g As Graphics = Graphics.FromImage(image)
g.DrawImage(image, 0, 0, image.Width, image.Height)
Dim f As Font = New Font("Arial", 9)
Dim b As Brush = New SolidBrush(Color.Black)
Dim str1 = "Your Host: " & Request.ServerVariables("REMOTE_ADDR")
Dim str2 = "Your Browser: " & Request.Browser("Browser") & Request.Browser("Version")
Dim str3 = "Powered By Ensonfly"
Dim str4 = "Http://ensonfly.guwancun.com/"
Dim s1 As String = Left(str1, str1.Length)
Dim s2 As String = Left(str2, str2.Length)
Dim s3 As String = Left(str3, str3.Length)
Dim s4 As String = Left(str4, str4.Length)
g.DrawString(s1, f, b, 30, 190)
g.DrawString(s2, f, b, 30, 210)
g.DrawString(s3, New Font("Arial", 9), New SolidBrush(Color.Coral), 30, 230)
g.DrawString(s4, New Font("Arial", 9), New SolidBrush(Color.Coral), 30, 250)
image.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg)
g.Dispose()
image.Dispose()
End Sub
</script>
<%@ Import Namespace =Namespace="System" %>
<%@ Import Namespace =Namespace="System.IO" %>
<%@ Import Namespace =Namespace="System.Drawing" %>
<%@ Page language="vb" %>
<script runat="server">
Dim FilePath As String = Server.MapPath("photo001.jpg")
Sub Page_Load()Sub Page_Load(ByVal Sender As Object, ByVal E As EventArgs)
Dim image As System.Drawing.Image = System.Drawing.Image.FromFile(FilePath)
Dim g As Graphics = Graphics.FromImage(image)
g.DrawImage(image, 0, 0, image.Width, image.Height)
Dim f As Font = New Font("Arial", 9)
Dim b As Brush = New SolidBrush(Color.Black)
Dim str1 = "Your Host: " & Request.ServerVariables("REMOTE_ADDR")
Dim str2 = "Your Browser: " & Request.Browser("Browser") & Request.Browser("Version")
Dim str3 = "Powered By Ensonfly"
Dim str4 = "Http://ensonfly.guwancun.com/"
Dim s1 As String = Left(str1, str1.Length)
Dim s2 As String = Left(str2, str2.Length)
Dim s3 As String = Left(str3, str3.Length)
Dim s4 As String = Left(str4, str4.Length)
g.DrawString(s1, f, b, 30, 190)
g.DrawString(s2, f, b, 30, 210)
g.DrawString(s3, New Font("Arial", 9), New SolidBrush(Color.Coral), 30, 230)
g.DrawString(s4, New Font("Arial", 9), New SolidBrush(Color.Coral), 30, 250)
image.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg)
g.Dispose()
image.Dispose()
End Sub
</script>
演示地址:http://ensonfly.guwancun.com/tools/ShowIpPhoto/photo.aspx