Hola comunidad de programadores.
Mi preguntas es ¿como puedo abrir en visual una imagen de tipo jpg o gif con direccion url en un control Image por ejemplo?
Saludos
| ||||
| haber no entendi tu pregunta :P quieres abrir una imagen de alguna direccion web en un control Image? o Que esa imagen te abra una direccion url?
__________________ http://www.xpresatelibre.com La Xpresion Al Maximo Nivel |
| ||||
| pues se me ocurre esta forma: usa el control webbrowser :D y un boton Private Sub Command1_Click() Web.Navigate "http://www.tupagina.com/miimagen.jpg" End Sub
__________________ http://www.xpresatelibre.com La Xpresion Al Maximo Nivel |
| ||||
| a por cierto.. si quieres abrir una imagen de internet en un control de image la unica forma que yo al menos e logrado a sido abrirla asi: insertas el control image1 te vas a propiedades buscas donde dice Picture le das click ahi para examinar dentro del disco duro la imagen y en lugar de poner o buscar la imagen dentro del disco duro pon la direccion web donde esta la foto http://foto.com/mifoto.jpg sigo intentando ver como cargar una imagen de internet en un control image1 desde un boton o un textbox o algo. :P igual y serviria mucho un dialogcontrol :P
__________________ http://www.xpresatelibre.com La Xpresion Al Maximo Nivel |
| |||
| te paso un ejemplo usando el control Intet (lo agregas desde compontes coloca: un image1, un shape1 y un shape2 y un Command1
Código:
Private Sub Command1_Click()
With Inet1
.AccessType = icUseDefault
'Aca pone la ruta de la imagen
.URL = "http://www.forosdelweb.com/images/vbulletin3_logo_fdw.gif"
.Execute , "GET"
End With
End Sub
Private Sub Form_Load()
Command1.Caption = "cargar imagen"
Shape2.Width = 0
End Sub
Private Sub Form_Resize()
With Shape1
.Move 0, 10, ScaleWidth, 300
.BorderColor = vbRed
.BorderWidth = 3
End With
With Shape2
.Move 0, 10, 0, 300
.BackColor = vbBlue
.BackStyle = 1
End With
End Sub
Private Sub Inet1_StateChanged(ByVal State As Integer)
Dim vtData As Variant, nomArchivo As String
Dim bDone As Boolean, tempArray() As Byte
nomArchivo = Right(Inet1.URL, Len(Inet1.URL) - InStrRev(Inet1.URL, "/"))
Select Case State
Case icResponseCompleted
bDone = False
filesize = Inet1.GetHeader("Content-length")
contenttype = Inet1.GetHeader("Content-type")
Open App.Path & "\" & nomArchivo For Binary As #1
vtData = Inet1.GetChunk(1024, icByteArray)
DoEvents
If Len(vtData) = 0 Then
bDone = True
End If
Shape2.Width = 0
Do While Not bDone
tempArray = vtData
Put #1, , tempArray
Shape2.Width = Shape2.Width + (Len(vtData) * 2) * Shape1.Width / filesize
vtData = Inet1.GetChunk(1024, icByteArray)
DoEvents
If Len(vtData) = 0 Then
bDone = True
End If
Loop
Close #1
'Cargas la imagen
Image1.Picture = LoadPicture(App.Path & "\" & nomArchivo)
End Select
End Sub
--------------------------------------
__________________ Recursos visual basic |
| |||
| holap yo estoy en la misma situacion necesito cargar una imagen de un url...ya probre tu ejemplo pero me sale un error me dice que No se ha especificado ningun equipo remoto... sabes como solucionarlo???? gracias |