Read up on NSView and NSImage. A starting point would be this programming topic: <a href="http://developer.apple.com/techpubs/macosx/Cocoa/TasksAndConcepts/ProgrammingTopics/DrawImages/index.html" target="_blank">Drawing and Images</a>. If you have Aaron H's cocoa book, there is a good section regarding custom views. Create a view and assign it a custom class. In the class you can implement methods such as mouseDown, mouseUp, mouseDragged, etc.
You also need to implement drawRect for the view. Whenever you change something call [self setNeedsDisplay].