How to export revBrowserSnapshot to file?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

openworld
Posts: 63
Joined: Sat Sep 11, 2010 3:56 am
Location: Virginia, USA
Contact:

Re: How to export revBrowserSnapshot to file?

Post by openworld » Thu Oct 28, 2010 5:09 am

Bernd,

I'm glad to have the demo stack working so well on my Mac mini! The drag and drop into the field "fClip" is flawless.

In the prototype app, I'd love to see the dropped text wind up in the first empty row of column 1 of a new datagrid. I created a group called "fClip," and tried to drag and drop text from the revBrowser pane into it.

So far, there's been now luck in getting the datagrid to accept the dragdrop text.

Is there a card or hidden substack/object script that I need to change from field fClip to group fClip?

And do I need to set column1 properties in some way to accept html text that is released onto it via dragdrop?

I've searched the forum and the user guide without success. Many thanks for any further pointers- and all your patience with my early learning curve.

Best,

Mark
@openworld

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4003
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: How to export revBrowserSnapshot to file?

Post by bn » Thu Oct 28, 2010 3:43 pm

Hi Mark,

I am not really familiar with the Datagrid. Did some testing but not more, pretty powerful but also confusing at times.

have a look at this thread
http://forums.runrev.com/phpBB2/viewtopic.php?p=17333

If you want get aquainted with the datagrid look at the lession section at Runrev.com > Datagrid

and in RevOnline:
http://revonline2.runrev.com/stack/493/ ... o-datagrid

maybe someone more familiar with the datagrid will chime in.

regards
Bernd

openworld
Posts: 63
Joined: Sat Sep 11, 2010 3:56 am
Location: Virginia, USA
Contact:

Re: How to export revBrowserSnapshot to file?

Post by openworld » Fri Oct 29, 2010 6:00 pm

Bernd,

Thanks yet again - those links do indeed hit the spot with functions I've been looking to understand!

Best,

Mark

charms
Posts: 122
Joined: Mon Feb 10, 2014 6:21 pm
Location: Singapore
Contact:

Re: How to export revBrowserSnapshot to file?

Post by charms » Wed May 27, 2015 9:34 pm

Just a small update for the people without a magic crystal ball or chicken sacrifice rituals. revBrowserSnapshot is working but only if the image size is the same size as the browser size and you use the revBrowserOpen method. Please note that this does not work yet with revBrowserOpenCef.

So create a new button and add following code to the script of the button:

Code: Select all

on mouseUp
   local tBrowserId
   local tSnapshot
   
   create invisible image "testImage"
   set the rect of image "testImage" to the rect of graphic "rctBrowserBg"
   
   put revBrowserOpenCef(the windowId of this stack, "http://www.cnn.com") into tBrowserId
   if tBrowserId is not an integer then
      answer "Failed to open browser"
   end if
   revBrowserSet tBrowserId, "visible", false
   revBrowserSet tBrowserId, "rect", the rect of graphic "rctBrowserBg"
end mouseUp
After that add following in to your card script (the message sent by the browser is going to the card and not the button):

Code: Select all

on browserDocumentComplete pBrowserId
   local tSnapshot
   
   revBrowserSnapshot pBrowserId, "tSnapshot"
   set the imageData of image "testImage" to tSnapshot
   show image "testImage"
end browserDocumentComplete
Please note that I do not harm any animals. I have a pro license :)

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”