在桌面上选择区域的矩形 [英] Selecting area rectangle on desktop

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

问题描述

我试图创建C#.NET模仿Windows 7的截图工具,其中,当运行应用程序(或者通过特定的按键或不过,我选择来启动它),用户可以的能力的应用程序绘制画面无论哪个窗口具有焦点上的一个矩形,为了捕捉在桌面的矩形快照。

I'm trying to create an application in C#.NET that mimics the ability of the Windows 7 snipping tool, where when the application is run (or by a particular keystroke or however I choose to initiate it), the user can draw a rectangle on the screen no matter which window has focus, in order to capture a rectangular snapshot of the desktop.

我已经知道如何利用Graphics.CopyFromScreen()方法以节省给出一个特定的矩形快照,但在那里我难倒是实际的矩形选区,以及如何获得的边界。

I already know how to utilize the Graphics.CopyFromScreen() method in order to save a snapshot given a particular rectangle, but where I'm stumped is the actual rectangular selection and how to obtain the bounds from that.

推荐答案

的<一个href="http://www.$c$cproject.com/Articles/21913/TeboScreen-Basic-C-Screen-Capture-Application">TeboScreen:在code项目基本C#屏幕捕捉应用程序正是这一点。

按住鼠标左键,用户绘制一个矩形指定他们希望捕捉屏幕的哪个部分。 ...该MOUSE_MOVE事件用于决定用户是否拉丝,拖动(移动)或调整大小选择区域。

Holding down the left mouse button, the user draws a rectangle specifying which part of the screen they wish to capture. ... The mouse_Move event is used to decide on whether the user is drawing, dragging(moving) or resizing the selection area.

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

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