Sie sind nicht angemeldet.

1

Dienstag, 1. Juni 2021, 18:04

How to mekescreenshot_hires() with different resolution according to camera resolution

Hello everyone,

I'm using this example : https://krpano.com/docu/plugininterface/….makeScreenshot. It work's well to have a 4000 x 2250 resolution, however a Z1 image (RICOH THETA camera) has better resolution (6720 x 3360) than SC2 image (3840 x 1920).

My first question is
How can I have correct width and height of mekescreenshot_hires() according to the device. I can't set 4000 * 2250 for all captured image because I would like to have different size beetween my original image (can be equal to 7000 x 3500 or 5376 x 2688 or smaller) and image that was made by makescreenshot_hires(). Is it possible ?

My second question is
I put code generated by krpano. So, multires="512,1024,2176", how can I convert "2176" (multires value) to flat image ?

Quellcode

1
2
3
4
5
<preview url="preview.jpg" /><image prealign="-0.00|38.40|-0.00" if="!(webvr.isenabled OR device.mobilevr)">
	<cube url="%s/l%l/%v/l%l_%s_%v_%h.jpg" multires="512,1024,2176" />
</image><image prealign="-0.00|38.40|-0.00" if="webvr.isenabled OR device.mobilevr">
	<cube url="vr/pano_%s.jpg" />
</image>



Thank's a lot

2

Donnerstag, 3. Juni 2021, 09:23

Hi,

you can render a 'screenshot' in any resolution you want, but you're will be limited by the browsers/systems max. WebGL renderbuffer size (on low-end of mobile devices typically 4096x4096, on desktop systems typically 16384x16384).

The resolution of the source image doesn't matter for that and the resolution of the camera even more not. The field-of-view and projection is also something to consider here!

For loading the tiles from a certain resolution for the screenshot, have a look at the included screenshot example and there at the 'makescreenshot_hires' action:
https://krpano.com/examples/#makescreenshot-api

Best regards,
Klaus

3

Donnerstag, 3. Juni 2021, 10:48

How to get max capture size according browsers/systems

Thanks for your reply @Klaus,


how can I get max capture size according browsers/systems, I mean which params should I have to define max size. You told : "you want, but you're will be limited by the browsers/systems max", so I need to know which device (desktop or mobile), what are the others params/limitations that allow me to define max size.


Thank's a lot for your explation

4

Donnerstag, 3. Juni 2021, 11:05

Hi,

if your aim is rendering a screenshot in the maximum possible resolution on a certain device, just use a very large size, krpano will then automatically (proportionally) reduce the size to the max possible one.

But for manually getting the max supported size, this piece of Javascript code can be used:

Quellcode

1
2
var gl = krpano.webGL.context;
var max_renderbuffer_size = gl.getParameter( gl.MAX_RENDERBUFFER_SIZE );


Then the max_renderbuffer_size variable will contain the maximum width or height.

More details here:
https://krpano.com/docu/plugininterface/#krpanowebglapi

Best regards,
Klaus

5

Donnerstag, 3. Juni 2021, 12:07

Trying set max_renderbuffer_size

I tried to use

Quellcode

1
krpano.webGL.context.getParameter( gl.MAX_RENDERBUFFER_SIZE )
but when downloading image I got different size. I show you my code :



Quellcode

1
2
3
4
5
6
7
var gl = krpano.webGL.context;
var max_renderbuffer_size = gl.getParameter( gl.MAX_RENDERBUFFER_SIZE );
screenshotwidth = max_renderbuffer_size;

screenshotheight = max_renderbuffer_size / (16/9);

var screenshotcanvas = krpano.webGL.makeScreenshot(screenshotwidth, screenshotheight, true, "canvas", 0, null, sizeinfo, makeScreenshotCache);



When I display max_renderbuffer_size (using alert()) on my browser I got 16384, why my final image is equal to 7679px x 4319px. Is there something that i didn't understand or missed ?

Thank you for giving me your time !

6

Donnerstag, 3. Juni 2021, 18:19

Hi @klaus.krpano,

krpano.webGL.context.getParameter( gl.MAX_RENDERBUFFER_SIZE ) give me 16384, you told me
"max_renderbuffer_size variable will contain the maximum width or height.", but when I execute :


Quellcode

1
2
var screenshotwidth = 16384;var screenshotheight = 9637;
var screenshotcanvas = krpano.webGL.makeScreenshot(screenshotwidth, screenshotheight, true, "canvas", 0, null, sizeinfo, makeScreenshotCache);



My screenshot has 7509px / 4417px, I thought I have exceeded the maximum value, so max_renderbuffer_size does not
contain the maximum width. did i make a mistake ? Is there another way to have max width value supported for my browser/systems ?

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »djck« (4. Juni 2021, 09:47)


7

Freitag, 4. Juni 2021, 08:28

Apologies for jumping in but where are the screenshots saved when viewing the tour on a pc? I'd like to take some high res shots and save them to a directory.

Thanks.

8

Freitag, 4. Juni 2021, 09:43

Apologies for jumping in but where are the screenshots saved when viewing the tour on a pc? I'd like to take some high res shots and save them to a directory.
Hi @andrew22222,

I'm using this example : https://krpano.com/viewsource.html?relea…api-example.xml.

So when this layer is clicked :

Quellcode

1
krpano.addlayer("screenshotsaveasbutton");


this function is executed

Quellcode

1
saveasbutton.onclick()


So I'm working on Ubuntu 20.04, my image is downloaded and I can find in "/home/username/Téléchargements"

I hope it will help you.

9

Freitag, 4. Juni 2021, 10:25

I found what i'm looking for in this topic : https://krpano.com/forum/wbb/index.php?p…&threadID=15997,

Thanks a lot for all explanations @klaus.krpano

10

Samstag, 5. Juni 2021, 07:42

Thanks Djck,

I looked and found that part in the xml file and so you changed it to this below ;-)

Quellcode

1
screenshotcanvas.toBlob(function(blob){ krpano.screenshotSaveAs(blob,"screenshot" + (krpano.makescreenshot_count++) + ".jpg"); }, "/home/username/Téléchargements", 0.95);



Cheers.

11

Freitag, 22. Oktober 2021, 07:59

How can I destroy the photo screen when I click the save button?
Normally the selected area disappears when clicked, but I want to do it when the photo is saved in one action.