Sliding Points in Picture Box 
Author Message
 Sliding Points in Picture Box

I'm writing a routine which displays a line-graph.  Each "tick" on the X
axis represents a frame of video, while the Y axis contains the "value".  
The user begins with only two end points, the first and the last, out of
an "infinite" number of possible points.  I've successfully managed to
write a routine that interpolates the points that are displayed (and are
joined by a line) in a picture box (because the picture box can only
display 20 such points out of, say, 1000).

I'd like the user to be able to:

a) click somewhere on the picture box.  The position of the mouse when
he/she clicks will determine the particular frame they want to add a
point to (x axis) and the value of the point they are adding (y axis)

b) drag a point up or down within the picture box to change the value (y
axis) of that point

My difficulty lies in the fact that I can't find any means of determining
the mouse location when the mouse button is pressed and when it is
released (or just clicked)

Any ideas?

Paul



Mon, 27 Oct 1997 03:00:00 GMT  
 Sliding Points in Picture Box

says...

Quote:
>My difficulty lies in the fact that I can't find any means of determining
>the mouse location when the mouse button is pressed and when it is
>released (or just clicked)

I'm not sure I understand you question, but it could be as simple as the X
and Y values that the MouseDown, MouseMove, and MouseUp events return.

i.e.:

Sub Form_MouseDown (X As Single, Y As Single)
        InitialX = X
        InitialY = Y
        StartBox = True
End Sub

Sub Form_MouseMove (X As Single, Y As Single)
        If StartBox = True Then
                Line (InitialX, InitialY)-(X, Y), QBColor(0), BF
        End If
End Sub

Sub Form_MouseUp (X As Single, Y As Single)
        StartBox = False
End Sub

As long as you make InitialX, InitialY, and StartBox global variables, this
little program will draw black boxes starting from where you click,
extending to where you drag, and ending where you release the mouse button.

Good luck.
--
 ====================================================================
       /\      Mike Schetterer    "So far, my worst day mountain
    /\/  \     USAF Academy        biking has been better than
   /  \   \    Colorado            my best day at work"

        Windows NT -- It's not just for breakfast anymore!
 ====================================================================



Sat, 01 Nov 1997 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. insertin picture onto power point 97 slide

2. A question regarding a Picture box - slide show

3. pixel problem (point in picture box)

4. Playing AVI in Picture box and also geting point RGB vals

5. Point to point on a graph (with a picture)

6. Bind a recordset to my power point slide show

7. Macro to sort Power Point Slides Radomly

8. Macro to sort Power Point Slides Radomly

9. insert picture box inside picture box

10. slide show with JPG pictures

11. Picture VBX or slide show

12. Can I read a picture's data from a powerpoint slide with VB method

 

 
Powered by phpBB® Forum Software