VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Draw shapes and fill them with random colours.

by Jim the best (3 Submissions)
Category: Graphics
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 5th September 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Draw shapes and fill them with random colours.

API Declarations


(put this in a module on one line)
Declare Sub FloodFill Lib "GDI32" (ByVal hDC As Long, ByVal X As Long, ByVal Y As Long, ByVal crColor As Long)

Rate Draw shapes and fill them with random colours.



Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
CurrentX = X
CurrentY = Y
If Button = vbRightButton Then
ScaleMode = vbPixels
ForeColor = vbBlack
FillStyle = vbFSSolid
FillColor = RGB(Rnd * 256, Rnd * 256, Rnd * 256)
FloodFill hDC, X, Y, ForeColor
   End If
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
DrawWidth = 1
Line -(X, Y)
End If
End Sub

Download this snippet    Add to My Saved Code

Draw shapes and fill them with random colours. Comments

No comments have been posted about Draw shapes and fill them with random colours.. Why not be the first to post a comment about Draw shapes and fill them with random colours..

Post your comment

Subject:
Message:
0/1000 characters