Hi all, I'm trying to cut off the corners of any given image programmatically. I understand that the tool to do this is the *maskData* property. But I couldn't figure out how to use it.
I tried a couple of ways. {I know that below code doesn't work, I added different commands for you to see.} __put the imageData of image "Image" into tImage __put the maskData of image "Image" into tImage -- if I use this instead of imageData, nothing changes with the image __put the width of image "Image" into tWidth -- 300px __put the height of image "Image" into tHeight -- 300px __repeat with tY = 0 to tHeight - 1 ____repeat with tX = 0 to tWidth - 1 ______put (tX + tY * tWidth) * 4 into tPixel ________if (tY < 50 and tX < 50) or \ -- top left corner __________(tY < 50 and tX > 250) or \ -- top right corner __________(tY > 250 and tX < 50) or \ -- bottom left corner __________(tY > 250 and tX > 250) then -- bottom right corner ________put numToChar(0) into char(tPixel + 1) of tImage -- no effect at all, isn't this the alpha channel? ________put numToChar(255) into char(tPixel + 2) of tImage ________put numToChar(255) into char(tPixel + 3) of tImage ________put numToChar(255) into char(tPixel + 4) of tImage ______end if ____end repeat __end repeat __set the imageData of image "Image" to tImage -- it works, whitens the corners because of numToChar(255) __set the maskData of image "Image" to tImage -- scramble the image with random white spots Can someone direct me to the right way? Any help much appreciated… Best, ~ Ender Nafi ~… together, we're smarter …~ _______________________________________________ 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