Manjesh
asked on
How can i obtain a Line Object???????????
Hi all,
I want line component.
There r many components which provide the line shape, but the problem is they draw a line on a window, so if i handle any mouse events for that line , it wil be applied to the entire window.This pose severe problem,like if a draw a big line on the form , i wont be able to select any of the object(Windows) , behind the line.
_____
|\ |
| \ |
| \ |
| \ |
| \ |
| \ |
|___\ |
So i want a component which handle events on the line and not for the entire Window
Thank u for ur earliest attention
Manjesh
I want line component.
There r many components which provide the line shape, but the problem is they draw a line on a window, so if i handle any mouse events for that line , it wil be applied to the entire window.This pose severe problem,like if a draw a big line on the form , i wont be able to select any of the object(Windows) , behind the line.
_____
|\ |
| \ |
| \ |
| \ |
| \ |
| \ |
|___\ |
So i want a component which handle events on the line and not for the entire Window
Thank u for ur earliest attention
Manjesh
hello Manjesh, this is a difficult thing, are you experienced with graphical methods, maybe API Device Context methods, regions and others?
This is easy to do.
y = mx + b
If you have this equation (the equation of a straight line) you can see if the mouse was clicked inside this
line. The OnMouseDown event gives you X,Y coords of the mouse pointer. Just plug them in to the equation
and see if y = mx + b. If the equation is correct, then you have hit the line, otherwise it has not.
Well, at least that's what I understood you wanted. If not, explain yourself better.
y = mx + b
If you have this equation (the equation of a straight line) you can see if the mouse was clicked inside this
line. The OnMouseDown event gives you X,Y coords of the mouse pointer. Just plug them in to the equation
and see if y = mx + b. If the equation is correct, then you have hit the line, otherwise it has not.
Well, at least that's what I understood you wanted. If not, explain yourself better.
ASKER
hi slick,
i am familiar with the HDC , BeginPaint , EndPaint.................. ..... , but how wil it help me,
If u hav ne further references for me , it wil be greatful
hi YUY0x7 ,
suppose if 1 draw some intersecting lines, and i click on the point of intersection then which line shal i select.
If i hav line as objects,consider that i hav 100 object , OnMouseClick i hav to check for 100 objects.
It wil be really helpful if u can give some solution for this
i am familiar with the HDC , BeginPaint , EndPaint..................
If u hav ne further references for me , it wil be greatful
hi YUY0x7 ,
suppose if 1 draw some intersecting lines, and i click on the point of intersection then which line shal i select.
If i hav line as objects,consider that i hav 100 object , OnMouseClick i hav to check for 100 objects.
It wil be really helpful if u can give some solution for this
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi slick
It cant be better than this , but i hav few issues regarding this, in implementing in my project , i wil get to u as and when its done and accept ur answer
It cant be better than this , but i hav few issues regarding this, in implementing in my project , i wil get to u as and when its done and accept ur answer