Se puede hacer esto.???
O sino como la bajo localmente para luego si buscarla y mostrarla ???
Desde ya gracias
|
|
#1 (permalink) |
![]() Fecha de Ingreso: mayo-2005
Mensajes: 76
|
PictureBox + Imagen de internet
Se puede hacer esto.??? O sino como la bajo localmente para luego si buscarla y mostrarla ??? Desde ya gracias |
|
|
|
|
|
#2 (permalink) |
![]() Fecha de Ingreso: noviembre-2002
Mensajes: 196
|
Pone esto en un modulo:
Código:
Y para cargar la foto: Public Function LoadWebImageToPictureBox(ByVal pb _
As PictureBox, ByVal ImageURL As String) As Boolean
Dim objImage As MemoryStream
Dim objwebClient As WebClient
Dim sURL As String = Trim(ImageURL)
Dim bAns As Boolean
Try
If Not sURL.ToLower().StartsWith("http://") _
Then sURL = "http://" & sURL
objwebClient = New WebClient
objImage = New _
MemoryStream(objwebClient.DownloadData(sURL))
pb.Image = Image.FromStream(objImage)
bAns = True
Catch ex As Exception
bAns = False
End Try
Return bAns
End Function
LoadWebImageToPictureBox(Me.PictureBox1, "http://www.miurl.com/miimagen.gif")
__________________
Necesitas ayuda en VB o .NET?Web Foros |
|
|
|
|
|
#3 (permalink) |
![]() Fecha de Ingreso: mayo-2005
Mensajes: 76
|
Eh GRACIAS!!!!
por la ayuda, ya lo habia resuelto te muestro como:
Código:
Private Sub CargarBanner()
Dim urlBanner As String = "http://maurishio.freefronthost.com/imagenes/logo.gif"
Dim objRequest As System.Net.HttpWebRequest = CType(System.Net.WebRequest.Create(urlBanner), System.Net.HttpWebRequest)
Dim ImagenBaner As New Bitmap(objRequest.GetResponse.GetResponseStream)
Banner.Image = ImagenBaner
End Sub
bye |
|
|
|
![]() |
| Herramientas | |
| Desplegado | |
|
|