Expand picture mask

Is there a way to expand the mask of a picture?
I mean the same way as it can be done in Photoshop or After Effects.

I would like to be able to take any mask and expand (or shrink) it in order to make more or less of the picture object transparent. Is there a declare for this?

You do that with Alpha.

I thought so. But isn’t the Alpha Chanel the mask property? Kind of?
I do want to manipulate the grayscale mask image. But doing that pixel by pixel doesn’t seem to be efficient. I kind of have been looking at the Core Graphics docs. But it doesn’t seem to be much helpful.

Mask is not alpha.

use the MASK property… and RGBSurface property… it is VERY fast
or depending on how you mask needs to be done. you can use FillRect and other methods on the mask layer as well.

Ok, but this doesn’t explain how I can expand the shape of a text or some other figure.

[quote=302302:@Dave S]use the MASK property… and RGBSurface property… it is VERY fast
or depending on how you mask needs to be done. you can use FillRect and other methods on the mask layer as well.[/quote]
Thank you. I know. And I use mask quite often to draw my own custom controls and screen elements.

I know about the outline function I use with declares. But I don’t like the quality.
For instance, if I want a text with outline and shadow, I can simply draw the shadow first (with a position offset of course), after setting a dark color and some alpha value.
Then, I can draw the text with the text color of my choice.
Finally, I can set the Outline mode using a declare. I set the color of my outline, et voila… I have the text with all the shadow and outline attributes.

The problem is that I can still see some fringing of the textcolor, outside of the outline.

My guess is that I can solve the outline problem by drawing the text on a dark background.
Next, I draw the same text on a Picture I use as a mask. But before applying the mask I scan all the black pixels and expand them by whatever size I want my outline to be.
Finally I apply that mask to the Picture object where I drew my initial text in. That would give the illusion of an outline. Right?

Another approach, which may be even a bit faster, is not scanning for pixels, but drawing the text on the mask a few times on the mask layer. But each time with a slight offset. I have seen this done before. But I didn’t like the quality too much, especially with large fonts and round letters.

With text the approach is fairly simple. But what if I use other elements, like imported images, with masks? That would make things quite a lot tougher. I was hoping for some declares to save the day…

I use Photoshop and After Effects a lot. There is an outline effect, that draws a line around an object. It happens very fast. So, my guess is, that there must be an efficient way to accomplish this