We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › making a mask/alpha/etc smaller/bigger
Page Index Toggle Pages: 1
making a mask/alpha/etc smaller/bigger (Read 1060 times)
making a mask/alpha/etc smaller/bigger
Dec 5th, 2009, 6:13pm
 
Hey guys, I'm kind of new (to programming and processing). I'm trying to find a way to display only part of an image, and change the amount you can see. I know the image and the mask image (or alpha... i'm not sure what the difference is) need to be the same size, but I didn't know if you could change that while the program's running. I tried using the alpha method I found in the reference, but the program told me it's not a method (i'm running 1.0.9).  It wouldn't let me use resize on a mask either. I couldn't find this in the book either so I didn't know if I was missing something or if this isn't possible.

Code:
void display()   
{

xDirector();

int g= (thisSize/2);

pushMatrix();

thisCurrentX += Xdirection;
thisCurrentY += Ydirection;

translate(thisCurrentX, thisCurrentY);

rotate(rotationTotal);
rotationTotal += rotationRate;
cat.mask(dotMask[dotShape]);
dotMask[dotShape].resize(thisSize, thisSize);
image(cat, -g, -g, thisSize, thisSize);


popMatrix();

}

Re: making a mask/alpha/etc smaller/bigger
Reply #1 - Dec 7th, 2009, 4:26pm
 
does that make sense?
Re: making a mask/alpha/etc smaller/bigger
Reply #2 - Dec 7th, 2009, 4:48pm
 
you can use copy http://processing.org/reference/copy_.html
to do that.
Re: making a mask/alpha/etc smaller/bigger
Reply #3 - Dec 7th, 2009, 5:20pm
 
perfect! thank you!
Page Index Toggle Pages: 1