Page 1 of 2
Load image to image ui component
Posted: Sat Oct 05, 2013 8:12 pm
by Pasteur Miranda
Hi,
I post a similar question yesterday, but I think it was bad understood. I use an image UI component in one of my pages. I set the image to be used in this component choosing the image from asset button. I would like to load the image in "runtime", that is, the user chooses the image and I load the image to the image UI component. I could not find the command to be used to load the image (for instance, using Appery.getImagePath("name image")) to the UI component. Could you help me?
Thanks a lot
Load image to image ui component
Posted: Sat Oct 05, 2013 8:42 pm
by Alena Prykhodko
Hi!
You will need to think logic of this part, the following can help http://docs.appery.io/documentation/w...
This code returns the image URL by its name, so you can use it:
preAppery.getImagePath("imagename");/pre
Load image to image ui component
Posted: Sat Oct 05, 2013 9:13 pm
by Pasteur Miranda
Hi Alena, thank you for you quick reply. I'd like to load the image to the image component in the load event of the page. So I need some hint on how to set the image path to the image component using Appery.getImagePath("imagename").That is, I need some code inside load event javascript to link the image component to the image path, so that I can set and show the image in runtime.
Thank you
Load image to image ui component
Posted: Sat Oct 05, 2013 9:44 pm
by Igor
Hi,
It should be something like this:
pre
Appery('mobileimage_2').attr('src', ' '+ Appery.getImagePath("query.png")+' ');
/pre
Where "mobileimage_2" - image component name.
Load image to image ui component
Posted: Tue Oct 08, 2013 9:35 pm
by Pasteur Miranda
Thank you Igor, your hint was very helpful!
Load image to image ui component
Posted: Tue Oct 08, 2013 10:08 pm
by Helen
Hello, I have a related question.
I'm creating a mobile app which will initially download and store all data locally in sqlite database.
I'm unsure WHERE in the file system I need to store MEDIA files (ie, photos, video) so that my mobile app can access them.
IE, if I have a photo, does this photo need to be stored in a specific folder so that Appery can find it?
Appery.getImagePath("photo1.jpg");
Thanks!
Load image to image ui component
Posted: Tue Oct 08, 2013 10:34 pm
by maxkatz
You could store the photos in the app. The videos you would need to host on the Internet and link in your app.
Load image to image ui component
Posted: Tue Oct 08, 2013 10:40 pm
by Helen
Thanks for quick reply.
Sorry, I do not understand, where exactly in the file system do I put them to 'store the photos in the app'?
Why can I not store videos locally?
Load image to image ui component
Posted: Tue Oct 08, 2013 11:14 pm
by maxkatz
You can upload images via the Image component, http://docs.appery.io/documentation/u...
There is currently no option to upload a video into the app. One of the reason is that the app will become very big very fast. It's best to host the images in the cloud and link to them.
Load image to image ui component
Posted: Tue Oct 15, 2013 9:28 pm
by Helen
Hi again,
My previous question:
Sorry, I do not understand, where exactly in the file system do I put them to 'store the photos in the app'?
I'm referring to where to store photos for dynamically built pages.. pulling detail info based on current ID.
(As opposed to building a static page, placing an image, and setting the path.)
Thanks!