Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Displaying Photos

Hi,

I have used this tutorial with much success..

http://devcenter.appery.io/tutorials/...

However the resultant picture is showing on the screen in a stretched square (see screenshot). I want to be able to:

  1. Show it as a small icon preview in correct dimensions in the list; and

  2. When I click on the photo show the full screen version in the correct dimensions.

    Image

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Displaying Photos

Aeneas,

You may programmatically determine the actual size of the picture:
http://stackoverflow.com/a/626505
And programmatically set proportional to the dimensions of the Image component which will display picture.

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Displaying Photos

I want to be able to click on a list item in a list of photos and show that photo in full size on another screen. Can I add the list item image asset value to a localStorage variable and then assign it to the image on next page?

On list item click I'm doing this but its not working....

var previewpic=Appery('imgPhotoPrev').asset();
localStorage.setItem('currentPhoto',previewpic);

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Displaying Photos

Aeneas,

Is imgPhotoPrev the name of the picture inside list item? Then you should try this code on click on list item:
prevar previewpic = $(this).find("[dsid=imgPhotoPrev]").attr("src");
localStorage.setItem('currentPhoto',previewpic);/pre

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Displaying Photos

Hi,

I'm going back to this question but want to click on the actual picture and show it in a popup as full size. I'm getting undefined as a result of the below code on the image click event.

localStorage.setItem("photoBuffer",$(this).find("[dsid=imgHorsePreview]").attr("src"));

Thanks,
Aeneas

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Displaying Photos

Hello Aeneas,

Could you please you provide a screenshot with error from browser console ?

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Displaying Photos

I run this code on click of picture and then map the localStorage variable to the popup image but get the following screenshots with no picture in the popup...

localStorage.setItem("photoBuffer",$(this).find("[dsid=imgHorsePreview]").attr("src"));
alert(localStorage.getItem("photoBuffer"));

Image Image

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Displaying Photos

Aeneas,

Please just use
$(this).attr("src"); instead of $(this).find("[dsid=imgPhotoPrev]").attr("src");

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Displaying Photos

The picture is now opening in the popup however I want the popup to be 90% the size of the screen and the image to fit the popup and keep its ratio. How do I do this? The setting I've used so far (using auto or 100% on image) its too big for the popup.

THanks,
Aeneas

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

Displaying Photos

Hi Aeneas,

ol
liYou can't make popup to be 90% of screen size and keep image's ratio at the same time, you'll need to make it to fit by width./li
liThe overall size of a Popup component is depending on its content, thus the bigger the image - the bigger popup is./li
liIf you need a dynamic changing of your image's size, then you should write a custom JavaScript code, but please don't forget that writing and debugging custom JavaScript code are outside of the support scope
http://devcenter.appery.io/support-po.../li
/ol

Return to “Issues”