如何在Windows窗体PictureBox中选择一个区域? [英] How to select a region in a Windows Forms PictureBox?

查看:606
本文介绍了如何在Windows窗体PictureBox中选择一个区域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过允许用户选择
A矩形区域(类似于它如何在Photoshop中进行与选择工具),以获得在PictureBox图片的一部分。

I want to get a part of picture in a PictureBox by allowing the user to select a rectangular region (similar to how it can be done in Photoshop with selection tool).

我怎么能这样做呢?

推荐答案

您必须借鉴的基础上,他们点击和拖动矩形或线条。你的出发点是鼠标X,Y,然后你会得到从鼠标释放X,Y的最后一点。

You would have to draw a rectangle or lines based on where they clicked and dragged. Your starting point would be the mouse x, y and then you would get the last point from mouse release x, y.

这篇关于如何在Windows窗体PictureBox中选择一个区域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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