Object is not an image when Crop command
scott at tactilemedia.com
Tue May 11 13:14:38 EDT 2010
Recently, JosepM wrote:
> I have a image and some graphics "polygons" over.
> The user select one of them and extract the image inside the edges of the
> And then the user can move if they want or duplicate.
> "the selectedobject" is the polygon
> on mouseUp
> lock screen
> put the rect of the selectedobject into tRect
> import snapshot from rect tRect of image "picture"
> put the id of last image into tSnapshotId
> set the backgroundpattern of the selectedobject to tSnapshotId
> delete img id tSnapshotId
> set the layer of the selectedobject to top
> set the ink of the selectedobject to srcCopy
> unlock screen
> end mouseUp
> What you think about? Can I have any problem of memory if I use more
> graphics with backgroundpattern?
I don't think so. If the graphics are large, and the user has to move them
around the card, there might be some slowness when dragging them around.
> And other question to explore :)
> How can empty the area of the image that is inside the graphic? Modifying
> the imagedata?
> Or select a range of pixels and asign a new color?
You can modify pixels of an image, but maybe it would be less complicated to
overlay a colored overlay object where you want it and create a new snapshot
to apply as the backgroundPattern.
Tactile Media, UX Design
More information about the Use-livecode