-
I made csharp script that copy screenshot to clipboard without 3rd party dependecies https://github.com/A-tG/mpv.net-scripts/blob/main/scripts-cs/screenshot-to-clipboard.cs |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
There is a suitable command described here: https://mpv.io/manual/master/#command-interface-screenshot-raw But marshalling the data might be a challenge, once I tried such data marshalling and failed, maybe it's not even possible. It's easier to write in C and load a C library. Or maybe a creative usage of VapourSynth would be possible. |
Beta Was this translation helpful? Give feedback.
-
I know some stuff about marshaling, however I have no idea how to get result from "screenshot-raw" command (or how to call internal version of it), because obviously CommandV() return void |
Beta Was this translation helpful? Give feedback.
-
Made it |
Beta Was this translation helpful? Give feedback.
Made it
https://github.com/A-tG/mpv.net-scripts/blob/main/scripts-cs/screenshot-to-clipboard.cshttps://github.com/A-tG/mpv.net-ScriptsExtension/blob/main/AtgScriptsExtension/ScreenshotToClipboardScript.csQuite ugly code. SetPixel() in a loop is very slow, and the whole thing probably can be optimized with usnafe code and allocating structures with stackalloc instead of AllocHGlobal()