On 10/16/21 2:17 PM, David Epstein via use-livecode wrote:
I am trying to create an image that will appear to have the shape of some 
arbitrary polygon.  The idea is to set the image's alphaData so that pixels 
within the polygon are opaque, and those outside the polygon are transparent.  
The scripts below create a rectangular image of whatever is under the polygon's 
enclosing rectangle, and then adjust the alphaData of that new image.  But 
while the new image gets trimmed a bit, the result does not match the shape of 
the designated polygon.  Any thoughts?

If it's acceptable to make the polygon and the image the same size, you can just set the backgroundPattern of graphic to the ID of the image and it will appear the way you want. The down side is that the pattern is drawn from the top left of the graphic rather than centered within it, so that may be an issue.

--
Jacqueline Landman Gay         |     jac...@hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to