在桌面上显示矩形. [英] Rectangle on Desktop.

查看:148
本文介绍了在桌面上显示矩形.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

我需要编写一个程序在桌面上创建一个矩形,该矩形将选择桌面的任何部分(可能包括完整的屏幕),然后我需要捕获该部分.我了解捕获的知识,但是我不需要使用哪些Windows API来绘制选择矩形.

我正在使用c ++和vc ++编译器.

请建议我如何执行此任务.如果您有任何链接或相应的代码,请提供这些链接.

等待您的答复....在此先谢谢您....

Dear all,

I need to write a program to create a rectangle on desktop, which will selects any portion of the desktop (It may include complete screen) and then I need to capture that portion. I know about capturing, but I don''t which windows APIs I need to use to draw selection rectangle.

I am using c++ and vc++ compiler.

Please suggest me how to execute this task. If you have any links or respective code, give those.

Awaiting for your reply.... Thanks in advance....

推荐答案

好,您确实对其进行了标记,WinGDI允许您这样做. br/>
CP上有很多文章:
http://www.codeproject.com/KB/GDI/ [
Well, you did tag it appropriately, the WinGDI would allow you to do that.

There are plenty of articles here at CP:
http://www.codeproject.com/KB/GDI/[^]


请参阅以下最新问题:

如何截取单个CWnd对象? [
See this recent question:

How can I take a screenshot of a single CWnd object?[^]

The original poster posted his code for taking a screenshot of the entire screen.

That code will work to also take a screenshot of some smaller rectangle on the screen, if you change the width and height of the destination bitmap and the offset and width and height in the bitblt() call.


大家好,

感谢您的解决方案.....我有一个通过跟踪鼠标消息来绘制矩形的代码.我需要知道如何处理由鼠标移动在桌面上的任何位置发布的鼠标或键盘消息,即使它在其他窗口上也是如此.只有我知道如何处理特定于窗口的消息.请向我建议正确的方向....

等待您的回复....在此先感谢...

Anand
Hi all,

Thanks for your solutions.....I got a code to draw a rectangle by tracking mouse messages. I need to know how to handle mouse or keyboard messages posted by mouse movement anywhere on desktop even if it is on other windows. Only I know how to handle messages specific to a window. Please suggest me in right direction....

Awaiting for your reply.... Thanks in advance...

Anand


这篇关于在桌面上显示矩形.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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