OK, so I used Berns's method, and got the image cut up into the rectangles approximating my piece sizes. Obviously, that doesn't get the irregular shapes I need. I figured I could use the alpha channel or byte number one of each pixel of the image data to make the image parts around the tabs and voids transparent. But, all my efforts to create transparent portions of the image have failed.
I have appended a short app showing my attempts, which included carefully checking the size of the image data vs the size of my manipulations (nData) and checking pre and post manipulation byte values. No joy..
The app (if it worked properly) should remove the portion of the image above the main rectangle of the graphic of a puzzle piece. The main core of the code is here:
Code: Select all
put 0 into n
repeat with i = 1 to tWidth
repeat with j = 1 to tHeight
if not((i,j) is within tRect)
then
if nIncrement = 1
then
put numToChar(0) into byte n+1 of tAlphaData
else
put numToChar(0) into byte n+1 of tImageData
end if
end if
add nIncrement to n
end repeat
end repeat
Can anyone tell me where I'm going wrong?
Thanks!