Moon
Moon

Reputation: 20012

Screen Capture Feature Overrides

what i want to do is write an application in C# like "fraps" and other scren capture apps that when you press the "Print Screen" it saves the current screen as an image.

What i thought of is that

"i could create a background worker thread that checks the clipboard after x seconds and if there is an image, that is now in clipboard because of print screen click, it writes the clipboard contents to a jpeg or bitmap file" bu i lack the following knowledge

Can anybody endow me with some knowledge or guide or help from C# coding prespective

Upvotes: 0

Views: 421

Answers (1)

DeusAduro
DeusAduro

Reputation: 6076

The saving to a particular format is incredibly easy thanks to the Image class:

myImage.Save("someimage.bmp", System.Drawing.Imaging.ImageFormat.Bmp);

As far as checking the clipboard, well you can do this, but i think you might run into issues that you won't know whether the image came from a Print-Screen, or from a Ctrl-c that the user did. However you can easily check the clipboard:

if (Clipboard.ContainsImage())  
    myImage = Clipboard.GetImage();

Upvotes: 2

Related Questions