|
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.
|
|
|
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 ImageCodecInfo | GetEncoderInfo (ImageFormat format) |
| Retrieves the encoder information for the specified image format.
|
|
◆ 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.
◆ 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
-
hDC | A handle to the device context where the icon will be drawn. |
X | The x-coordinate of the upper-left corner of the icon. |
Y | The y-coordinate of the upper-left corner of the icon. |
hIcon | A handle to the icon to be drawn. |
- Returns
- True if the icon is successfully drawn; otherwise, false.
◆ GetCursorInfo()
static bool Plugin.ScreenshotTaker.GetCursorInfo |
( |
out CURSORINFO | pci | ) |
|
|
private |
Retrieves information about the global cursor.
- Parameters
-
pci | A reference to a CURSORINFO structure that receives the cursor information. |
- Returns
true
if successful; otherwise, false
.
◆ GetEncoderInfo()
static ImageCodecInfo Plugin.ScreenshotTaker.GetEncoderInfo |
( |
ImageFormat | format | ) |
|
|
inlinestaticprivate |
Retrieves the encoder information for the specified image format.
- Parameters
-
format | The 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.
◆ 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
-
quality | The quality of the image (0-100). |
screenIndex | The index of the screen to capture. |
captureCursor | A boolean value indicating whether to capture the cursor in the screenshot. |
scaleImageSize | The 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.ArgumentOutOfRangeException | Thrown when the screen index is out of range. |
◆ CURSOR_SHOWING
const Int32 Plugin.ScreenshotTaker.CURSOR_SHOWING = 0x00000001 |
|
staticprivate |
The documentation for this class was generated from the following file:
- /Users/sumansaurabh/Documents/my-startup/xeno-rat/Plugins/ScreenControl/ScreenControl.cs