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)
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