Blender Game Engine render scene to image

Hi has anyone tried render in Blender Game (similar to rendering in Blender Render)? I have a custom shader written in python and wanted to render like Blender Render, but it just look different than whatever shown in game engine. I wanted to have a custom image size so the Blender Game Engine can render to that image.