revBrowserSnapshot not working in Windows

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
CenturyMan1979
Posts: 86
Joined: Tue May 15, 2012 5:56 pm

revBrowserSnapshot not working in Windows

Post by CenturyMan1979 » Tue Apr 15, 2014 8:36 pm

Hey All,

I can't seem to get revBrowserSnapshot to work in Windows. I just keep getting a solid white image as a result from it. Before I added the line to set the scrollbars to false I would get a solid white image except where the scrollbars where I would get solid black. Anyone run into this issue?

On my card I have the following,
  • "GO" Button that calls "openUrlButtonClicked"
  • "Snap Shot" Button that calls "snapShotButtonClicked"
  • "fldURL" input text field for entering URL
  • "browserRect" graphic that is used for layout of revBrowser
  • "bDisplay" image used to display the image data from revBrowserSnapshot (same rect as browserRect)
and here is the card code

Code: Select all

local sBrowserID

on preOpenStack
   put empty into field "fldURL"
end preOpenStack

on openBrowser pURL
   log "openBrowser:" && pURL
   if (sBrowserID is not an integer) then
      put revBrowserOpen(the windowId of this stack, pURL) into sBrowserID
      if (sBrowserID is not an integer) then
         log "Failed to open browser"
      else
         revBrowserSet sBrowserID, "scrollbars", false
         revBrowserSet sBrowserID, "showBorder", false
         revBrowserSet sBrowserID, "rect", the rect of graphic "browserRect"
         revBrowserSet sBrowserID, "visible", false
      end if
   else
      revBrowserSet sBrowserID, "url", pURL
   end if
end openBrowser


on updateBrowserDisplay
   log "updateBrowserDisplay"
   if (sBrowserID is an integer) then
      log "sBrowserID is an integer"
      local tSnapShot
      log "Taking Snap Shot"
      revBrowserSnapshot sBrowserID, "tSnapShot"
      put revBrowserGet(sBrowserID, "rect") into tBrowserRect
      put item 3 of tBrowserRect - item 1 of tBrowserRect into tBrowserWidth
      put item 4 of tBrowserRect - item 2 of tBrowserRect into tBrowserHeight
      set the width of image id 1013 to tBrowserWidth
      set the height of image id 1013 to tBrowserHeight
      set the imageData of image id 1013 to tSnapShot
   end if
end updateBrowserDisplay


on closeStack
   if (sBrowserID is an integer) then 
      revBrowserClose sBrowserId
   end if
   put empty into sBrowserID
end closeStack

on openUrlButtonClicked
   put the text of field "fldURL" into tURL
   send "openBrowser tURL" to me in 10 milliseconds
end openUrlButtonClicked

on snapShotButtonClicked
   log "snapShotButtonClicked"
   send "updateBrowserDisplay" to me in 10 milliseconds
end snapShotButtonClicked

on log pMsg
   put CR & pMsg after msg
end log

CenturyMan1979
Posts: 86
Joined: Tue May 15, 2012 5:56 pm

Re: revBrowserSnapshot not working in Windows

Post by CenturyMan1979 » Tue Apr 15, 2014 8:58 pm

Attached an image of the Browser Sampler.rev sample file showing the same results I was seeing in my application. You can see a white image with black where the scrollbars would be.
Attachments
browser.jpg

CenturyMan1979
Posts: 86
Joined: Tue May 15, 2012 5:56 pm

Re: revBrowserSnapshot not working in Windows

Post by CenturyMan1979 » Tue Apr 15, 2014 10:41 pm

I did just open a bug report for this. If you want to follow it is Bug 12210.

CenturyMan1979
Posts: 86
Joined: Tue May 15, 2012 5:56 pm

Re: revBrowserSnapshot not working in Windows

Post by CenturyMan1979 » Wed Apr 16, 2014 2:24 pm

Bug Report Update
we have now confirmed the bug in your bug report and will continue to update you as the status of this issue changes.

This problem seems to have been around for a while as this also appears to happen in LiveCode 6.1.3.

Post Reply