Offset Referenced Image Data

Alejandro Tejada capellan2000 at gmail.com
Tue Sep 26 21:23:36 EDT 2017


Until LC fills this request, check these options
discussed before:

1) Ink Effects for masking an image within a group

Scott Rossi wrote:
> Try this stack (in your message box):
> go url
"http://www.tactilemedia.com/site_files/downloads/masking_options.rev"

> The reason why a group with ink effects might be a
> preferable masking solution is the image can be
> positioned/resized independently of the mask.
> This is demonstrated in the sample stack.
> As Jacque pointed out, when using a backPattern,
> the image is always drawn from the topLeft of the
> object and is fixed.  Also a backPattern does not
> support translucency, while a group can. But using
> a group can be a bit more work.

2) Hidden Point Technique

Alejandro Tejada wrote:
> Try these scripts too, before using a group:

1) Create a new stack
2) Create a polygon graphic
and set the points of it to:

0,0

34,268
224,268
127,365
34,268

3) import an image into this stack,
put the image in a corner, where it does not
hide the graphic and:

set the backpattern of grc 1 to the id of img 1

(now, the imported image is cropped within
the graphic)

4) set the script of the graphic to this variation
of Scott Rossi script (posted by Bernd) to move
the first point of the graphic and (at the same time)
move the image within the graphic:

local lpoints,tClick,tFirstPoint
-- based on Scott Rossi script for masking images
local sMinX, sMinY

on mouseDown
   put mouseH(),mouseV() into tClick
   put the points of me into lpoints
   put line 1 of lpoints into tFirstPoint
   put line 2 to - 1 of lpoints into tPointLIst
   filter tPointList without ""
   sort tPointList numeric ascending by item 1 of each
   put item 1 of line 1 of tPointList into sMinX
   sort tPointList numeric ascending by item 2 of each
   put item 2 of line 1 of tPointLIst into sMinY
   put "mouseDown" & cr & lpoints & cr & cr into fld 1
end mouseDown

on mouseMove X,Y
   if tClick = "" then exit mouseMove
   put  (X - item 1 of tClick,Y - item 2 of tClick)
   put  (X - item 1 of tClick) + item 1 of tFirstPoint,(Y - item 2 of
tClick) + item 2 of tFirstPoint into line 1 of lpoints
   if item 1 of line 1 of lpoints > sMinX then put sMinX into item 1 of line
1 of lpoints
   if item 2 of line 1 of lpoints > sMinY then put sMinY into item 2 of line
1 of lpoints
   set the points of me to lpoints
end mouseMove

on mouseUp
   put "" into tClick
end mouseUp

on mouseRelease
   put "" into tClick
end mouseRelease
------------------------------------------

Check this thread in:
http://lists.runrev.com/pipermail/use-livecode/2016-March/225312.html

Al



More information about the use-livecode mailing list