UtilSharpDXTakeScreenshot(Int32, Boolean) Method
Captures the screen output using the specified graphics card adapter.
This DirectX based methodology is useful to take screenshot of games that are running in full screen.
However, using this methodology for other common desktop screen captures will produce unexpected results (such as wrong colors);
so for common screenshots you should use the methods exposed in
UtilImage instead.
Namespace: DevCase.ThirdParty.SharpDXAssembly: DevCase.net48.ThirdParty.SharpDX (in DevCase.net48.ThirdParty.SharpDX.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static Image TakeScreenshot(
int adapterIndex,
bool includeMouse
)
Public Shared Function TakeScreenshot (
adapterIndex As Integer,
includeMouse As Boolean
) As Image
Dim adapterIndex As Integer
Dim includeMouse As Boolean
Dim returnValue As Image
returnValue = UtilSharpDX.TakeScreenshot(adapterIndex,
includeMouse)
public:
static Image^ TakeScreenshot(
int adapterIndex,
bool includeMouse
)
static member TakeScreenshot :
adapterIndex : int *
includeMouse : bool -> Image
No code example is currently available or this language may not be supported.
- adapterIndex Int32
-
The index of the graphics card adapter.
Set this value to 0 if you don't have more than one graphics card.
- includeMouse Boolean
-
If set to , the mouse is drawn in the resulting image.
Image
The resulting
Image.
Note: Some functionalities of this assembly may require to install one or all of the listed NuGet packages:
SharpDX
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 = TakeScreenshot(adapterIndex:=0, 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.