VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Allows you to draw lines without using the 'Line' method. This could be useful if you just want to

by Ralph Barton (5 Submissions)
Category: Graphics
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 23rd November 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Allows you to draw lines without using the 'Line' method. This could be useful if you just want to return the coordinates, rather than plot

Rate Allows you to draw lines without using the 'Line' method. This could be useful if you just want to



Dim TmpX As Integer
Dim TmpY As Integer

TmpX = Val(X)
TmpY = Val(Y)

PixLine 10, 10, TmpX, TmpY, 150
End Sub

Public Function PixLine(MoveX1 As Integer, MoveY1 As Integer, MoveX2 As Integer, MoveY2 As Integer, PixRes As Integer) As String
Dim TmpX
Dim TmpY
Dim CurX
Dim CurY

TmpX = MoveX1
TmpY = MoveY1

TmpX = MoveX2 - TmpX
TmpY = MoveY2 - TmpY

TmpX = TmpX / PixRes
TmpY = TmpY / PixRes

For cnt = 1 To PixRes
CurX = (TmpX * cnt) + MoveX1
CurY = (TmpY * cnt) + MoveY1
Picture1.PSet (CurX, CurY), RGB(255, 0, 0)
Next cnt
End Function


Download this snippet    Add to My Saved Code

Allows you to draw lines without using the 'Line' method. This could be useful if you just want to Comments

No comments have been posted about Allows you to draw lines without using the 'Line' method. This could be useful if you just want to . Why not be the first to post a comment about Allows you to draw lines without using the 'Line' method. This could be useful if you just want to .

Post your comment

Subject:
Message:
0/1000 characters