You are not logged in.

tommo77funk

Intermediate

  • "tommo77funk" started this thread

Posts: 159

Location: London

Occupation: Photographer

  • Send private message

1

Thursday, April 21st 2011, 12:31am

image scaling different portrait and landscape

HI,

I could'nt think about what title best to describe this problem , but please view the following link

http://bit.ly/hl7DaL

There are 2 polygon hotspots, clicking one will show a picture in the box on left, now click the other. Then please refresh the page and click both hotspots in reverse order to what you did before. The problem is if the portrait image is shown first, then when the landscape hotspot is clicked the landscape image is the same width as the portait. but when a landscape hotspot is clicked first, then the portrait image is the same dimemsions as the landscape.

I have tried scaling and width and heights paramteres both in the action and on the plugin, but neither work. I'd be very grateful should anyone have any ideas on how too accomodate this problem.

Happy easter y'all and best wishes,

tom

VN2011

Professional

Posts: 1,336

Location: Duluth MN

  • Send private message

2

Thursday, April 21st 2011, 1:20am

here you go. you had a couple of redundant actions only need 1. add a width setting and make the height proportional to the source image.

<krpano version="1.0.8.14">

<action name="show_image_painting">
set(plugin[image-painting].url,%1);
set(plugin[image-painting].width,%2);
</action>


<plugin name="painting-container"
url="%SWFPATH%/skin/menu-paintings-background.png"
keep="true" preload="false"
visible="true" enabled="true" handcursor="true" capture="true" children="true" usecontentsize="false"
zorder="2"
alpha="1.00" blendmode="normal" effect="" smoothing="true"
align="leftbottom" edge="bottom"
x="140" y="0" ox="" oy=""
width="268" height="392"
crop="" ondowncrop="" onovercrop=""
scale="1" scale9grid="" scalechildren="false"
rotate="0"
devices="all"
maskchildren="false"
pixelheight="392"
pixelhittest="false"
pixelwidth="268"
/>

<plugin name="image-painting"
url="%SWFPATH%/skin/paintings/NG1469.jpg"
keep="true" preload="false"
visible="true" enabled="true" handcursor="true" capture="true" children="true" usecontentsize="false"
zorder="5"
alpha="1.00" blendmode="normal" effect="" smoothing="true"
align="center" edge="bottom"
x="0" y="31" ox="" oy=""
width="220" height="prop"
crop="" ondowncrop="" onovercrop=""
scale="1" scale9grid="" scalechildren="false"
rotate="0"
parent="painting-container"
devices="all"
maskchildren="false"
/>

<plugin name="editor" url="plugins/editor.swf" align="bottom" x="0" y="16" />

<hotspot name="hs_ng212"
keep="false"
visible="true" enabled="true" usecontentsize="false" handcursor="true" capture="true" children="true"
zorder="0"
fillcolor ="0xffffff" fillalpha ="1.00" borderwidth ="0.0" bordercolor ="0xffffff" borderalpha ="0.00"
fillcolorhover="0xffffff" fillalphahover="0.10" borderwidthhover="0.0" bordercolorhover="0xffffff" borderalphahover="0.10"
fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700"
onclick="show_image_painting(%SWFPATH%/skin/paintings/NG212.jpg,120);"
devices="all"
editor=""
maskchildren="false"
>
<point ath="-9.863100" atv="-13.598600" />
<point ath="-9.745200" atv=" 8.717400" />
<point ath=" 8.849200" atv=" 8.723800" />
<point ath=" 8.631400" atv="-13.653600" />
</hotspot>

<hotspot name="hs_ng1469"
keep="false"
visible="true" enabled="true" usecontentsize="false" handcursor="true" capture="true" children="true"
zorder="0"
fillcolor ="0xffffff" fillalpha ="1.00" borderwidth ="0.0" bordercolor ="0xffffff" borderalpha ="0.00"
fillcolorhover="0xffffff" fillalphahover="0.10" borderwidthhover="0.0" bordercolorhover="0xffffff" borderalphahover="0.10"
fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700"
onclick="show_image_painting(%SWFPATH%/skin/paintings/NG1469.jpg,220);"
devices="all"
editor=""
maskchildren="false"
>
<point ath="55.591000" atv="-5.917100" />
<point ath="55.641100" atv=" 3.601000" />
<point ath="67.196900" atv=" 4.123500" />
<point ath="67.117500" atv="-6.520700" />
</hotspot>



</krpano>

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

3

Thursday, April 21st 2011, 2:30am

Hi Tom,

Have a look to plugin[name].onloaded and to plugin[name].resetsize()

So, add this to your <plugin name="image-painting"...

Source code

1
onloaded="resetsize();"


That seems to solve the problem...

SAlut.

tommo77funk

Intermediate

  • "tommo77funk" started this thread

Posts: 159

Location: London

Occupation: Photographer

  • Send private message

4

Thursday, April 21st 2011, 8:45am

GENIUS !!!! WOO HOO !!! Thanks VN2011 and Michel - its the best way to wake up after spending all day yesterday and last night trying to work this one out, i made so many examples, and acutally Michels onloaded="resetsize();" works even easier. I set it up as an action as i thought it would need some complex script, but both solutions are brill !!! Thanks so much for helping again - you've both made my day with this one !!!!!!!!!!

resetsize() is very interesting, I will read up and learn now

*thumbsup* nice one - have a great day !!!!

best wishes,

tom