Whats the best way to take a screenshot for a bot? Should I store the screenshots in the temp dir then upload them to my panel?
|
C#
Trying to add screenshots to lite http bot |
|
Here's an example I made one time https://hackforums.net/showthread.php?ti...id56745560
![]() (May 1, 2018 03:22 PM)gigajew Wrote: Here's an example I made one time https://hackforums.net/showthread.php?ti...id56745560 Thanks for the example code.
May 16, 2018 11:56 PM
(This post was last modified: May 17, 2018 12:00 AM by Raiden69.)
Here's how I take a screenshot using native methods.
Code [DllImport("gdi32.dll")]If I were you I'd upload them on the fly yes. Before uploading I would consider resizing (to a smaller size) and also compression. Have a look at System.IO.Compression (DeflateStream class) or alternatively you can do something dirty such as save the image on the hard disk as a lossy/high compression format such as jpg and upload that without having to write any compression code yourself. (May 16, 2018 11:56 PM)Raiden69 Wrote: Here's how I take a screenshot using native methods. It doesn't really matter what method you use with C# because there's no such thing as "lite" or "native" (May 17, 2018 12:36 AM)Cød3ing Wrote: It doesn't really matter what method you use with C# because there's no such thing as "lite" or "native" There are more efficient/faster ways to work with bitmaps using unsafe code as compared to 'normal' methods. For example, there are unsafe alternatives to GetPixel that work much more efficiently. (May 17, 2018 12:36 AM)Cød3ing Wrote: It doesn't really matter what method you use with C# because there's no such thing as "lite" or "native" Did not say that it makes a difference. CopyFromScreen still interfaces with BitBlt, it's just a personal preference (+ might potentially save on some overhead by using Win32 directly rather than a subset of it/something much higher up). There is such a thing as calling native functions/PInvoke from managed code... (May 17, 2018 12:36 AM)Cød3ing Wrote: It doesn't really matter what method you use with C# because there's no such thing as "lite" or "native" https://docs.microsoft.com/en-us/dotnet/...et-native/ |
|
|


![[Image: Syr3DlV.png]](https://i.imgur.com/Syr3DlV.png)