Cropping an image

Ralph DiMola rdimola at evergreeninfo.net
Thu May 31 11:12:22 EDT 2018


I am trying to take the first n rows and the last n rows of an image and deleting the center (from top to bottom) and pasting the top and bottom together. The imagedata of an image control seems to be a z buffer with 4 bytes per pixel. I put the first n rows followed by the last n rows into a var. Then adjust the height of the image and set the imagedata from the var. I am not seeing what I expect. The image does not change but just squashes the original image. Should this work? Also what if the number of pixels of the image does not match the data in the var (hgt*wid*4)? What if it's short or long? I tried putting the var into the imagedata of a new blank image control. It looked close but there seemed to be some alpha channel issues. The original (png) is copied from a master image card and put on to the working card before I start.

Thanks for any insight...

Ralph DiMola
IT Director
Evergreen Information Services
rdimola at evergreeninfo.net






More information about the use-livecode mailing list