Code: Select all
on mouseUp
import snapshot from widget "browser"
set the text of image "image" to the text of the last image
if the number of images > 1 then delete the last image
end mouseUp
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Code: Select all
on mouseUp
import snapshot from widget "browser"
set the text of image "image" to the text of the last image
if the number of images > 1 then delete the last image
end mouseUp
Code: Select all
# copy this code and paste it directly into the handler you are using to import the snapshot from...
local myRect, winID
put the rect of widget "browser" into myRect
put the windowID of stack "o" into winID
import snapshot from rect myRect of window winID ## could also use export, btw...
Did you try the code I posted above then? It captures a snapshot of the browser widget directly much like the code you posted. The main difference (from my pov) is that it doesn't build the rect manually by adding offsets from screen global as you did, instead, it is shorter because it uses the rect based on the stack location using the windowID.
In other words, skip the browser altogether, and put an ordinary field on a card, then import the snapshot from the rect of the field. Without specifying the window the field is relative too, you get exactly the same result.
I'm not entirely sure how much farther that same goes back, I'll leave it to you as an excercize since I am going to eat lunch nowTo import a snapshot for a portion of a stack you use the form:
import snapshot from rect[angle] of window windowID
Where windowID is the windowID property of the required stack.