Capture Photo (templateimage) and Send Later
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 35
- Joined: Fri Jul 18, 2014 5:17 am
Capture Photo (templateimage) and Send Later
Hi Guys,
I am trying to build an app that allows user to capture photo via Camera or choose from Library, then send the photo thru email.
My problem is that the photo capturing is on card 1, and once the user proceeds to card 2, he/she will first key in some details (e.g. name, mobile), then only he/she will click the [Send] button to send the details together with the image.
Is there a way to "pass" the templateimage on card 1 to be sent on card 2?
Thanks in advance!
I am trying to build an app that allows user to capture photo via Camera or choose from Library, then send the photo thru email.
My problem is that the photo capturing is on card 1, and once the user proceeds to card 2, he/she will first key in some details (e.g. name, mobile), then only he/she will click the [Send] button to send the details together with the image.
Is there a way to "pass" the templateimage on card 1 to be sent on card 2?
Thanks in advance!
Re: Capture Photo (templateimage) and Send Later
Hi Shoshinsha,
You should be able to reference the image directly on your 1st card. For example if you have an image object on your second card, the syntax for setting its contents to the data of the image on the first card could be-
Kind Regards,
Neil Roger
--
LiveCode Support Team ~ http://www.runrev.com
--
You should be able to reference the image directly on your 1st card. For example if you have an image object on your second card, the syntax for setting its contents to the data of the image on the first card could be-
Code: Select all
set the text of image 1 of this card to the the text of image 1 of card 1
Neil Roger
--
LiveCode Support Team ~ http://www.runrev.com
--
-
- Posts: 35
- Joined: Fri Jul 18, 2014 5:17 am
Re: Capture Photo (templateimage) and Send Later
Thanks Neil!
I'm able to do the image reference to the next card. But I could not get the image "attached" to the mail when using mobileComposeMail.
On the Mail, it's only showing the recipient email address, the subject and the email content.
Not sure what goes wrong...
Script on Card 1 (Capture image):
Script on Card 2 (Send email with attachment of the pic captured)
I'm able to do the image reference to the next card. But I could not get the image "attached" to the mail when using mobileComposeMail.
On the Mail, it's only showing the recipient email address, the subject and the email content.
Not sure what goes wrong...

Script on Card 1 (Capture image):
Code: Select all
on snap_pic
set the lockloc of the templateimage to true
set the width of templateimage to "300"
set the height of the templateimage to "400"
set the left of templateimage to "10"
set the top of templateimage to "10"
mobilePickPhoto "camera", 300, 400
wait 1 second ##I have to put this in so that the app won't black out and not responding after taking pic
put the last image into image 1 of card 1
end snap_pic
Code: Select all
on openCard
set the text of image 1 of card 1 to the text of image 1 of this card
end openCard
on send_pic
put image 1 into tAttachment["data"]
put "image/jpeg" into tAttachment["type"]
put "cam pic" into tAttachment["name"]
put "Name: " & fld "name" & cr & "Mobile: " & fld "mobile" into tMsg
mobileComposeMail "Test Send Pic","test@email.com",,,tMsg,tAttachment
end send_pic
Re: Capture Photo (templateimage) and Send Later
You interchanged the code of Neil ...
You could also reference directly the image without copying it (don't need the openCard handler).
This doesn't work if image 1 of card 1 is referenced (has a non-empty filename).
You could also reference directly the image without copying it (don't need the openCard handler).
Code: Select all
put the text of image 1 of card 1 into tAttachment["data"]
shiftLock happens
-
- Posts: 35
- Joined: Fri Jul 18, 2014 5:17 am
Re: Capture Photo (templateimage) and Send Later
Hi,
Yup. I just noticed my mistake. Thanks for the help!
Yup. I just noticed my mistake. Thanks for the help!
