How to add Banner at bottom of image

Getting into LiveCode for iOS? Ask your questions here.

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
trags3
Posts: 294
Joined: Wed Apr 09, 2014 1:58 am
Location: Las Vegas, NV

How to add Banner at bottom of image

Post by trags3 » Mon Jul 01, 2019 10:15 pm

Hello again,
I have a mobile app that can take a picture using the camera. I want to add a banner to the bottom of the picture and then email it. Is this possible?
Tom

trags3
Posts: 294
Joined: Wed Apr 09, 2014 1:58 am
Location: Las Vegas, NV

Re: How to add Banner at bottom of image

Post by trags3 » Tue Jul 02, 2019 7:03 pm

Hi All,
I decided to put the banner on top of the image, Print to PDF and email or text it.
That will work for me in my application. Won't work on Android, however.
Tom

mrcoollion
Posts: 391
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

Re: How to add Banner at bottom of image

Post by mrcoollion » Tue Jul 02, 2019 7:18 pm


simon.schvartzman
Posts: 299
Joined: Tue Jul 29, 2014 12:52 am
Location: Brazil

Re: How to add Banner at bottom of image

Post by simon.schvartzman » Tue Jul 02, 2019 9:31 pm

Hi Tom, I have an app that does what you want (picture with banner) and works on both iOS and Android. I'm able to share the image through email, text, etc (never tried PDF).

I'm using basically the approach pointed out by @mrcoollion (group all the pieces together and then export the group).

Maybe I can help if you share your basic code or even if you explain better what you mean by "Won't work on Android, however"

Best
Simon
________________________________________
To ";" or not to ";" that is the question

trags3
Posts: 294
Joined: Wed Apr 09, 2014 1:58 am
Location: Las Vegas, NV

Re: How to add Banner at bottom of image

Post by trags3 » Thu Jul 04, 2019 1:06 pm

Hi Simon,
I have a field with a banner at the bottom.
Here is the code I used.
mobilpickPhoto "camera" , 750,500
if the result is text then
put the result into img"the_Image"
show img"ban.jpg" ---This is the banner
set the level of img"ban.jpg" to 10 ----This insures the banner is on top
Then when I want to send the picture I hide the controls on the card and print the card to pdf

It's pretty clumsy but works.
What I meant by won't work on android is "Print to PDF" isn't available on android.
I like mrcoollion's solution much better.
Cheers

Klaus
Posts: 11009
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: How to add Banner at bottom of image

Post by Klaus » Thu Jul 04, 2019 2:10 pm

trags3 wrote:
Thu Jul 04, 2019 1:06 pm
...
set the level of img"ban.jpg" to 10
...
I know you mean LAYER, of course! But this (LEVEL) works? :shock:
Did not find it in the dictionary nor does it give any result when querying -> put the level of btn 1

I do not own any mobile device and I am always surprised how users use a syntax NOT described in the dictionary and which obvioulsy works (does it really?)! :-D

From the dictionary
...
If the source type is not available on the target device, the command returns with result source not available. If the user cancels the pick, the command returns with result cancel. Otherwise a new image object is created on the current card of the default stack containing the chosen image.
...
Means to me, since "cancel" and "source not available" is also text, this line will do not what you want:

Code: Select all

...
if the result is text then
...
So I would script this in case of success:

Code: Select all

...
if the result = EMPTY then
...
And the command will automatically create a new image object on oyur card, so this "should" not work, too:

Code: Select all

...
put the result into img "the_Image"
...
Very puzzling!

trags3
Posts: 294
Joined: Wed Apr 09, 2014 1:58 am
Location: Las Vegas, NV

Re: How to add Banner at bottom of image

Post by trags3 » Mon Jul 08, 2019 5:28 pm

Hi Klaus,
Thanks, After the holiday I have checked my code.
The "level" statement was indeed "Layer" I was in a hurry when I posted. Don't know if "level" works or not! :D
The statement

put the result into img "the_Image"

does work but I think that is because I have an Image object named "the_Image".
I will clean things up!
Thanks all again!
Tom

Post Reply

Return to “iOS Deployment”