Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any ideas?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01066620
Message ID:
01066662
Views:
16
This message has been marked as a message which has helped to the initial question of the thread.
Just a few suggestions and perhaps thoughts...

If you are going to use the form as the host for the image, then when the image is selected you will need to get the size of the image so you can set the form's viewport (this assumes that some images will be bigger than the form. Be careful with this approach if your images are large since the viewport of the form has a max width and height based on the resolution.

For the lines you could use the line class that VFP has, but the line class is actually a big square, so it makes it difficult to detect clicks on lines that overlap one another... the one at the top of the zorder gets the click.

Since you are using VFP 6, you are a little limited in that you don't have the _gdiplus.vcx class library. If you want to do this with GDI+ (draw your own lines) you'll need to use the GDI+ FLAT API functions.

As for the lines being moved around or re-angled... you'll need to use the MouseDown, MouseMove, and MouseUp (perhaps even the MouseLeave) events of your surface (whether it is the form, a container, image, or whatever) and draw/add the lines you want and then track the positions of those lines so you can tell when the mouse is over one end or the other of it. Then you can change the mouse cursor to something that signifies to the user that they can re-angle the line but click and drag. Just change the position/shape of the line as the user drags.

It's tedious and sometimes lengthy code, but not overly difficult. Good luck to you in your endeavour.


>Hi all,
>
>I need to append to an application some kind of line-drawing editor.
>What I'm trying to do is to load a bitmap on a form, then set some points over that image and draw lines from points to points to get the angles between the lines.
>I'd like also to move the points (drag & drop) to correct some angles.
>
>Any ideas of what to do?... use any active X? ... vfp code?
>Anyone did something like this?
>
>Thank you
>Fabian
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform