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;    
screenshot("my_file_name");

For Junit:

@Rule
public ScreenShooter makeScreenshotOnFailure = 
     ScreenShooter.failedTests().succeededTests();

For TestNG:

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