How to take screenshot with Selenium WebDriver

Does anyone know if it’s possible to take a screenshot using Selenium WebDriver? (Note: Not Selenium RC)

Here is how the Selenide project does it, making easier than just about any other way of doing it:

import static com.codeborne.selenide.Selenide.screenshot;    

For Junit:

public ScreenShooter makeScreenshotOnFailure = 

For TestNG:

import com.codeborne.selenide.testng.ScreenShooter;
@Listeners({ ScreenShooter.class})