PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV Mobile (earlier versions)
→
Photo prise par Champ Caméra est affiché incliné dans un champ Image Windev Mobil
Photo prise par Champ Caméra est affiché incliné dans un champ Image Windev Mobil
Started by Hervé, Jan., 24 2024 8:55 AM - 4 replies
Connect yourself…
Hervé
#1
Posted on January, 24 2024 - 8:55 AM
Photo prise par Champ Caméra est affiché incliné dans un champ Image Windev Mobil
Bonjour,
Sachant que les fonctions exif wlangage (Windev Mobile 23), ne fonctionnent pas encore sur mobile et après prise de photo avec récupération de son chemin, redimensionnement, et affichage dans un champ image, celle-ci fait une rotation de 90 °
Gaêl a écrit une procédure Java sur ce forum qui résout ce souci.
Je n’ai jamais utilisé de procédure Java, je ne sais donc pas la mettre en œuvre, et l’appeler.
Mon code : (qui ne fonctionne pas…), je ne vois pas où je me plante….
// **************************
SI sCheminImage<>"" ALORS
NewImage = dChargeImage(sCheminImage)
dRedimensionne(NewImage, 140,180)
SI PAS EnModeSimulateur () ALORS
exifRotation(NewImage)
FIN
IMG_Image = NewImage
FIN
// *************************
sCheminImage étant le chemin de la photo prise
NewImage étant une chaine de caractère.
exifRotation le nom de la procédure globale Java qui suit.
Voici la procédure Java.
// *************************
import android.media.ExifInterface;
import java.io.IOException;
public static int exifRotation(String filepath) {
int rotation = 0;
try
{
ExifInterface exifInterface = new ExifInterface(filepath);
int exifRotationInt = exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_UNDEFINED);
if(exifRotationInt != ExifInterface.ORIENTATION_UNDEFINED)
{
switch(exifRotationInt)
{
case ExifInterface.ORIENTATION_ROTATE_90 :
rotation = 90;
break;
case ExifInterface.ORIENTATION_ROTATE_180 :
rotation = 180;
break;
case ExifInterface.ORIENTATION_ROTATE_270 :
rotation = 270;
break;
}
}
}
catch(IOException e){}
return rotation;
}
// *************************************
Merci de votre aide.
Cordialement
Hervé
Report
0
0
Popoy
#2
Registered member
3,349 messages
Popularité : +93 (137 votes)
Posted on January, 24 2024 - 1:22 PM
https://doc.pcsoft.fr/fr-FR/?9000011
Report
0
0
Hervé
#3
Posted on January, 25 2024 - 7:37 AM
Merci beaucoup Popoy pour votre réponse.
J'ai donc bien créé la procédure Java et recopié le code.
Mais cela ne fonctionne toujours pas ...
Je pense que je fais deux erreurs :
1- Lors de la compilation pour Android, dois-je incorporer quelque chose de plus ?
2- Mon code appelant la procédure est-il correct, Bien placé ?
Merci de votre aide.
Bien cordialement
Hervé
Report
0
0
Popoy
#4
Registered member
3,349 messages
Popularité : +93 (137 votes)
Posted on January, 25 2024 - 9:01 AM
Salut
Le code java ne fait que renvoyer un entier et il faut lui transmettre le chemin de l'image
Pour vérifier la valeur retourné, tu peux la mettre dans un champ de saisie ou faire un info
Personnellement j'aurais utilisé la fonction dRotation dans le code wlanguage pour tourner l'image
Je ne vois pas comment un entier peut le faire.
Du coup j'ai cherché sur le forum
https://forum.pcsoft.fr/fr-FR/pcsoft.fr.windevmobile/38203-help-photo-qui-apparait-avec-rotation-39087/read.awp
Ce code wlanguage me paraît mieux
Message modified, January, 25 2024 - 9:11 AM
Report
0
0
Hervé
#5
Posted on January, 25 2024 - 10:06 AM
Merci 1000 fois Popoy.
Cela fonctionne parfaitement.
Je t'envoie un peu de soleil de Thaïlande.
Encore merci
Report
0
0
→ Go back to WINDEV Mobile (earlier versions)
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (earlier versions)
WEBDEV (earlier versions)
WINDEV Mobile (earlier versions)
Reports & Queries
Off-topic
Tools
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text