Xeno-rat
Loading...
Searching...
No Matches
Plugin.ScreenshotTaker Class Reference
Collaboration diagram for Plugin.ScreenshotTaker:

Classes

struct  CURSORINFO
 
struct  POINTAPI
 

Static Public Member Functions

static byte[] TakeScreenshot (int quality, int screenIndex, bool captureCursor, double scaleImageSize=1)
 Takes a screenshot of the specified screen and returns the image data as a byte array.
 
static string[] AvailableMonitors ()
 Retrieves the names of all available monitors.
 

Private Member Functions

static bool GetCursorInfo (out CURSORINFO pci)
 Retrieves information about the global cursor.
 
static bool DrawIcon (IntPtr hDC, int X, int Y, IntPtr hIcon)
 Draws an icon at the specified coordinates on the device context.
 

Static Private Member Functions

static ImageCodecInfo GetEncoderInfo (ImageFormat format)
 Retrieves the encoder information for the specified image format.
 

Static Private Attributes

const Int32 CURSOR_SHOWING = 0x00000001
 

Member Function Documentation

◆ AvailableMonitors()

static string[] Plugin.ScreenshotTaker.AvailableMonitors ( )
inlinestatic

Retrieves the names of all available monitors.

Returns
An array of strings containing the names of all available monitors.

This method retrieves the names of all available monitors by querying the system for the list of screens using the Screen.AllScreens property. It then creates an array of strings to store the names of the monitors and populates it by iterating through the list of screens and retrieving the DeviceName property of each screen. The method returns the array of monitor names.

Here is the caller graph for this function:

◆ DrawIcon()

static bool Plugin.ScreenshotTaker.DrawIcon ( IntPtr hDC,
int X,
int Y,
IntPtr hIcon )
private

Draws an icon at the specified coordinates on the device context.

Parameters
hDCA handle to the device context where the icon will be drawn.
XThe x-coordinate of the upper-left corner of the icon.
YThe y-coordinate of the upper-left corner of the icon.
hIconA handle to the icon to be drawn.
Returns
True if the icon is successfully drawn; otherwise, false.
Here is the caller graph for this function:

◆ GetCursorInfo()

static bool Plugin.ScreenshotTaker.GetCursorInfo ( out CURSORINFO pci)
private

Retrieves information about the global cursor.

Parameters
pciA reference to a CURSORINFO structure that receives the cursor information.
Returns
true if successful; otherwise, false.
Here is the caller graph for this function:

◆ GetEncoderInfo()

static ImageCodecInfo Plugin.ScreenshotTaker.GetEncoderInfo ( ImageFormat format)
inlinestaticprivate

Retrieves the encoder information for the specified image format.

Parameters
formatThe image format for which to retrieve the encoder information.
Returns
The ImageCodecInfo object that represents the encoder for the specified image format, or null if no matching encoder is found.

This method retrieves the available image encoders using ImageCodecInfo.GetImageEncoders and iterates through the list to find the encoder that matches the specified image format's GUID. If a matching encoder is found, it is returned; otherwise, null is returned.

Here is the caller graph for this function:

◆ TakeScreenshot()

static byte[] Plugin.ScreenshotTaker.TakeScreenshot ( int quality,
int screenIndex,
bool captureCursor,
double scaleImageSize = 1 )
inlinestatic

Takes a screenshot of the specified screen and returns the image data as a byte array.

Parameters
qualityThe quality of the image (0-100).
screenIndexThe index of the screen to capture.
captureCursorA boolean value indicating whether to capture the cursor in the screenshot.
scaleImageSizeThe scale factor for resizing the captured image (default is 1).
Returns
The image data as a byte array representing the screenshot of the specified screen.

This method captures the screenshot of the specified screen using the specified quality and captures the cursor if specified. It then encodes the image data as a byte array and returns it. If the specified screen index is invalid, it returns null and logs an error message to the console.

Exceptions
System.ArgumentOutOfRangeExceptionThrown when the screen index is out of range.
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ CURSOR_SHOWING

const Int32 Plugin.ScreenshotTaker.CURSOR_SHOWING = 0x00000001
staticprivate

The documentation for this class was generated from the following file: