- Home
·
- Graphics
·
- VERY USEFUL CODE FOR DRAWING GRAPHIC IN ENGINEERING APPLICATION
VERY USEFUL CODE FOR DRAWING GRAPHIC IN ENGINEERING APPLICATION
VERY USEFUL CODE FOR DRAWING GRAPHIC IN ENGINEERING APPLICATION
API Declarations
Dim line1 As Boolean
Rate VERY USEFUL CODE FOR DRAWING GRAPHIC IN ENGINEERING APPLICATION
(1(1 Vote))
Screen.MousePointer = vbCrosshair 'Changing the mouse pointer to Crosshair
line1 = True ' Start Drawing the line
cx1 = X ' Set to X1 Co-ordinate point where 'Userpoints
cy1 = Y ' Set to Y1 Co-ordinate point where User 'points
PSet (cx1, cy1)
' Line -(cx1, cy1) ' Draw the starting point of the line
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If line1 = True Then
Refresh
cx2 = X
cy2 = Y
m1 = (cx1 + cx2) / 2
m2 = (cy1 + cy1) / 2
Line (cx1, cy1)-(m1, m2)
Line (m1, m2)-(m1, Y)
Line (m1, Y)-(X, Y)
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
line1 = False
End Sub
Private Sub Form_Load()
DrawWidth = 1 ' Use wider brush.
ForeColor = RGB(255, 255, 255) ' Set drawing color.
Refresh
End Sub
VERY USEFUL CODE FOR DRAWING GRAPHIC IN ENGINEERING APPLICATION Comments
No comments yet — be the first to post one!
Post a Comment