Kal
Posts: 0
Joined: Thu May 22, 2014 11:03 pm

What is the API for the Image Control?

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!

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

What is the API for the Image Control?

Hi Kal,

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

Kal
Posts: 0
Joined: Thu May 22, 2014 11:03 pm

What is the API for the Image Control?

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?

Kal
Posts: 0
Joined: Thu May 22, 2014 11:03 pm

What is the API for the Image Control?

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

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

What is the API for the Image Control?

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.

Kal
Posts: 0
Joined: Thu May 22, 2014 11:03 pm

What is the API for the Image Control?

That worked! Thanks.

Return to “Issues”