LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

why won't this fill with any color

i can draw on both pictures but on the second graphic i would like to fill with the color of my choosing but for some reason i can not
0 Kudos
Message 1 of 18
(3,920 Views)
I don't completely understand what you are trying to do.  One thing I noticed is that the program seems to run rather slowly.
 
I don't think lines are fillable items as individula entities.  I see you have a function in there called draw multiple lines which has the Fill button wired to it.  But there are no line coordinates going into it.  So I don't think that function is doing anything.
 
What I think you might have to do is build an array of endpoints, and only call that  draw multiple lines function once you do a mouse up and several endpoints have been accumulated.
Message 2 of 18
(3,897 Views)
basically what i want to do is, have one graphic where both graphics are drawn on but once i am done one graphic has what ever was drawn it and the other graphic has the same drawing but has some coloring filling it... sorry if this is had to make sense i think that is why im having difficulty with it
0 Kudos
Message 3 of 18
(3,871 Views)
One thing you'll need to do is separate your two picture controls.  They are both getting there data from the same shift register.  Create another shift register so that each picture has its own data.  You'll have to figure out how to get the fill multiple lines function to work.  Like I said before, that function doesn't look like it is working because no line endpoints are being fed into it.  I think you'll need to draw each individual line and accumulate the endpoints in an array (holding the array in a third shift register) during the mouse down and mouse move events.  When the mouse up event occurs, then feed that array of endpoints into the draw multiline function which only acts on the one picture and feed an empty array of endpoints to your shift register.
0 Kudos
Message 4 of 18
(3,865 Views)
ok so i separated the two graphics it but for some reason i am still unable to use the fill option. i've tried it two different ways for some reason my graphic disappears. i made another case structure for the mouse up option but still am having difficulty
0 Kudos
Message 5 of 18
(3,828 Views)
this is my program
Message 6 of 18
(3,825 Views)

You are only turning one set of coordinates into a 1-D array of endpoints with a single element with your build array function.  You need to store the array in a shift register.  When there is a new point, use build array, but build it onto the array coming out of the shift register  Drag down the bottom border of the build array function to get more inputs.

Only do the draw multilines in the mouse up event.  The mouse down event should probably do nothing but set your true/false flag to true.

These are quick comments for now.  I don't have time at the moment to modify your code to make it work better.

Message 7 of 18
(3,801 Views)
Try this. I didn't try to spend too much time straightening out wiring.
 
I had to fix up a few things in it.  For instance, on mouse down, I did a move pen so that it wouldn't draw the first line from 0,0 or last end point all the time.  It only works as a free hand drawing.  It would be possible to do a point to point to point so that you could draw straight line objects (i.e. triangles, squares, etc.) , but you would have to come up with an alternate way to stop creating the array of points to be filled besides mouse up.  Perhaps another button such as draw.


Message Edited by Ravens Fan on 11-14-2007 04:56 PM
Message 8 of 18
(3,773 Views)

I am trying to do something similar to this except I would like the VI to stop when you release the mouse after drawing a shape.  I am able to get the program to work properly as long as you don't open the image from the file dialog over top of the image you are drawing on.  The problem I am running into is when you open the image over top the image you are drawing on.  The program is ending prematurely because the mouse button is going up over the image.  Does anyone know how to solve this problem where both cases are satisfied?

0 Kudos
Message 9 of 18
(3,112 Views)

Does the program stop running because you move the mouse out of the drawing window to open another file or because you click to open the new image?

0 Kudos
Message 10 of 18
(3,056 Views)