FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV Mobile 2024
→
[WM 26] Android 11 access to device photo album
[WM 26] Android 11 access to device photo album
Débuté par Claire, 21 avr. 2022 19:32 - Aucune réponse
Connectez-vous…
Claire
#1
Membre enregistré
48 messages
Posté le 21 avril 2022 - 19:32
I have a button in my app that is supposed to open up the device photo album so that you can select an image from your photos. With Android 11, it seems like AlbumPicker doesn't work? I've tried a few methods listed like adding in a notification and what not but I can't seem to find anything that works. All I need is for the button to open up the photo album on the device and allow you to select a photo. Then the rest of the code creates a copy of the image and adds it in the app. It's worked just fine up until now (Android 11)
Below is my original code...
s
TempPhoto is string
s
ReducedSizePhoto is string
s
Thumb is string
s
TempPhoto
=
""
s
TempPhoto
=
AlbumPicker
(
)
IF
s
TempPhoto
=
""
THEN
Error
(
ErrorInfo
(
)
)
RETURN
E
ND
HourGlass
(
True
)
ProcessPhoto
(
s
TempPhoto
)
E
XPRESS_WIN_REPORT.IMG_TMP
=
s
TempPhoto
s
ReducedSizePhoto
=
gs
TempDir
+
"r500kb_"
+
DateSys
(
) +
"_"
+
TimeSys
(
) +
".jpg"
IF
fSize
(
s
TempPhoto
) >
500000
THEN
//bytes
IF
dSaveImageJPEG
(
E
XPRESS_WIN_REPORT.IMG_TMP
,
s
ReducedSizePhoto
,
50
) =
False
THEN
Error
(
ErrorInfo
(
)
)
E
ND
E
LSE
fCopyFile
(
s
TempPhoto
,
s
ReducedSizePhoto
)
E
ND
//fDelete(sTempPhoto)
s
Thumb
=
E
XPRESS_WIN_REPORT.GiveMiniatureName
(
s
ReducedSizePhoto
)
CreateMiniature
(
s
ReducedSizePhoto
,
s
Thumb
)
IF
gn
CurrentObsPicturesTaken
=
0
THEN
gs
TempPhoto1
=
s
ReducedSizePhoto
E
XPRESS_WIN_REPORT.IMG_Photo1
=
s
Thumb
E
LSE
gs
TempPhoto2
=
s
ReducedSizePhoto
E
XPRESS_WIN_REPORT.IMG_Photo2
=
s
Thumb
E
ND
HourGlass
(
False
)
gn
TotalPicturesTaken
=
gn
TotalPicturesTaken
+
1
gn
CurrentObsPicturesTaken
=
gn
CurrentObsPicturesTaken
+
1
E
XPRESS_WIN_REPORT.STC_Photo_Counter
=
"# Saved photos: "
+
gn
TotalPicturesTaken
+
" Max allowed: 20"
Close
(
WIN_
PHOTO_SOURCE
)
Signaler
0
0
→ Revenir à WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte