Page 1 of 1

What is the API for the Image Control?

Posted: Wed Jul 16, 2014 4:55 am
by Kal

Hi, the documentation does not give the API for the Image Control. I need to assign a picture that I have stored in a local variable "photo_buffer" to myImageControl. I would imagine it is something like

Appery('myImageContol').setAsset(localStorage.getItem('photo_buffer'));

But, I am only guessing... what is the way to do this?

Thanks!


What is the API for the Image Control?

Posted: Wed Jul 16, 2014 5:13 am
by Illya Stepanov

Hi Kal,

Could you please clarify what documentation do you mean? And what is Image Control?


What is the API for the Image Control?

Posted: Wed Jul 16, 2014 5:55 am
by Kal

Hi, Illya:

I am talking about this: http://devcenter.appery.io/documentat...

On the same doc page, for some of the other components such as Button and Input API examples are given to get and set properties using Appery('xxxx').yyyy etc. But, for the Image component, I don't know how to set the image from a localStorage buffer.

Does that make more sense now?


What is the API for the Image Control?

Posted: Wed Jul 16, 2014 11:09 pm
by Kal

Any progress on this? I know it is marked "Answered" but it was not, just another question was raised...


What is the API for the Image Control?

Posted: Wed Jul 16, 2014 11:38 pm
by Alena Prykhodko

Hello,

How do you store image in localStorage? Is it image path?

So, you need to set this path as attribute.
This is pretty standard JavaScript, you can always search online how to implement this.

Use this code to set Image src attribute:
preAppery("mobileimage").attr("src",localStorage.getItem('ImagePath'));/pre

mobileimage - image component name;
ImagePath - localStorage variable with path.


What is the API for the Image Control?

Posted: Thu Jul 17, 2014 1:07 am
by Kal

That worked! Thanks.