UtilImageTakeScreenshotFromScreen Method
Takes a screenshot of the specified screen.
Namespace: DevCase.Core.Media.GraphicsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static Image TakeScreenshotFromScreen(
Screen scr,
bool includeMouse,
PixelFormat pixelFormat = PixelFormat.Format32bppArgb
)
Public Shared Function TakeScreenshotFromScreen (
scr As Screen,
includeMouse As Boolean,
Optional pixelFormat As PixelFormat = PixelFormat.Format32bppArgb
) As Image
Dim scr As Screen
Dim includeMouse As Boolean
Dim pixelFormat As PixelFormat
Dim returnValue As Image
returnValue = UtilImage.TakeScreenshotFromScreen(scr,
includeMouse, pixelFormat)
public:
static Image^ TakeScreenshotFromScreen(
Screen^ scr,
bool includeMouse,
PixelFormat pixelFormat = PixelFormat::Format32bppArgb
)
static member TakeScreenshotFromScreen :
scr : Screen *
includeMouse : bool *
?pixelFormat : PixelFormat
(* Defaults:
let _pixelFormat = defaultArg pixelFormat PixelFormat.Format32bppArgb
*)
-> Image
No code example is currently available or this language may not be supported.
- scr Screen
-
The Screen to capture.
- includeMouse Boolean
-
If set to , the mouse is drawn in the resulting image.
- pixelFormat PixelFormat (Optional)
-
The image pixel format.
Image
The resulting image.
This is a code example.
No code example is currently available or this language may not be supported.
Dim jpgCodec As ImageCodecInfo =
(From codec As ImageCodecInfo In ImageCodecInfo.GetImageEncoders()
Where codec.FormatID = ImageFormat.Jpeg.Guid).Single()
Dim encoderParams As New EncoderParameters(1)
Dim qualityEncoder As Imaging.Encoder = Imaging.Encoder.Quality
Dim qualityParameter As New EncoderParameter(qualityEncoder, 80)
encoderParams.Param(0) = qualityParameter
Dim screenshot As Image = TakeScreenshotFromScreen(Screen.PrimaryScreen, includeMouse:=False)
screenShot.Save("C:\Screenshot.jpg", jpgCodec, encoderParams)
Process.Start("C:\Screenshot.jpg")
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.