Hi Al Group
Alguin know how to save a JPG in a Table in Postgress
I am using this but it does not work when I want to present
cfoto: = __b64enc (MEMOREAD (cFotoFile)) //ot4xb.dll Paul
I think if the file again with the image looks good in the file
MEMOWRIT ( "C: \ LOGS \ Foto.jpg" __b64dec (cfoto))
but if what I want is to paint the picture with DC_BitMapDraw (oMarcoFoto, __b64dec (cfoto))
no nothing.
Problems Using Bitmap in Postgress
Problems Using Bitmap in Postgress
Nolberto Paulino
Regards
Regards
Re: Problems Using Bitmap in Postgress
hi,
did you talk about Xbase++ PgDBE or native Access using libpq.dll ?
also remember PDR 6009 : 14 Byte from Bitmap Header are missing when using o:SetBuffer()
did you talk about Xbase++ PgDBE or native Access using libpq.dll ?
also remember PDR 6009 : 14 Byte from Bitmap Header are missing when using o:SetBuffer()
greetings by OHR
Jimmy
Jimmy
Re: Problems Using Bitmap in Postgress
I am using SQL Express Demo and xBase 1.9.355, and I want to know how to add a photo on a table and then show postgress
Nolberto Paulino
Regards
Regards
Re: Problems Using Bitmap in Postgress
PostgreSQL Table have Type "BLOB" and "bytea" to store binary Data.
i think Sqlexpress use Postgres ODBC ... ask Boris what Format can be used by ODBC
i use "bytea" with XbpBitmap() and cBin2Hex() / cHex2Bin() from ot4xb
"store" to PG"load" from PG
i think Sqlexpress use Postgres ODBC ... ask Boris what Format can be used by ODBC
i use "bytea" with XbpBitmap() and cBin2Hex() / cHex2Bin() from ot4xb
"store" to PG
Code: Select all
oBMP := XBPBITMAP() :new() :create()
oBMP:loadFile( cFile )
cBuffer := oBMP:setbuffer()
// cBuffer missing 14 byte Header need workaround
//
cSql += ::_aBroFields[ nCol ] [ DBS_NAME ] + "= '\x" + cBin2Hex( cBuffer ) + "' "
cAlias := ::_aBroFields[ nCol ] [ DBS_ALIAS ] + "."
cWhere := cAlias + "__record" + "=" + STR( nRecord )
cSql += " WHERE " + cWhere
Code: Select all
cFeld := ::oResult:getValue( nRow - 1, nCol - 1 )
// strip "\x"
//
IF SUBSTR( cFeld, 1, 2 ) = "\x"
cFeld := SUBSTR( cFeld, 3, LEN( cFeld ) - 2 )
ENDIF
oPS := XBPPRESSPACE() :new() :create( oDlg:drawingArea:winDevice() )
oBMP := XBPBITMAP() :new() :create( oPS )
// Hex to Bin Format using ot4xb
//
oBMP:setBuffer( cHex2Bin( cFeld ) )
greetings by OHR
Jimmy
Jimmy
Re: Problems Using Bitmap in Postgress
Hi Jimmy
Where you can get this 2 functions
cBin2Hex()
cHex2Bin()
Remember that I am using xBase 1.9.355
Where you can get this 2 functions
cBin2Hex()
cHex2Bin()
Remember that I am using xBase 1.9.355
Nolberto Paulino
Regards
Regards
-
- Posts: 36
- Joined: Thu Jan 28, 2010 2:30 pm
Re: Problems Using Bitmap in Postgress
You can get it here (free):digitsoft wrote:Where you can get this 2 functions
cBin2Hex()
cHex2Bin()
http://ot4xb.xbwin.com
Best regards
Leon
Leon
Re: Problems Using Bitmap in Postgress
You may also use StrToHex/HexToStr from the Xbase Tools, free in Xbase++ 2.0 or higher.
They work for binaries aswell.

Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: Problems Using Bitmap in Postgress
You can also use DC_Var2HexString() and DC_HexString2Var().
The eXpress train is coming - and it has more cars.