Hello Rev users!
I've built an application in Studio and I want a user to be able to upload a Jpeg or bitmap image to a card. Is this simply done?
Your help is as always, much appreciated.
Cheers
Daniel
Upload JPEG
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Upload JPEG
Hi daniel,
This is easy to do, but you can't save the changes in a standalone. There are several ways to do this.
1) Create a new image object and set the filename of the image object to the path to your file
2) Create a new image object and set the text of the image object to the contents of your file
3) Use the import paint command
You can do all this by script.
Best,
Mark
This is easy to do, but you can't save the changes in a standalone. There are several ways to do this.
1) Create a new image object and set the filename of the image object to the path to your file
2) Create a new image object and set the text of the image object to the contents of your file
3) Use the import paint command
You can do all this by script.
Best,
Mark
Last edited by Mark on Fri Apr 09, 2010 3:46 pm, edited 1 time in total.
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Upload JPEG
Hi Daniel
You can use this script
Best
Jean-Marc
You can use this script
Code: Select all
on mouseup
ImportPicture
end mouseup
on ImportPicture
answer file "Choose an image"
if it = empty then
exit ImportPicture
end if
put it into TheFile
import paint from file TheFile
end ImportPicture
Jean-Marc
https://alternatic.ch
Re: Upload JPEG
Thats excellent thank you so so much for the script.
What script would I need to delete/clear the images that have been uploaded?
Cheers
dan
What script would I need to delete/clear the images that have been uploaded?
Cheers
dan
Re: Upload JPEG
Daniel,
If the script import the imagefile by "import"
you can delete the last img
If the script use the filename (an image "MyImage" exists on the card)
You can clearing the image
Best
Jean-Marc
If the script import the imagefile by "import"
Code: Select all
on ImportPicture
answer file "Choose an image"
if it = empty then
exit ImportPicture
end if
put it into TheFile
import paint from file TheFile
end ImportPicture
Code: Select all
delete last img
Code: Select all
on ImportPicture
answer file "Choose an image"
if it = empty then
exit ImportPicture
end if
put it into TheFile
set the filename of img "MyImage" to TheFile
end ImportPicture
Code: Select all
set the filename of img "myImage" to empty
Jean-Marc
https://alternatic.ch