Pixmap graphics ports are usually required only temporarily and the macro with-pixmap-graphics-port allocates one for you from a cache of such objects.
with-pixmap-graphics-port