Page 1 of 1

Does BTNBMP is supporting Image from BLOB field (MySql)?

Posted: Thu May 21, 2020 2:03 pm
by dutch
Dear All,

I need to use BTNBMP and show the picture (contain in BLOB field MySql).

How do I make it?

Thanks in advance,

Re: Does BTNBMP is supporting Image from BLOB field (MySql)?

Posted: Fri May 22, 2020 2:25 am
by nageswaragunupudi
Yes.

Code: Select all

function BtnBmpBlob()

   local oCn
   local oDlg, oBtn, oFont
   local cBlobTaj, cBlobNia

   oCn   := FW_DemoDB()

   cBlobTaj := oCn:QueryResult( "SELECT image FROM wwonders WHERE id = 8" )
   cBlobNia := oCn:QueryResult( "SELECT image FROM wwonders WHERE id = 9" )

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-20
   DEFINE DIALOG oDlg SIZE 400,300 PIXEL TRUEPIXEL FONT oFont ;
      TITLE "BTNBMP FROM BLOB"

   @ 20,20 BTNBMP oBtn PROMPT "TajMahal" ;
      RESOURCE cBlobTaj SIZE 150,150 PIXEL OF oDlg 2007 ;
      ACTION MsgInfo( "From Blob in MySql" )

   @ 20,200 BTNBMP oBtn PROMPT "Niagara" ;
      RESOURCE cBlobNia SIZE 150,150 PIXEL OF oDlg 2007 ;
      ACTION MsgInfo( "From Blob in MySql" )

   @ 200,20 BUTTON "CLOSE" SIZE 100,40 PIXEL OF oDlg

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

   oCn:Close()

return nil
 
Image

Re: Does BTNBMP is supporting Image from BLOB field (MySql)?

Posted: Fri May 22, 2020 10:07 am
by dutch
Dear Master Rao,

Thank you so much, it work very well as expect.