dim. 20 octobre 2013, 16h21

Francis Faure
France
atoutfox.public.association
Re: Champ Blob et image
>Le sam. 19 octobre 2013, 23h15 alahem1 a écrit :
> J'ai un formulaire, Un contrôle IMAGE1, deux contrôles BOUTON1 et BOUTON2. Une table contenant entre autre un champ Blob.
>
> IMAGE1.PictureVal = lcphoto
> IMAGE1.Stretch = 2
c'est quoi lcphoto ? une variable ?
> 1° Écrire un fichier BMP dans une table DBF
>
> BOUTON1.Click()
>
USE table
** pour y stocker un fichier bitmap
LOCAL cStrBitmap, cMonFichierBitMap
m.cMonFichierBitMap=".\Bitmaps\fox.bmp"
m.cStrBitmap=filetostr(m.cMonFichierBitMap)
* Écrire le fichier bitmap dans le DBF
SELECT table
REPLACE photo WITH m.cStrBitmap && champ photo de type Blob
USE
entre le SLECT table
et le REPLACE : aucune instruction de positionnement : cela suppose t il que c'est le premier enregistrement de la table qui est utilisé (et donc qu'il existe) ?
> 2° Lire le contenu d'un champ Blob à travers un contrôle image
>
> BOUTON2.Click()
>
USE table
* Lire le fichier bitmap depuis le DBF
LOCAL cStrBitmap, lcphoto
SELECT table
m.cStrBitmap=photo && champ photo de type Blob
* Le sauvegarder dans un fichier local
=STRTOFILE(m.cStrBitmap,'.\lcphoto')
thisform.Refresh()
USE
>
dans ce code du deuxieme bouton initialiser le pictureval de l'image avec le contenu du champ blob
IMAGE1.PictureVal = table.photo
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000012991