I'd like to take a window (or part of it) as a bitmap and save it as an image. This is basically a screenshot functionality.
I'd like to do it with emacs lisp so that screenshot taking can be scripted.
I'm using Aquamacs, but I'm not bound to be using exactly this version of Emacs.