LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

drawing on a picture control

Hi,

I'm trying to create a sort of lasso tool VI. Something that you can
select a certain area of a graph. The way I am going about this, is
getting the picture of the graph, opening it in a picture control, and
now am currently trying to find the best way to draw on the picture.
Right now, i am drawing individual points and am trying to detect an
overlap in the points drawn. However, since the method I'm using to
draw doesn't draw on every single point and only a series of
unconnected dots, detection of overlap is rather inaccurate. Does
anybody know of a VI that allows you to draw on a picture control or
on a graph control? Or does anybody know of an existing lasso VI?

Thanks,

Jon
0 Kudos
Message 1 of 4
(2,989 Views)
Jon Gordner wrote:
> Hi,
>
> I'm trying to create a sort of lasso tool VI. Something that you can
> select a certain area of a graph. The way I am going about this, is
> getting the picture of the graph, opening it in a picture control, and
> now am currently trying to find the best way to draw on the picture.
> Right now, i am drawing individual points and am trying to detect an
> overlap in the points drawn. However, since the method I'm using to
> draw doesn't draw on every single point and only a series of
> unconnected dots, detection of overlap is rather inaccurate. Does
> anybody know of a VI that allows you to draw on a picture control or
> on a graph control? Or does anybody know of an existing lasso VI?
>
> Thanks,
>
> Jon

I suppose I call it a
'rubber banding'.

Start with a reference to the picture with the graph displayed.

In a loop, redraw a rectangle onto the picture as the mouse moves
(use the original reference each time the rectangle is drawn),
until the button is released, then process the 'selection'. This, and a
circular selection are about the simplest cases. Irregular regions sould
be made up of line segment, the selected region determined in a raster
scan means.
0 Kudos
Message 2 of 4
(2,989 Views)
Cult of Nurse's wrote in message news:<3F2FF798.8030509@health.com>...
> Jon Gordner wrote:
> > Hi,
> >
> > I'm trying to create a sort of lasso tool VI. Something that you can
> > select a certain area of a graph. The way I am going about this, is
> > getting the picture of the graph, opening it in a picture control, and
> > now am currently trying to find the best way to draw on the picture.
> > Right now, i am drawing individual points and am trying to detect an
> > overlap in the points drawn. However, since the method I'm using to
> > draw doesn't draw on every single point and only a series of
> > unconnected dots, detection of overlap is rather inaccurate. Does
> > anybody know of a VI that allows you to draw on a picture cont
rol or
> > on a graph control? Or does anybody know of an existing lasso VI?
> >
> > Thanks,
> >
> > Jon
>
> I suppose I call it a 'rubber banding'.
>
> Start with a reference to the picture with the graph displayed.
>
> In a loop, redraw a rectangle onto the picture as the mouse moves
> (use the original reference each time the rectangle is drawn),
> until the button is released, then process the 'selection'. This, and a
> circular selection are about the simplest cases. Irregular regions sould
> be made up of line segment, the selected region determined in a raster
> scan means.


what do you mean, "raster scan means"?

Thanks,
Jon
0 Kudos
Message 3 of 4
(2,989 Views)
Jon Gordner wrote:
> Cult of Nurse's wrote in message news:<3F2FF798.8030509@health.com>...
>
>>Jon Gordner wrote:
>>
>>>Hi,
>>>
>>>I'm trying to create a sort of lasso tool VI. Something that you can
>>>select a certain area of a graph. The way I am going about this, is
>>>getting the picture of the graph, opening it in a picture control, and
>>>now am currently trying to find the best way to draw on the picture.
>>>Right now, i am drawing individual points and am trying to detect an
>>>overlap in the points drawn. However, since the method I'm using to
>>>draw doesn't draw on every single point and only a series of
>>>unconnected dots, detection of overlap is rather inaccurate. Does
>>>anybody know of a VI that allows you to draw on a picture control or
>>>on a graph control? Or does anybody know of an existing lasso VI?
>>>
>>>Thanks,
>>>
>>>Jon
>>
>>I suppose I call it a 'rubber banding'.
>>
>>Start with a reference to the picture with the graph displayed.
>>
>>In a loop, redraw a rectangle onto the picture as the mouse moves
>>(use the original reference each time the rectangle is drawn),
>>until the button is released, then process the 'selection'. This, and a
>>circular selection are about the simplest cases. Irregular regions sould
>>be made up of line segment, the selected region determined in a raster
>>scan means.
>
>
>
> what do you mean, "raster scan means"?
>
> Thanks,
> Jon

If the selection shape is a box then it is easy to tell which pixels are
selected, it's defined by the four corners of the box, or actually the
equations of vertical and horizontal lines. Lets say the selection shape
is defined by an octagon. In order to tell what pixels are selected you
start at the top by determining the minimum y coordinate of the
selection shape. This defines either a line if the top edge of the shape
is parallel to the x axis, or a point in case the octagon is spun with
respect to the x axis. For the next line down, as you begin to raster
scan, the length will be determined by the equation of two lines, etc.
As you move down line by line, the selection lasso line equations change
as the edges of the bounding shape change.
0 Kudos
Message 4 of 4
(2,989 Views)