Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

1

Donnerstag, 13. November 2008, 12:28

onLoaded, xml and full secuency of images of pano

Hi, can i get the moment of full loaded content of panoramic?
i've read onstart, but it works when load xml but not img.
thanks

Graydon

Profi

Beiträge: 614

Wohnort: Texas

Beruf: Industrial gas turbine services.

  • Nachricht senden

2

Donnerstag, 13. November 2008, 20:29

depending upon what you want to the "wait" action may work?

http://www.krpano.com/docu/actions/#wait

3

Freitag, 14. November 2008, 08:51

Hi,

at the moment there is no real event for "loading finished" because when using tiled or multiresolution panoramas it can happen that it loads new needed tiles later...

or use the "wait(LOAD);" action to wait until all images or all tiles for the first view (on multiresolution panoramas) are loaded,

or if you are in as3 / a plugin you can check the "progress.loaddone" variable with a Timer...

I have planned to make two new events in the next versions:

"events.onviewdone" - when all images/tiles are loaded for the current view (for multiresolution and normal panoramas)
"events.onloaddone" - when really all images are loaded (only useable for normal panoramas)

what do you think about them? or any further proposals?

best regards,
Klaus

4

Montag, 1. Dezember 2008, 23:24

How can I calculate the download progress when there are more images?

Dear Sir,
Around line 353 in flashcs3exampleplugin1.fla you offer with the package, you wrote:
..................................................
if ( krpano.get("progress.loaddone") == "false" )
{
// show progressbar
this.progressbar.visible = true;

// NOTE - this works only for simple one image panoramas
// when there are more images, the calculation of the download progress
// is more complex

var bytesloaded:Number = Number( krpano.get("progress.bytesloaded") );
var bytestotal:Number = Number( krpano.get("progress.bytestotal") );
..................................

Could you please explain how can I predict multiple images downloading. In other words, I have front, left, right, top,down, etc... and need to predict the loading of all these images.
Could you help please?

Thanks,
Wesam

5

Dienstag, 2. Dezember 2008, 00:09

Hi,

calculating the download progress is a little bit complicated at the moment,
because of the multi-resolution loading it's difficult to show a correct progress.

have a look at the "krpano.progress.*" values here:

http://krpano.com/docu/api/

here a quick explanation of these values:

progress.loaddone
- while loading "false", when done "true"

progress.bytesloaded
- sum of bytes from all files that are current downloading
(see the value set in "network.downloadqueues" for how many files are
max. loading at the same time, if you set it to 1 it would be a little
bit easier to calculate a good progress value)

progress.bytestotal
- sum of all total bytes from all files that are current downloading

progress.filesloaded
- number of files are already downloaded (for the current level)

progress.filestotal
- total files (for the current level)

progress.filesneeded
- files that are needed to be downloaded for the current view

progress.decodesneeded
- each image must also be decoded
- this is the number of files that needed to be decoded for the current view


from these values the current progress can be calculated,

this is my current implementation in the viewer: (not optimal)

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// because the current number of files that are needed
// is changing very fast, I save the latest maxium of the
// filesneeded value:

public var lastmax_filesneeded:int = 0; // global or static var!


// now here the code that draws a progress bar or something else:
// call it in a enterframe or timer loop:

if (krpano.get("progress.loaddone") != "true")
{
    bytesloaded = int( krpano.get("progress.bytesloaded") );
    bytestotal = int( krpano.get("progress.bytestotal") );

    var bytes_progress:Number = 0.0;

    if (bytestotal > 0)
    {
        bytes_progress = Number(bytesloaded+1) / bytestotal;
    }

    var filestotal :int = int( krpano.get("progress.filestotal") );
    var filesneeded :int = int( krpano.get("progress.filesneeded") );

    if (filesneeded > lastmax_filesneeded)
    {
        lastmax_filesneeded = filesneeded;
    }
    else if (filesneeded == 0)
    {
        lastmax_filesneeded = 0;
    }

    if (filestotal > 0)
    {
        progress = 1.0;
    }

    if (lastmax_filesneeded > 0)
    {
        progress = 1.0 - Number(filesneeded-1 + (1.0 -
        bytes_progress))/lastmax_filesneeded;
    }

    // now draw a progress bar - the progress value is now between 0.0 and 1.0
}


but note - this is not a really good algorithm at the moment
it will be improved next,

best regards,
Klaus