从几次鼠标按下事件中获取像素阵列 [英] getting an array of pixels from several mouse down events

查看:38
本文介绍了从几次鼠标按下事件中获取像素阵列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试实现一个程序,在该程序中,我想通过在图片框上的不同位置多次单击鼠标来获取用户输入的点数组,简单的picturebox_mousdown事件只能为我节省一个点,
有帮助吗?

i am trying to implement a program in which i want to get an array of points that the user enters by clicking the mouse several times in different places over a picturebox ,the simple picturebox_mousdown event can only save for me one point ,
any help ?

推荐答案

在类级别创建一个List<Point>,并在每次单击事件时使用List.Add方法将一个新点添加到列表中. br/>
在某个时候,您将想要清除列表或复制引用并为其分配一个新列表,但这是基本的东西!
Create a List<Point> at class level, and at each click event use the List.Add method to add a new point into the list.

At some point you will want to either clear the list or copy the reference and assign a new list to it, but that''s basic stuff!


这篇关于从几次鼠标按下事件中获取像素阵列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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