The ScreenCapturer library for Processing enables you to capture any part of your screen and include this capture into your Processing sketch as image or video.