如何在Windows窗体PictureBox中选择一个区域?

编程入门 行业动态 更新时间:2024-10-26 08:28:15
本文介绍了如何在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中选择一个区域?

本文发布于:2023-11-07 01:10:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1565143.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:窗体   区域   如何在   Windows   PictureBox

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!