Página 1 de 1

how to put a photo into a Image field (ADS)

Publicado: Lun May 21, 2007 12:15 am
por Roberto
Hi,
Nice product! :o)
I have a table with a column named "Photo" and it's type is Image (from ADS).
It's ok, but how can I use it?
tks

how to put a photo into a Image field (ADS)

Publicado: Lun May 21, 2007 10:33 am
por jfgimenez
Roberto,
> Nice product! :o)
Thanks!
> I have a table with a column named "Photo" and it's type is Image (from
> ADS).
> It's ok, but how can I use it?
You may use the method SaveToStream() from TPicture; it returns a buffer
containing the image data, which can be stored where you want.
Later, to recover and show the image, you may use the method
LoadFromStream()
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info

how to put a photo into a Image field (ADS)

Publicado: Mar May 22, 2007 12:21 am
por Roberto
Very nice product!
Ok, I understood how can I manipulate the Image object, tks.
But I still have a problem: I can't write the image to a field type Image
(ADS) cause I get an error telling me it was expecting a data type Image
and it is getting a Char type value. I can save it to a memo field, but it
does not sounds good.
"Jose F. Gimenez" <jfgimenez@wanadoo.es> wrote:
>Roberto,
>
>> Nice product! :o)
>
>Thanks!
>
>
>> I have a table with a column named "Photo" and it's type is Image (from
>> ADS).
>> It's ok, but how can I use it?
>
>You may use the method SaveToStream() from TPicture; it returns a buffer
>containing the image data, which can be stored where you want.
>
>Later, to recover and show the image, you may use the method
>LoadFromStream()
>
>--
>Regards,
>
>Jose F. Gimenez
>http://www.xailer.com
>http://www.xailer.info
>
>

how to put a photo into a Image field (ADS)

Publicado: Mar May 22, 2007 9:57 am
por jfgimenez
Roberto,
> But I still have a problem: I can't write the image to a field type Image
> (ADS) cause I get an error telling me it was expecting a data type Image
> and it is getting a Char type value. I can save it to a memo field, but it
> does not sounds good.
It seems there is something incorrect in rddads, or simply it doesn't allow
to write any binary data on it. Notice that xHarbour doesn't have a native
'image' datatype, so it is stored to memory in a character variable.
ITOH, I don't see any problem in using a memo field to store an image using
ADS (server). It's supposed that ADS server is very reliable, so there
should be no problem.
BTW, I've just readed in another forum that Miguel Angel Marchuet has just
implemented new datatypes to rdd system, so it's possible that it could be
possible in a short time.
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info

how to put a photo into a Image field (ADS)

Publicado: Mar May 22, 2007 10:44 am
por ignacio
Roberto,
/* $DOC$
* $FUNCNAME$
* ADSBlob2File()
* $CATEGORY$
* Advantage Database RDD
* $ONELINER$
* Write a Binary (memo) field's contents to a file
* $SYNTAX$
* ADSBlob2File(cFileName, cFieldName) --> lSuccess
* $ARGUMENTS$
* <cFileName> File to create. If it already exists, it will be
* overwritten on success and destroyed on error.
*
* <cFieldName> Field in the current workarea that contains binary
data.
*
* $RETURNS$
* <lSuccess> True if the file is successfully written.
* $DESCRIPTION$
* See ACE.HLP for full details about the Advantage Database Server.
* ADSBlob2File() is a wrapper for AdsBinaryToFile.
* $EXAMPLES$
* $TESTS$
* $STATUS$
* R
* $COMPLIANCE$
* Harbour extension
* $PLATFORMS$
* Windows 32-bit only
* $FILES$
* Library is RddAds
* Header is ads.ch
* $SEEALSO$
* ADSFile2Blob()
* $END$
*/
/* $DOC$
* $FUNCNAME$
* ADSFile2Blob()
* $CATEGORY$
* Advantage Database RDD
* $ONELINER$
* Save a Binary file to a field
* $SYNTAX$
* ADSFile2Blob(cFileName, cFieldName, <nBinaryType>) --> lSuccess
* $ARGUMENTS$
* <cFileName> File to read. Can be in UNC format. A common example
is an image file.
*
* <cFieldName> Field in the current workarea to contain the binary
data.
*
* <nBinaryType> Either ADS_BINARY (the default) or ADS_IMAGE.
* This parameter is for fields in DBF files.
* ADT tables cannot store binary and image data in standard character
* memo fields (they have specific field types for that).
* $RETURNS$
* <lSuccess> True if the file is successfully written.
* $DESCRIPTION$
* See ACE.HLP for full details about the Advantage Database Server.
* ADSFile2Blob() is a wrapper for AdsFileToBinary.
* Use of this function is illegal in an ADS transaction.
* $EXAMPLES$
* $TESTS$
* $STATUS$
* R
* $COMPLIANCE$
* Harbour extension
* $PLATFORMS$
* Windows 32-bit only
* $FILES$
* Library is RddAds
* Header is ads.ch
* $SEEALSO$
* ADSBlob2File()
* $END$
*/
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"roberto" <roberto@top2.com.br> escribió en el mensaje
news:46521b80$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>
> Very nice product!
>
> Ok, I understood how can I manipulate the Image object, tks.
> But I still have a problem: I can't write the image to a field type Image
> (ADS) cause I get an error telling me it was expecting a data type Image
> and it is getting a Char type value. I can save it to a memo field, but it
> does not sounds good.
>
> "Jose F. Gimenez" <jfgimenez@wanadoo.es> wrote:
>>Roberto,
>>
>>> Nice product! :o)
>>
>>Thanks!
>>
>>
>>> I have a table with a column named "Photo" and it's type is Image (from
>
>>> ADS).
>>> It's ok, but how can I use it?
>>
>>You may use the method SaveToStream() from TPicture; it returns a buffer
>
>>containing the image data, which can be stored where you want.
>>
>>Later, to recover and show the image, you may use the method
>>LoadFromStream()
>>
>>--
>>Regards,
>>
>>Jose F. Gimenez
>>http://www.xailer.com
>>http://www.xailer.info
>>
>>
>