Page 1 of 1

Uploading an image

Posted: Tue Apr 28, 2015 11:25 pm
by garry_sonicdc
Hi everyone, I'm still fairly new to LiveCode so I'm struggling to know how to explain my problem correctly, but here it goes...

I'm building an Invoice Creator program for Windows, you input the data for your invoice into fields on a card and then click a button which creates a PDF of the invoice. That all works fine.

What I want to provide is an option for the end user to upload an image which can replace the default image that is on the final invoice PDF. Basically giving them the option to have there own logo on their invoices.

Is this even possible? I'm not entirely sure what I would search for to get some help, hence why I've resorted to posting in here.

Either an actual solution or a nudge in the right direction would be of great help!

Re: Uploading an image

Posted: Wed Apr 29, 2015 1:41 am
by sefrojones
Try this out:

Create a new stack with a button and an image area.

In the button put this script:

Code: Select all

on mouseUp
   answer file "select an image"
   put it into tPicPath
   set the filename of img 1 to tPicPath
end mouseUp

Hope this helps.

--Sefro

Re: Uploading an image

Posted: Wed Apr 29, 2015 8:39 am
by dave.kilroy
Hi Garry - you wrote "upload an image" - do you want to upload it to a server or use in your app? Both are very doable and Sefro showed one way to do the latter, uploading to the server takes more work...

Kind regards

Dave

Re: Uploading an image

Posted: Mon May 04, 2015 6:58 pm
by garry_sonicdc
Thanks Sefro,

This has worked perfectly!

Thanks to Dave too, not quite ready to be using servers just yet though!