UtilImageTakeScreenshotFromRegion(Rectangle, Boolean, PixelFormat) Method
Takes a screenshot of a screen region.
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 TakeScreenshotFromRegion(
Rectangle rect,
bool includeMouse,
PixelFormat pixelFormat = PixelFormat.Format32bppArgb
)
Public Shared Function TakeScreenshotFromRegion (
rect As Rectangle,
includeMouse As Boolean,
Optional pixelFormat As PixelFormat = PixelFormat.Format32bppArgb
) As Image
Dim rect As Rectangle
Dim includeMouse As Boolean
Dim pixelFormat As PixelFormat
Dim returnValue As Image
returnValue = UtilImage.TakeScreenshotFromRegion(rect,
includeMouse, pixelFormat)
public:
static Image^ TakeScreenshotFromRegion(
Rectangle rect,
bool includeMouse,
PixelFormat pixelFormat = PixelFormat::Format32bppArgb
)
static member TakeScreenshotFromRegion :
rect : Rectangle *
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.
- rect Rectangle
-
A Rectangle structure that represents the location and size of the region.
- 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 = TakeScreenshotFromRegion(New Rectangle(New Point(0, 0), New Size(256, 256)), 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.