UtilImageTakeScreenshotFromRegion(Point, Size, 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(
Point location,
Size size,
bool includeMouse,
PixelFormat pixelFormat = PixelFormat.Format32bppArgb
)
Public Shared Function TakeScreenshotFromRegion (
location As Point,
size As Size,
includeMouse As Boolean,
Optional pixelFormat As PixelFormat = PixelFormat.Format32bppArgb
) As Image
Dim location As Point
Dim size As Size
Dim includeMouse As Boolean
Dim pixelFormat As PixelFormat
Dim returnValue As Image
returnValue = UtilImage.TakeScreenshotFromRegion(location,
size, includeMouse, pixelFormat)
public:
static Image^ TakeScreenshotFromRegion(
Point location,
Size size,
bool includeMouse,
PixelFormat pixelFormat = PixelFormat::Format32bppArgb
)
static member TakeScreenshotFromRegion :
location : Point *
size : Size *
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.
- location Point
-
The X-coordinate is the point at the upper-left corner of the region.
The Y-coordinate is the point at the upper-left corner of the region.
- size Size
-
The size of the area to be transferred.
- 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 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.