Foros del Web » Programación para mayores de 30 ;) » Programación General » Visual Basic clásico »

Abrir imagenes URL

Estas en el tema de Abrir imagenes URL en el foro de Visual Basic clásico en Foros del Web. 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 ...
  #1 (permalink)  
Antiguo 17/08/2006, 19:46
Avatar de Demon_Hunter  
Fecha de Ingreso: abril-2006
Ubicación: Ciudad de Mexico
Mensajes: 26
Antigüedad: 18 años
Puntos: 0
Abrir imagenes URL

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
__________________
Programacion = Creatividad:pensando:
  #2 (permalink)  
Antiguo 18/08/2006, 06:59
Avatar de UID
UID
 
Fecha de Ingreso: febrero-2004
Ubicación: Villahermosa tabasco cent
Mensajes: 251
Antigüedad: 20 años, 2 meses
Puntos: 0
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
  #3 (permalink)  
Antiguo 18/08/2006, 09:44
Avatar de Demon_Hunter  
Fecha de Ingreso: abril-2006
Ubicación: Ciudad de Mexico
Mensajes: 26
Antigüedad: 18 años
Puntos: 0
De acuerdo

Si quiero abrir una imagen con direccion web en un control de image jeje, me imagino q si se puede ¿o no?
__________________
Programacion = Creatividad:pensando:
  #4 (permalink)  
Antiguo 18/08/2006, 09:48
Avatar de Demon_Hunter  
Fecha de Ingreso: abril-2006
Ubicación: Ciudad de Mexico
Mensajes: 26
Antigüedad: 18 años
Puntos: 0
O que control puedo usar para abrir imagenes con direccion web.
Saludos
__________________
Programacion = Creatividad:pensando:
  #5 (permalink)  
Antiguo 18/08/2006, 10:08
Avatar de UID
UID
 
Fecha de Ingreso: febrero-2004
Ubicación: Villahermosa tabasco cent
Mensajes: 251
Antigüedad: 20 años, 2 meses
Puntos: 0
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
  #6 (permalink)  
Antiguo 18/08/2006, 10:11
Avatar de UID
UID
 
Fecha de Ingreso: febrero-2004
Ubicación: Villahermosa tabasco cent
Mensajes: 251
Antigüedad: 20 años, 2 meses
Puntos: 0
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
  #7 (permalink)  
Antiguo 18/08/2006, 18:37
 
Fecha de Ingreso: abril-2004
Mensajes: 192
Antigüedad: 20 años
Puntos: 0
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
  #8 (permalink)  
Antiguo 24/08/2006, 11:50
 
Fecha de Ingreso: agosto-2006
Mensajes: 39
Antigüedad: 17 años, 8 meses
Puntos: 1
Como explicaron mas arriba, tenes que usar controles de internet como por ejemplo: ITC (Internet Transfer Control), Inet, Webbrowser, etc
  #9 (permalink)  
Antiguo 04/09/2006, 18:12
 
Fecha de Ingreso: junio-2006
Mensajes: 15
Antigüedad: 17 años, 10 meses
Puntos: 0
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
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 03:46.