如何使用graphics.h包在c ++中截取输出控制台屏幕的屏幕截图 [英] how to take screen shot of a output console screen in c++ using graphics.h package

查看:112
本文介绍了如何使用graphics.h包在c ++中截取输出控制台屏幕的屏幕截图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在执行在c ++程序中绘制的平移,旋转技术。也使用图形包绘制线

但是我无法拍摄的屏幕截图控制台屏幕上的输出

我尝试了所有可能的组合以及alt + printscreen,但它不起作用

Pl z 轻松帮助我。 ..

Hi I am performing the translation,rotation techniques on line drawn in a c++ program.Also using a graphics package to draw the line
But i cannot take the screen shot of the output that comes on console screen
I tried all possible combinations and also alt+printscreen,but its not working
Plzease help me...

推荐答案

打印屏幕Alt + PrnScr始终适用于控制台应用程序。你做错了什么;或者你的操作系统坏了。



基本上,你是通过 getimage(int left,int top,int right,int bottom,void *)来实现的位图),请参阅:

http:// www .programmingsimplified.com / c / graphics.h / getimage [ ^ ]。



另外一个问题是如何获取控制台窗口的范围。在这里你需要使用 include< windows.h>



特别是你可以假设正在执行屏幕截图代码,或者您可以获得桌面上所有窗口的屏幕截图,或使用其他一些选择标准。您将需要以下一些Windows API函数:



http://msdn.microsoft.com/en-us/library/windows/desktop/ms633504%28v=vs.85%29.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/windows/desktop/ms633505%28v=vs.85%29.aspx [ ^ ],

http://msdn.microsoft.com /en-us/library/windows/desktop/ms633515%28v=vs.85%29.aspx [ ^ ],

http://msdn.microsoft.com/en-us/library/windows/desktop/ms633519%28v=vs.85%29.aspx [ ^ ]。



最后一个 GetWindowRect 最终给你的尺寸/调用 getimage 所需的位置参数。



-SA
Print screen Alt+PrnScr always works on console applications. You are doing something wrong; or your OS is broken.

Basically, you do it through getimage(int left, int top, int right, int bottom, void *bitmap), please see:
http://www.programmingsimplified.com/c/graphics.h/getimage[^].

Additional problem is how to get the extents of the console window. Here you need to use include <windows.h> as well.

In particular, you can assume that the screenshot code is being executed or you can get screen shot of all windows on the desktop, or use some other selection criteria. You will need some of the following Windows API functions:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms633504%28v=vs.85%29.aspx[^],
http://msdn.microsoft.com/en-us/library/windows/desktop/ms633505%28v=vs.85%29.aspx[^],
http://msdn.microsoft.com/en-us/library/windows/desktop/ms633515%28v=vs.85%29.aspx[^],
http://msdn.microsoft.com/en-us/library/windows/desktop/ms633519%28v=vs.85%29.aspx[^].

The last one GetWindowRect ultimately gives you the size/position parameters you need for a call to getimage.

—SA


可能是你可以使用getpixel函数并创建一个位图并保存到磁盘。它并不难。
may be you can use getpixel function and create a bitmap and save to disk. it is not that hard.


你可以在C ++的输出窗口中使用ALT + ENTER,然后你将全屏显示。

之后你可以使用Printscreen然后粘贴到mspaint。



它会起作用!!!!!!
You can use ALT + ENTER from output window of C ++ then you will come out of full screen.
After that you can use "Printscreen" and then paste in mspaint.

It will work !!!!!!


这篇关于如何使用graphics.h包在c ++中截取输出控制台屏幕的屏幕截图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆