UtilImageTakeScreenshotFromForm Method
Takes a screenshot of a Form.
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 TakeScreenshotFromForm(
Form f,
bool includeMouse,
PixelFormat pixelFormat = PixelFormat.Format32bppArgb
)
Public Shared Function TakeScreenshotFromForm (
f As Form,
includeMouse As Boolean,
Optional pixelFormat As PixelFormat = PixelFormat.Format32bppArgb
) As Image
Dim f As Form
Dim includeMouse As Boolean
Dim pixelFormat As PixelFormat
Dim returnValue As Image
returnValue = UtilImage.TakeScreenshotFromForm(f,
includeMouse, pixelFormat)
public:
static Image^ TakeScreenshotFromForm(
Form^ f,
bool includeMouse,
PixelFormat pixelFormat = PixelFormat::Format32bppArgb
)
static member TakeScreenshotFromForm :
f : Form *
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.
- f Form
-
The Form 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 = TakeScreenshotFromForm(Me, includeMouse:=True)
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.