I am making an image editing application, and need to show selection areas on the screen. In Illustrator, Photoshop, GIMP, and everything else this is shown using an animated dotted line that kind of crawls around the selection.
I need to do this same thing. How do I put an animated line like that on a view in Cocoa?
Sometimes this effect is called "marching ants", if that helps you search at all.
Here's how to do it with Core Animation.
Usually these "crawling" lines are only a few frames of animation. Maybe only 2.
Make a custom view which is aware of the dimensions of this "selection" area. Start with just a 1px white line. Then, you can take the x & y dimensions of each pixel, mod them by the desired "size" of each "link" to determine if one particular pixel is to be black or white. Modify your decision of "black or white" current time to animate.
Alternatively, a png of a "grid" of black and transparent square could be animated as shifting diagonally on top of a solid white border line. Crop the "grid" view to only be visible directly over the border and it may accomplis that same "crawling" look. This might be an expensive way to accomplish it but maybe it will give you ideas.