<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>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传