hi all,
i have to save the screen using the print screen key. i.e when i press the print screen key on the keyboard, the snapshot of the screen should be saved as a jpeg image.. how i can i do this on windows application

Print screen is usually taken by windows, and a picture put in the clipboard, you could test the clipboard for a picture and save it?

can u please tel me the command or code to save the screen....

Hi,

> Press Print Screen
> Now Clipboard contains the Screen Image
use following code to save the image

if (Clipboard.ContainsImage())
    {
        Image screenshot = Clipboard.GetImage();
        screenshot.Save("c:\\screenshot.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
    }

Note: Clipboard.GetImage() is new in the .NET Framework version 2.0.

A cleaner way to do it is with API calls, there is an example in this page on how to Capture the Screen.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.