Page 1 of 1

revBrowserSnapshot anybody have examples of its use?

Posted: Thu Oct 11, 2007 5:25 am
by Simon
Hi,
Just seeing if anybody has code with revBrowserSnapshot working in it.
I can't seem to get it to work.

Thanks,
Simon

Posted: Thu Oct 11, 2007 9:18 am
by Mark
Hi Simon,

Assuming that the ID of the browser is 2 and that an image "Your Image" exists, the following should work.

put empty into theSnapshotVariable

Code: Select all

revBrowserSnapshot 2, "theSnapshotVariable"
set the imageData of image "Your Image" to theSnapshotVariable
Best,

Mark

Posted: Thu Oct 11, 2007 5:31 pm
by Simon
Hi Mark,
Well you've repeated what is in the documentation, which I have tried.
Any other suggestions?

Simon

Posted: Thu Oct 11, 2007 6:22 pm
by Mark
Simon,

It works fine here. I have just tested it. Post your own script, please.

Best,

Mark

Posted: Thu Oct 11, 2007 7:24 pm
by Simon
Hi Mark,
By taking the code out of the card script I got it to work, thanks.
Now how about saving the image to a file?
Sure, binfile:myPic. xxx Is it in a standard format that can be saved?

Thanks,
Simon

Posted: Thu Oct 11, 2007 7:31 pm
by Mark
Hi Simon,

Here is an example.

Code: Select all

global gBrowserID

on mouseUp
  if gBrowserID is an integer then
    put empty into myImgData
    revBrowserSnapShot gBrowserID,"myImgData"
    set the imagedata of img 1 to myImgData
    set the width of img 1 to the formattedWidth of img 1
    set the height of img 1 to the formattedheight of img 1
    put specialfolderpath("desktop") & \
    "/rev snapshot.png" into myFile
    set the filetype to "????PNGf"
    export img 1 to file myFile as PNG
  end if
end mouseUp
This script makes a snapshot and saved the image to a file on the desktop. The file is called "rev snapshot.png". You will have to adjust the script for your own needs.

Best,

Mark

Posted: Tue Oct 23, 2007 6:21 am
by Simon
Hi Mark,
Thanks for the information, I've been able to get everything running.
Of course there is another thing... Is it true that the largest height of the snapshot is 1024 px? I can't seem to get a larger picture.

Thanks,
Simon

Posted: Sat Oct 27, 2007 3:53 am
by Simon
Hi Mark,
Ok, with further experimentation I found out that the maximum height and width of the revBrowserSnapshot is based on screen resolution (I should have figured that out earlier from the 1024).

Have any ideas on how to feed it false information?
I guess you understand what I'm trying to do... get the full web page not just what I can see at one time.

Thanks again,
Simon

Posted: Sat Oct 27, 2007 10:36 am
by Mark
Hi Simon,

I know what you are trying to do. Sorry, I don't know how to do that. We can only wait until someone updates the external, which could take a few years.

If you are on Windows, you might try this:

http://iecapt.sourceforge.net/

I can't find a good alternative for Mac OS X, but you might be able to use AppleScript to create snapshots with Safari.

Best,

Mark

Posted: Sat Oct 27, 2007 7:05 pm
by Simon
Hi Mark thanks!
I think I found one for Safari:

http://www.derailer.org/paparazzi/

There are some extra command line codes to digest, but essentially I think it's the same.

Thank again,
Simon

Posted: Sat Oct 27, 2007 10:42 pm
by Mark
Hi Simon,

That's a nice link. I also see some source code laying around. Maybe that will inspire someone to update the revBrowser external...

Best,

Mark

Posted: Sun Feb 24, 2008 10:01 am
by Andycal
This is *really* late to the party, but I use SnagIt to do my screen capture and it gets whole web pages by taking a snapshot, then scrolling the screen down and taking another and joining them together.

Gawd knows how you'd do this in Rev, but I'm guessing it's more of a IE control/maths problem rather than jiggering around with external libraries and stuff.