PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 2024 → Image retournée dans fichier HF
Image retournée dans fichier HF
Débuté par ChouLAGH, 21 déc. 2018 17:44 - 1 réponse
Membre enregistré
251 messages
Popularité : +1 (1 vote)
Posté le 21 décembre 2018 - 17:44
Bonjour,
Dans une application windev mobile 24, je dois enregistrer une image dans un fichier HF C/S
l'utilisateur : soit choisit une image dans la galerie dans le téléphone, soit il prend une photo avec le tél.
=======================
LE PROBLEME : l'image s'affiche correctement dans un champ image et j'ai 2 boutons pour la tourner si nécessaire
(drotation). Mais lorsque j'enregistre l'image dans le fichier HF : L'IMAGE EST RETOURNEE DANS LE FICHIER HF
UNIQUEMENT LORSQU'ELLE A ETE PRISE PAR LE TEL. OK QUAND CHOISIE DANS GALERIE !!!!
======================
Dans la fenêtre, j'ai 3 boutons et un champ image : IMG_photo
===================
un bouton pour sélectionner une image dans la galerie avec ce code :
===================
IMG_photo=""
SI EnModeTest()=Faux ALORS
// Sélection de l'image
CheminImage est une chaîne
CheminImage = AlbumSélecteur(albumImage)
SI CheminImage="" ALORS
IMG_photo=""
SINON
IMG_photo=CheminImage
FIN
FIN
===================
un bouton pour prendre une photo avec ce code :
===================
IMG_photo=""
sPhoto est une chaîne
SI EnModeTest()=Faux ALORS
sPhoto = VidéoLanceAppli(viCaptureImage)
SI sPhoto <> "" ALORS
IMG_photo=sPhoto
FIN
FIN
===================
un bouton enregistrer l'image dans le fichier HF avec ce code :
===================
//
// Enregistrer la photo dans la table photo
//
SI IMG_photo="" ALORS
ToastAffiche("Pas de Photo !!!",toastCourt,cvMilieu,chCentre)
SINON
SI gsIdAdherent="" ALORS
ToastAffiche("Pas de Photo !!!a",toastCourt,cvMilieu,chCentre)
SINON
//
// enregistrer la photo pour l'adhérent : pas attachée à un trombino : à voir sur le web
//
HRAZ(PhotosAdherent)
//PhotosLocal.IDPhotos
PhotosAdherent.IDAdherents=gsIdAdherent
PhotosAdherent.datePhoto=DateDuJour()
PhotosAdherent.heurePhoto=HeureSys()
PhotosAdherent.nom=SansEspace(SAI_NOM)
PhotosAdherent.prenom=SansEspace(SAI_prenom)
//PhotosLocal.photo=HAttacheMémo(PhotosLocal, photo, IMG_photo, hMémoImg)
HAttacheMémo(PhotosAdherent,photo, IMG_photo,hMémoBin)
HAjoute(PhotosAdherent)
ToastAffiche("Photo enregistrée sur "+RC+"Plateforme et "+RC+"Galerie Téléphone",toastCourt,cvMilieu,chCentre)
FIN
FIN
====================================

Merci d'avance pour votre aide.

--
Chouaïb
Membre enregistré
251 messages
Popularité : +1 (1 vote)
Posté le 21 décembre 2018 - 18:22
J'AI RESOLU LE PB si ça peut aider :
En regardant bien la doc : il faut après avoir pris une photo ou avoir choisi une image dans la galerie, utiliser la fonction VidéoGénèreMiniature(....)
=========
Exemple pour la prise d'une photo :
=========
IMG_photo=""
sPhoto est une chaîne
sMiniature est une chaîne
SI EnModeTest()=Faux ALORS
// prendre la photo avec le smartphone
sPhoto = VidéoLanceAppli(viCaptureImage)
SI sPhoto <> "" ALORS
// générer une photo miniature
sMiniature = fExtraitChemin(sPhoto, fDisque + fRépertoire + fFichier) + "_thumb.jpg"
SI VidéoGénèreMiniature(sPhoto,sMiniature)=Faux ALORS
Erreur("Impossible de générer la miniature.", ErreurInfo())
SINON
IMG_photo=sMiniature
FIN
//IMG_Photo=sPhoto
FIN
FIN

--
Chouaïb