FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Mostrar imágen desde GOOGLE DRIVE
Posts: 1710
Joined: Tue Oct 28, 2008 06:26 PM
Mostrar imágen desde GOOGLE DRIVE
Posted: Thu Jul 29, 2021 03:16 PM
Buenas estimados

Necesito mostrar imágenes almacenadas en GOOGLE DRIVE
Hago lo siguiente y no muestra nada :-)
Code (fw): Select all Collapse
  cNomImg:="http://drive.google.com/uc?export=view&id=10an-18yRqOyRljuIWZ2-OKXADIDoWrG-"
    oPoster:SetBmp(cNomImg)

 @83,70 BITMAP oPoster SIZE 290,400 PIXEL OF oWnd  NOBORDER CENTER ROUNDED ADJUST


Gracias por la ayuda
Saludos,



Adhemar C.
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Mostrar imágen desde GOOGLE DRIVE
Posted: Thu Jul 29, 2021 03:41 PM
Adhemar, intente con este también:

https://imgur.com/

Haga un teste.

Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1710
Joined: Tue Oct 28, 2008 06:26 PM
Re: Mostrar imágen desde GOOGLE DRIVE
Posted: Thu Jul 29, 2021 08:17 PM

Gracias João

Funciona con Imgur

Pero quisiera hacerlo con GOOGLE DRIVE por es mas práctico y seguro.

Quizás alguien lo ha logrado.

Saludos,



Adhemar C.
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Mostrar imágen desde GOOGLE DRIVE
Posted: Fri Jul 30, 2021 02:01 AM
acuellar wrote:Buenas estimados

Necesito mostrar imágenes almacenadas en GOOGLE DRIVE
Hago lo siguiente y no muestra nada :wink:
Code (fw): Select all Collapse
  cNomImg:="http://drive.google.com/uc?export=view&id=10an-18yRqOyRljuIWZ2-OKXADIDoWrG-"
    oPoster:SetBmp(cNomImg)

 @83,70 BITMAP oPoster SIZE 290,400 PIXEL OF oWnd  NOBORDER CENTER ROUNDED ADJUST
Gracias por la ayuda
Prueba asi
Code (fw): Select all Collapse
  cNomImg:="http://drive.google.com/uc?export=view&id=10an-18yRqOyRljuIWZ2-OKXADIDoWrG-"
 @83,70 BITMAP oPoster SIZE 290,400 PIXEL OF oWnd  NOBORDER CENTER ROUNDED ADJUST 
    oPoster:SetBmp(cNomImg)
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 1710
Joined: Tue Oct 28, 2008 06:26 PM
Re: Mostrar imágen desde GOOGLE DRIVE
Posted: Fri Jul 30, 2021 12:42 PM

Gracias Estimado Cristobal

No funciona.

Saludos,



Adhemar C.
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Mostrar imágen desde GOOGLE DRIVE
Posted: Fri Jul 30, 2021 03:40 PM
Code (fw): Select all Collapse
// \samples\ADHEMAR2.PRG - 30/07/2021 - <!-- e --><a href="mailto:kapiabafwh@gmail.com">kapiabafwh@gmail.com</a><!-- e -->

#Include "FiveWin.ch"

FUNCTION Main()

   LOCAL oWnd, aBmp, oFont
   LOCAL cUrl         := "https://i.imgur.com/teS9kHy.png"
   // google drive no funciona, porque no tiene extension.
   LOCAL cCorinthians := "https://drive.google.com/file/d/1YHX2ragWXF1wC08Zuax1-SNZMA3Rm0GK/view?usp=sharing"
   LOCAL cFalhaFive   := "https://drive.google.com/file/d/0B81trAa2AvzUYzRwRmR3angyQnY4SU15dV9JOEFaZ0RoYkVz/view?usp=sharing&resourcekey=0-VlhYhG3Ym3n9EOdcXFno7A"
   LOCAL cAcuellar    := "http://drive.google.com/uc?export=view&id=10an-18yRqOyRljuIWZ2-OKXADIDoWrG-"

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0, -16

   DEFINE WINDOW oWnd TITLE "BITMAPS LINKED TO URL"

   oWnd:SetFont( oFont )

   DEFINE BUTTONBAR oWnd:oBar OF ownd SIZE 64,80 2015

   oWnd:oBar:bPainted := { || oWnd:oBar:SayText( ;
      "All Images" + CRLF + "are directly" + CRLF + "from URL Links", ;
      { nil, nil, nil, -20 }, "R" ) }

   DEFINE BUTTON OF oWnd:oBar PROMPT "Timao" ;
      ACTION( ShellExecute(GetActiveWindow(),"open",'"'+cCorinthians+'"') )

   DEFINE BUTTON OF oWnd:oBar PROMPT "Fivedit" ;
      ACTION( ShellExecute(GetActiveWindow(),"open",'"'+cFalhaFive+'"') )

   DEFINE BUTTON OF oWnd:oBar PROMPT "Acuellar" ;
      ACTION( ShellExecute(GetActiveWindow(),"open",'"'+cAcuellar+'"') )

   aBmp  := oWnd:ReadImage( cUrl )

   oWnd:nHeight := 600
   oWnd:nWidth  := 700

   ACTIVATE WINDOW oWnd CENTERED ;
      ON PAINT oWnd:DrawImage( aBmp, { oWnd:oBar:nHeight,nil,nil,nil } )

   RELEASE FONT oFont

   PalBmpFree( aBmp )

   oFont:End()

RETURN NIL

// fin / end


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1710
Joined: Tue Oct 28, 2008 06:26 PM
Re: Mostrar imágen desde GOOGLE DRIVE
Posted: Fri Jul 30, 2021 05:56 PM

Muchas gracias estimado João por tu tiempo

Seguiré intentando.

Saludos,



Adhemar C.
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Mostrar imágen desde GOOGLE DRIVE
Posted: Fri Jul 30, 2021 06:40 PM
acuellar wrote:Muchas gracias estimado João por tu tiempo

Seguiré intentando.


Mi caro amigo Adhemar, imgur.com és totalmente seguro. uso a mucho tiempo. No tengo nada a decir de mal sobre imgur.com.

Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1710
Joined: Tue Oct 28, 2008 06:26 PM
Re: Mostrar imágen desde GOOGLE DRIVE
Posted: Fri Jul 30, 2021 09:28 PM

Muchas gracias Estimado João

Por la sugerencia.

Lo haré con IMGUR

Saludos,



Adhemar C.
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Mostrar imágen desde GOOGLE DRIVE
Posted: Fri Jul 30, 2021 10:45 PM

Adhemar, con el código que te he puesto, a mí me funciona perfectamente
La imagen que pones es de una pelicula?

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Mostrar imágen desde GOOGLE DRIVE
Posted: Fri Jul 30, 2021 11:53 PM
cnavarro wrote:Adhemar, con el código que te he puesto, a mí me funciona perfectamente
La imagen que pones es de una pelicula?


Master Navarro, porfa, podrias poner un ejemplo completo para testes? Con el link de tu imagen? BMP, JPG ó PNG?

Gracias, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Mostrar imágen desde GOOGLE DRIVE
Posted: Sat Jul 31, 2021 02:10 AM
Joao, aqui lo tienes
Code (fw): Select all Collapse
#include "Fivewin.ch"
#include "colores.ch"

Static oWindow
Static oBar
Static oFont
Static oFont2
Static oFont3
Static oFont4

Static nCP
Static nW

Function Main()

   DEFINE FONT oFont  NAME "TAHOMA" SIZE 0,-11
   DEFINE FONT oFont2 NAME "TAHOMA" SIZE 0,-16
   DEFINE FONT oFont3 NAME "CALIBRI" SIZE 0,-20
   DEFINE FONT oFont4 NAME "CALIBRI" SIZE 0,-14

   TestFldEx()

   RELEASE oFont
   RELEASE oFont2
   RELEASE oFont3
   RELEASE oFont4

Return nil

//----------------------------------------------------------------------------//

Function TestFldEx()

   local oSay5
   local oSay6
   local nClrL   := Rgb( 0, 188, 142 )
   local oFld12
   local oPoster
   local cNomImg

   DEFINE WINDOW oWindow FROM 20, 20 TO GetSysMetrics( 1 ) - 60, 1120 ;
      PIXEL TITLE "Test Panels and FolderEx" ;
      MENU MyMenu(); 
      COLOR CLR_BLACK, Rgb( 224, 224, 224 )
      oWindow:SetFont( oFont )

      @ 1, 10 FOLDEREX oFld12 ;
         PROMPTS "PRUEBA DE FOLDER", "OTRAS", "CONEXIONES RECIENTES" ; //, "CONEXIONES GUARDADAS", "CONEXIONES" PIXEL ;
         OF oWindow SIZE 600, 600 ; //TRANSPARENT ;
         FONT oFont4 COLOR CLR_WHITE //LEFT
   
      WITH OBJECT oFld12
         //:lNewPaint      := .T.
         :nFolderHeight  := 24
         :nRound         := 0
         :nSeparator     := 0
         :aGradSel       := { { 1, CLR_WHITE, CLR_WHITE } }
         :aGradUnSel     := { { 1, CLR_WHITE, CLR_WHITE } }
         :bClrText       := { | o, n | if( n = o:nOption, ;
                              METRO_GRIS2, Rgb( 184, 184, 184 ) ) }
         :aGradOver      := { { 0.8, CLR_WHITE, CLR_WHITE }, { 0.2, nClrL, nClrL } }
         :aGradOverUnSel := :aGradOver
         :bChange        := { || .F. }
         //:AdjClient()
         //:Refresh()
//         :nFolderWidth   := 128
         :Default()
//         :aDialogs[ 1 ]:bValid := { || .F. }
      END

      @ 0, 10 SAY oSay5 PROMPT "Esto es un Folder Pestaña 1" OF oFld12:aDialogs[ 1 ] ;
         SIZE 250, 32 PIXEL ;
         FONT oFont2 /*TRANSPARENT*/ VCENTER COLOR Rgb( 128, 128, 128 )

    cNomImg:="http://drive.google.com/uc?export=view&id=10an-18yRqOyRljuIWZ2-OKXADIDoWrG-"
    @ 83,70 BITMAP oPoster SIZE 290,400 PIXEL OF oFld12:aDialogs[ 1 ]  NOBORDER ADJUST // CENTER ROUNDED
    oPoster:SetBmp(cNomImg)

      @ 5, 10 SAY oSay6 PROMPT "Esto es un Folder Pestaña 2" OF oFld12:aDialogs[ 2 ] ;
         SIZE 250, 32 PIXEL ;
         FONT oFont2 /*TRANSPARENT*/ VCENTER COLOR Rgb( 128, 128, 128 )

   ACTIVATE WINDOW oWindow ;
      VALID ( .T. )

Return nil

//----------------------------------------------------------------------------//

Function MyMenu()

   Local oMnu
   MENU oMnu
      MENUITEM FwString( "Acciones" )
      MENUITEM FwString( "Editar" )
      MENUITEM FwString( "Ver" )
      MENUITEM FwString( "Ayuda" )
   ENDMENU

Return oMnu

//----------------------------------------------------------------------------//
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Mostrar imágen desde GOOGLE DRIVE
Posted: Sat Jul 31, 2021 01:20 PM

Gracias Master. Con FOLDEREX funciona. Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Mostrar imágen desde GOOGLE DRIVE
Posted: Sat Jul 31, 2021 01:47 PM
Perfecto Maestro Navarro.

Code (fw): Select all Collapse
// \SAMPLES\TESTIMG3.PRG

#Include "FiveWin.ch"

FUNCTION Main()

   LOCAL oDlg, oImg, cNomImg

   cNomImg := "http://drive.google.com/uc?export=view&id=10an-18yRqOyRljuIWZ2-OKXADIDoWrG-"
   
   DEFINE DIALOG oDlg TITLE "Image Google Drive"

   @ 0, 0 BITMAP oImg SIZE 250, 350 PIXEL OF oDlg NOBORDER ADJUST

   oImg:SetBmp( cNomImg )

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT ( oDlg:SetSize( oImg:nWidth, oImg:nHeight ), oDlg:Center() )

   oImg:End()

RETURN NIL


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1344
Joined: Wed Nov 16, 2005 09:14 PM
Re: Mostrar imágen desde GOOGLE DRIVE
Posted: Sat Jul 31, 2021 01:55 PM

Desde que version de FW funciona esta opcion?
Porque a mi no me funciona.
Tengo la 16.06