Generating custom windowshapes within Rev
Ian Wood
revlist at azurevision.co.uk
Wed Dec 12 18:56:41 EST 2007
Having played around quite a bit with custom windowshapes I finally
got around to looking at Eric's recent tutorial which prompted me to
try out an idea I had some time ago - the creation of custom
windowshapes within the app itself.
Ingredients: Rev 2.7 and above - we're using the 'from object with
full transparency' capability of the import snapshot command.
1. Make a graphic or group of graphics the shape that you want the
window to be, applying corners with a radius, variable opacity etc. In
this example, it's a rounded graphic called "windowshape". Original,
hey?
2. Start with the following code and play around:
import snapshot from grc "windowshape"
put the id of the last img into tID
set the windowshape of this stack to tID
3. There is no step 3.
Obviously this is very bare bones, but a bit of extra tinkering gives
us this:
import snapshot from grc "windowshape"
put the id of the last img into tID
set the windowshape of this stack to tID
put the propOldShape of this stack into tOldID
if tOldID is not empty then
delete image id tOldID
end if
set the visible of the last img to false
set the propOldShape of this stack to tID
which automatically deletes the old temporary image.
Stick it all on a substack and we can have fully automated
windowshapes, maybe even with the possibility of *resizable* custom
shapes...
Ian
More information about the use-livecode
mailing list