You are not logged in.

81

Tuesday, July 7th 2020, 4:16pm

Hi,
thank for the reply.
I was able to achieve the desired result but still have a little problem.

I add these lines:

Source code

1
2
3
     <!--	 <action name="mysnapshot">	 if(%1 == true,set(layer[show_snapshot_UI].visible,false),set(layer[show_snapshot_UI].visible,true))	 </action> -->
    <events name="enable_snapshot_ui_check_parameters" keep="true" onnewpano="snapshot_ui_parameters_handler();"/>    <action name="snapshot_ui_parameters_handler">    ifnot(enable_snapshot_ui===null,action(get(enable_snapshot_ui)););    </action>
    <action name="show">    if(%1 == true,set(layer[show_snapshot_UI].visible,false),set(layer[show_snapshot_UI].visible,true))    </action>


Now the "get snapshot" icon appears only if I add to my url this param : enable_snapshot_ui=show.
Unlike standard behaviour the icon isn't hide when I click to enable snapshot_ui so you'll see both icons : the one used to enable snapshot_ui
and the one used to grab the screen area.
How can I prevent this?

jeromebg

Professional

  • "jeromebg" started this thread

Posts: 849

Location: Angers - France

Occupation: Photographer

  • Send private message

82

Wednesday, July 8th 2020, 10:30am

you must use myspanshot action to do something when snapshot UI is displayed or hidden : https://krpano.com/plugins/userplugins/s…pshot%28true%29

83

Wednesday, July 8th 2020, 11:00am

Hi Jerome,
I know but my trick was to bypass that action to have the full control.
Maybe exist a better solution than the one I found but I really can't imagine which is..

I need to activate panoshot only when specific url parameter is present.
I simply declare an event to parse url parameter and then, if param exist, I use his value as name of action to call (in my sample "show" action which is the same of mysnapshot).
I cannot do that using mysnapshot because the script call it automaticly (which is not my desired behaviour).
How can I do that alternatively?


P.s. Testing this feature on real server (php-fpm 7.2, apache 2.4.49) your savescreenshot.php raise a lot of warnings if you disable watermark. Those warnings lock the vtour.
I made this changes:


Source code

1
2
3
4
if ($stamp) {
	$sx = imagesx($stamp);
	$sy = imagesy($stamp);
	imagealphablending($stamp,false);	imagesavealpha($stamp,true);	imagecopy($im, $stamp, imagesx($im) - $sx - $marge_right, imagesy($im) - $sy - $marge_bottom, 0, 0, imagesx($stamp), imagesy($stamp));}

84

Friday, July 10th 2020, 4:15pm

solved!

Source code

1
2
3
4
5
<action name="mysnapshot">
ifnot(enable_snapshot_ui===null, 
 if(%1 == true,set(layer[show_snapshot_UI].visible,false),set(layer[show_snapshot_UI].visible,true)) 
 ) 
 </action>



where enable_snapshot_ui is the url parameter, simpler then expected!

This post has been edited 1 times, last edit by "sbraaa" (Jul 10th 2020, 4:40pm)


Similar threads