Fredi
placeholder for import snaphot
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
placeholder for import snaphot
I make an app where the user can make a snaphot from a screen region. With a transparent window, that only shows for corners, the user can place e. g. word on the right place, or the transparent window over the word-app. Then I want take the snaphot on this place. Any help? Thank you. (a newbie.... 
Fredi
Fredi
Grüezi emmefisch 
do you know that you do not necessarily need a "template" or "placeholder" for this?
If you just fire a:
...
import snapshot
## Without any parameter like above!
...
Then the cursor changes to "crosshair" and the user can drag a rect for the snapshot which will be imported then, or the user can hit "ESCAPE" and no snapshot is imported.
I do this in my projects:
...
hide stack "Mainstack"
hide stack "Substack
## etc... You can loop through all "visible" stacks if necessary...
import snapshot
### Now show all open stacks again:
show stack "Mainstack"
show stack "Substack"
...
So no stack is in the way for the user.
Maybed this is an option for you?
Best
Klaus
Klaus
do you know that you do not necessarily need a "template" or "placeholder" for this?
If you just fire a:
...
import snapshot
## Without any parameter like above!
...
Then the cursor changes to "crosshair" and the user can drag a rect for the snapshot which will be imported then, or the user can hit "ESCAPE" and no snapshot is imported.
I do this in my projects:
...
hide stack "Mainstack"
hide stack "Substack
## etc... You can loop through all "visible" stacks if necessary...
import snapshot
### Now show all open stacks again:
show stack "Mainstack"
show stack "Substack"
...
So no stack is in the way for the user.
Maybed this is an option for you?
Best
Klaus
Klaus
Grüezi Fredi,
aha, I see.
Hm, in that case you could:
1. Create a resizable stack "tUserRect". I colored it lightly red, looks nice
2. Set its blendlevel to 50 or whatever so it is partly transparent.
3. Put a button on it "Drag and resize this window and then click me"
4. Put this into the script of this button:
5. Call this stack whenever you want the user to define a rect on screen
...
modal stack "tUserRect"
put the dialogdata into the_users_rect_4_screenshot
## do whatever you wnat with the_users_rect_4_screenshot
...
6. Store this value for later use in a custom property or global variable or field or wherever
Get the picture? I do this in some of my projects and the users love it
Best
Klaus
aha, I see.
Hm, in that case you could:
1. Create a resizable stack "tUserRect". I colored it lightly red, looks nice
2. Set its blendlevel to 50 or whatever so it is partly transparent.
3. Put a button on it "Drag and resize this window and then click me"
4. Put this into the script of this button:
Code: Select all
on mouseup
set the dialogdata to the rect of this stack
close this stack
end mouseup...
modal stack "tUserRect"
put the dialogdata into the_users_rect_4_screenshot
## do whatever you wnat with the_users_rect_4_screenshot
...
6. Store this value for later use in a custom property or global variable or field or wherever
Get the picture? I do this in some of my projects and the users love it
Best
Klaus
Hi Klausimausi,
That's a good technique - I use something similar. Just a caution for Windows (I'm not sure how it works on Mac
) but if you hide the mainstack and the user switches another app to the front, then there is no taskbar icon to bring the focus back to the tUserRect stack.
So you might want tobefore calling it as a modal stack - that way it will stay floating above all windows even if the user switches focus to another app.
(Yes... they all want to do it, to get their programs into the right view/size/position before they take the snapshot)
That's a good technique - I use something similar. Just a caution for Windows (I'm not sure how it works on Mac
So you might want to
Code: Select all
set the systemWindow of stack "tUserRect" to true(Yes... they all want to do it, to get their programs into the right view/size/position before they take the snapshot)
-
shadowslash
- Posts: 344
- Joined: Tue Feb 24, 2009 6:14 pm
- Contact:

