<p>I want my program to capture a full screenshot and then covert it into bytes so it can be uploaded to a server.</p>
<p>I can't find any example that are doing this in a simpler way. I found <a href="https://github.com/mattn/gyagowin">https://github.com/mattn/gyagowin</a> but there is so much going on with extra stuff that i can't figure out what i need...</p>
<p>To clarify, I want to be able to capture a screenshot of a windows machine without relying on an external program. Use a API wrapper like <a href="https://github.com/cwchiu/go-winapi">https://github.com/cwchiu/go-winapi</a> . </p>
<hr/>**评论:**<br/><br/>mc_hammerd: <pre><p>a better way might to be find a windows library (.dll) that does screenshots and then load that with gos C Pkg: <code>import "C"</code></p></pre>SaturnsVoid: <pre><p>But thats still using external library, I want it to be a single standalone .exe</p></pre>ergotayours: <pre><p>Find out how to take screenshots with the Windows API, then use cgo to do it from Go. <a href="https://stackoverflow.com/questions/531684/what-is-the-best-way-to-take-screenshots-of-a-window-with-c-in-windows" rel="nofollow">This StackOverflow question</a> would probably be a good start.</p></pre>kardianos: <pre><p>I built a library (closed source, a large company owns the source code) to do just that in native go. Long story short, Find an example of how to do this in C, then translate to Go. Use the syscall library to import system DLLs and call functions.</p></pre>
