NO 2.0 bug with order of rect parameters ;-)

Klaus Major klaus at major-k.de
Thu May 22 06:28:01 EDT 2003


Hi Mike,

> I am trying to capture an image of a text field to rotate it 
> vertically.  I
> thought that I should be able to:
>
> Import snapshot from rect (the rect of field "A")
>
> But there seems to be an ordering difference with the parameter of 
> "import
> snapshot" and the "rect property".
> Import snapshot seems to be "top, left, bottom, right" and the rect 
> property
> is "left, top, right, bottom"
>
> Can anyone clarify this issue for me?
>
> Import snapshot from rect (the rect of stack "foo") seems to work but
> Import snapshot from rect (the rect of field "foo") does not
>
> Please note the documentation differences of the parameters as well.

Important info:
The "import snapshot" command need coords relative to the topleft 
corner of
the screen.

"the rect of stack xyz" will return these coord relative to the topleft 
corner of the screen.

BUT all objects on a card have its rect relative to the topleft of the 
stack!!!

You can "translate" these values by the "globalloc" keyword (see the 
index...)

Like this:

...
  put the rect of fld "poo" into p_rect
   put item 1 of p_rect & "," & item 2 of p_rect into tl  ### topleft
   put item 3 of p_rect & "," & item 4 of p_rect into br ### bottomright
   import snapshot from rect(globalloc(tl), globalloc(br)) ## now global 
coord...
...

A little more scripting, but once you know how to do it...

> Regards,
>     Mike

Hope that helps...


Regards

Klaus Major
klaus at major-k.de




More information about the use-livecode mailing list