You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Tuesday, March 31st 2009, 3:08am

Snapshot of current view

i'm trying to create a snapshot of the current view like on gigapan.org to let users comment on a pano.
i've never done anything with flash before but i've managed to get a plugin working and to create a jpg of a local movie (in the plugin.swf)

But as far as i can tell by now i don't have access to the main movie in krpano.swf from my plugin....
or is there a way?

or maybe Klaus can add this feature to his ever-growing todo-list? ;-)

thx for your help and kudos for this great program!

2

Tuesday, March 31st 2009, 2:50pm

I did it!

I can save the current view to a jpg!!! *g* *g* *g*

it works like this:
- load snapshot-plugin
- call snapshot function in plugin
->plugin creates a jpg of currentview
->plugin sends jpg to a php page which saves the image

if someone is interested i can give some more infos but my code is really messy and needs some major cleaning *whistling*
and i need a break, i didn't get much sleep *pinch*

Shanti

Intermediate

Posts: 301

Location: Puerto Vallarta

Occupation: Web Developer

  • Send private message

3

Tuesday, March 31st 2009, 8:16pm

I would like to take a look at the code if you don't mind :D or even release the plugin sounds like a very good one :D

Graydon

Professional

Posts: 614

Location: Texas

Occupation: Industrial gas turbine services.

  • Send private message

4

Tuesday, March 31st 2009, 8:25pm

I'm not sure I have an immediate need for something like this... but it sounds very interesting and I'd love to see a sample / demo.

5

Wednesday, April 1st 2009, 4:29am

demo / source

i put a demo of the snapshot plugin together.
because it needs a php script i included a small webserver (QuickPHP) for easy testing.
just download the self-extracting 7z exe, execute it and start "start pano.bat"
(nothing is installed/saved, everything runs in the directory)

this demo is as simple as possible. my "development" version has a gui where the user can enter his name and a comment (like gigapan.org) and everything is done with AJAX so there is no need to leave/reload the pano.

please leave a comment if the demo works

link: http://paperlapub.ch/download/snapshot_plugin.exe (~3MB)

This post has been edited 2 times, last edit by "RedSpawn" (Apr 1st 2009, 1:01pm)


Graydon

Professional

Posts: 614

Location: Texas

Occupation: Industrial gas turbine services.

  • Send private message

6

Wednesday, April 1st 2009, 5:53am

do you have a demo site / active site online where we can see / try / play with this?

I can kinda see some good uses for something like this (now that I've thought about it).. *smile*

7

Wednesday, April 1st 2009, 12:54pm

i don't have a license for krpano (yet) so there is no online demo ;-)

Zephyr

Professional

Posts: 994

Location: Netherlands

Occupation: Web developer

  • Send private message

8

Wednesday, April 1st 2009, 1:40pm

Wow, this is amazing. With a few alterations and some fine tuning I could use this. It was somewhere on my todo list after seeing the snapshot function in earthmine. I'm going to build that snapshot, rescalable map and the searchpane as a plugin :)

For those wondering what eartmine is: http://www.youtube.com/watch?v=PHjwRImYVDI (the snapshot feature is around 2.35min) Its like streetview on steroids

A Question: It uses stage.root as the area for taking the snapshot. If I set the dimensions of the picture to say like 800x600 and the stage is like 400x300. Does it upscale the picture?

And for Klaus. As I can seen now, the plugin uses the screen data to build the image (iow its like a printscreen function) Is it possible to access the data of the loaded tiles in that view from krpano. If that's possible it allows for a highresolution snapshot, people could look around and take a snapshot and for instance use it as a wallpaper.
3d childrens game using krpano Game
Minify your xml with my krpano XML Compressor
Krpano XML Parsing Error Checklist
Available for hire (krpano xml, javascript, actionscript, flash, php and ipad plugins).

9

Wednesday, April 1st 2009, 3:31pm

unfortunately you can't set a different size for the image in flash. what it does is it copies each pixel from the stage to the image, so if you would make a smaller image you would only get a part of the stage.

but that is something i will look into because currently the whole image is sent to the server and scaled by the php script. it would be much faster to resize the image in flash and send only the small thumbnail.

but like i mentioned before, i've never done anything with flash so i have to digg around

Zephyr

Professional

Posts: 994

Location: Netherlands

Occupation: Web developer

  • Send private message

10

Thursday, April 2nd 2009, 2:47pm

Uhm, wouldn't be that hard, I think. you have this now:
var jpgSource:BitmapData = new BitmapData (stage.stageWidth, stage.stageHeight);
jpgSource.draw(stage.root);

Adding a scalefactor:
var jpgSource:BitmapData = new BitmapData (stage.stageWidth, stage.stageHeight);
jpgSource.draw(stage.root);
var ResizedJpg:BitmapData = new BitmapData(jpgSource.width * 0.5, jpgSource.height * 0.5)
ResizedJpg.draw(jpgSource)

Now it stores the big image in jpgsource and the resized one in ResizedJpg. Upload the Resized one and then dispose them both. I think this should work, though I've not tested it :)
3d childrens game using krpano Game
Minify your xml with my krpano XML Compressor
Krpano XML Parsing Error Checklist
Available for hire (krpano xml, javascript, actionscript, flash, php and ipad plugins).

11

Friday, April 3rd 2009, 1:23am

i don't think your code would work, or you could just define the first image (jpgSource) with the smaler size, but like i said it's just copying data, so only a part of the image is copied and nothing is scaled

but i guess it's not that hard if u know actionscript, it's just a mater of finding the function for resizing bitmapdata

i have no time right now but i will work it out this weekend

Zephyr

Professional

Posts: 994

Location: Netherlands

Occupation: Web developer

  • Send private message

12

Friday, April 3rd 2009, 7:25pm

Yes you're correct, It doesn't grab a pigger picture, It still uses the stage. But you said that it would be much faster if flash scaled the image and then upload it instead of php. This tiny alteration stores the bigimage in a temporary bitmap data and then put the bitmapdata back in a new one. I found an example on the website of Adobe, although this is explained with flash 8 and AS 2.0. http://www.adobe.com/devnet/flash/articles/image_api_04.html

And with flash 10, and the FileReference Class you can even cut out the php part. Example: http://blog.onebyonedesign.com/?p=67
3d childrens game using krpano Game
Minify your xml with my krpano XML Compressor
Krpano XML Parsing Error Checklist
Available for hire (krpano xml, javascript, actionscript, flash, php and ipad plugins).

13

Saturday, April 4th 2009, 9:58am

Hi,

what a great plugin!
(I have planned such for a long time but never found the time for it )

about the resizing - this should work:
- create a "Bitmap" object and assign it to the BitmapData of your source image
- scale this "Bitmap" by setting it's with and height
- draw(render) this "Bitmap" down to a other "BitmapData"

Source code

1
2
3
4
5
6
7
var bitmap:Bitmap = new Bitmap( original_bitmapdata );

bitmap.width = scaled_width;
bitmap.height = scaled_width;

var scaled_bitmapdata:BitmapData = new BitmapData(scaled_width, scaled_width, true, 0);
scaled_bitmapdata.draw( bitmap );


best regards,
Klaus

vincen

Trainee

Posts: 69

Location: Grenoble, France

Occupation: Photo, ski, walk, outdoor activities

  • Send private message

14

Tuesday, February 8th 2011, 12:13pm

an updated working version of that plugin ? as I'd really like to use it :)

Thanks,

Vincèn
http://www.skivr.com (my blog)
http://magasin.skivr.com (my online shop for all panoramas and photography stuffs)

Tuur

Sage

Posts: 3,154

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

15

Tuesday, February 8th 2011, 1:06pm

Hi,

sounds nice but i'm on mac..

what to do?

Can you profide a mac download or something?


Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

vincen

Trainee

Posts: 69

Location: Grenoble, France

Occupation: Photo, ski, walk, outdoor activities

  • Send private message

16

Tuesday, February 8th 2011, 1:12pm

sounds nice but i'm on mac..
what to do?
Can you profide a mac download or something?

You can test it on mac easily I just did it :) you just have to unzip the whole stuff and copy it in your Sites folder and activate webserver of mac osx :)

It looks nice but it has two main defaults:
  • impossible to recall snapshot created
  • need to reload panorama to get snapshot list updated


So it's nice but would need improvement to be used in production !

Vincèn
http://www.skivr.com (my blog)
http://magasin.skivr.com (my online shop for all panoramas and photography stuffs)

Tuur

Sage

Posts: 3,154

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

17

Tuesday, February 8th 2011, 1:47pm

Vincen,

merci pour votre reaction..

je reste pour le developement.. (?)

;-)

Thanx

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

18

Wednesday, September 5th 2012, 4:32pm

Hi! What about this?

Nobody finish the pluggin?