' Dim image, aNewImage As System.Drawing.Image
Dim aNewImage As System.Drawing.Image
Dim width, height, newwidth, newheight As Integer
Dim callb As System.Drawing.Image.GetThumbnailImageAbort
Dim b As Bitmap
Dim q As Net.HttpWebRequest = Net.HttpWebRequest.Create(Me.TextBox1.Text)
Dim p As Net.HttpWebResponse = q.GetResponse
' Wh(p.GetResponseStream)
'生成缩略图
b = Bitmap.FromStream(p.GetResponseStream)
' image = System.Drawing.Image.FromFile(Server.MapPath("CG002FSOH39.jpg"))
width = b.Width
height = b.Height
If width > height Then
newwidth = 128
newheight = b.Height / b.Width * newwidth
Else
newheight = 88
newwidth = b.Width / b.Height * newheight
End If
aNewImage = b.GetThumbnailImage(newwidth, newheight, callb, New System.IntPtr)
aNewImage.Save(Server.MapPath("smallpic/" + "rs3.gif"))
b.Dispose()
Dim aNewImage As System.Drawing.Image
Dim width, height, newwidth, newheight As Integer
Dim callb As System.Drawing.Image.GetThumbnailImageAbort
Dim b As Bitmap
Dim q As Net.HttpWebRequest = Net.HttpWebRequest.Create(Me.TextBox1.Text)
Dim p As Net.HttpWebResponse = q.GetResponse
' Wh(p.GetResponseStream)
'生成缩略图
b = Bitmap.FromStream(p.GetResponseStream)
' image = System.Drawing.Image.FromFile(Server.MapPath("CG002FSOH39.jpg"))
width = b.Width
height = b.Height
If width > height Then
newwidth = 128
newheight = b.Height / b.Width * newwidth
Else
newheight = 88
newwidth = b.Width / b.Height * newheight
End If
aNewImage = b.GetThumbnailImage(newwidth, newheight, callb, New System.IntPtr)
aNewImage.Save(Server.MapPath("smallpic/" + "rs3.gif"))
b.Dispose()