Generating camera view as a image(Texture) (Real Time)

Hello.What I want is a custom User Viewport for the realtime updating of the scene but with the added feature of an automatic and instantaneous generation of an image map of the viewport. (But the quality of image is not important (What that we see in viewport is enough))
Can someone write a script for this???
Realy Thanks.