Capture screen output stream

Is there a way to access the raw graphics card output stream and store it in a buffer, so that it can be compressed and saved? Using C# and .net, or any open source C# API's.