by NAVEEN KUMAR .R (1 Submission)
Category: Graphics
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 18th November 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)
VERY USEFUL CODE FOR DRAWING GRAPHIC IN ENGINEERING APPLICATION
API Declarations
Dim line1 As Boolean
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
No comments have been posted about VERY USEFUL CODE FOR DRAWING GRAPHIC IN ENGINEERING APPLICATION. Why not be the first to post a comment about VERY USEFUL CODE FOR DRAWING GRAPHIC IN ENGINEERING APPLICATION.