WOOD MAKER

Sultar - 20 juin 2001 à 21:58
 fabiin - 22 juin 2001 à 22:00
Cette discussion concerne un article du site. Pour la consulter dans son contexte d'origine, cliquez sur le lien ci-dessous.

https://codes-sources.commentcamarche.net/source/1346-wood-maker

sympa
:o)
moi qui m'immaginais que le vb ne pouvais servir de rad pour faire des convertisseur et autre truc simple !
voila le contraire de prouver ! :-) joli
Sultar> pour le wood=bois et tree = arbre je le savais mais à la base je voulais en fait faire un logiciel pour générer des textures de bois ...... puis ensuite j'ai rajouté le dessin des formes.
Lol ! Il est trop excellent ton mouton =)))
blackwizzard
21 juin 2001 à 05:00
sympa comme source...
ça passe le temps!
bon... puisque je vois que tu n'a aucun respect pour le petit prince, je vais lui donner ca en attendant mieux...

Rajoutez 3 boutons (command8, command9, command10)

ds la source:
Private Sub Command8_Click()
'je suis pas sur que ca soit un mouton, mais si on fait aps trop attention, ca peut afire l'affaire...
Me.Caption = "Drawing sheeep"
Picture2.Cls
Picture2.FillStyle = 0
Picture2.FillColor = vbMagenta
Picture2.Circle (80, 175), 8, vbMagenta
Picture2.Circle (100, 185), 16, vbMagenta, , , 0.5
Picture2.Circle (118, 180), 3, vbMagenta
Picture2.DrawWidth = 2 ' Epaisseur du trait: 2
Picture2.Line (93, 185)-(85, 200), vbMagenta
Picture2.Line (110, 185)-(115, 200), vbMagenta
Picture2.DrawWidth = 1
End Sub

Private Sub Command9_Click()
Me.Caption = "Making sheeeeeeeeeeeeeep texture <= a prononcer avec un accent de mouton"
Shape1.BackColor = vbGreen
Shape1.BorderColor = vbGreen
Picture3.Cls
Picture3.FillStyle = 0
'For ri = 10 To 3 Step -1
For X_ = 0 To Picture3.ScaleWidth Step 2
DoEvents
For Y_ = 0 To Picture3.ScaleHeight Step 2
DoEvents
If Int(Rnd * 2) + 1 = 1 Then
'r = Int(Rnd * 50) + 10
'g = Int(Rnd * r) + 10
'b = Int(Rnd * 10)
ri = Int(Rnd * 8)
Picture3.FillColor = vbWhite 'RGB(r, g, b)
Picture3.Circle (X_, Y_), ri, vbBlack
End If
DoEvents
Next Y_
Next X_
'Next ri
Shape1.BackColor = vbRed
Shape1.BorderColor = vbRed
End Sub

Private Sub Command10_Click()
Shape1.BackColor = vbGreen
Shape1.BorderColor = vbGreen
Me.Caption = "Painting Wood"
For X_ = 1 To Picture2.ScaleWidth
DoEvents
For Y_ = 1 To Picture2.ScaleHeight
DoEvents
If Picture2.Point(X_, Y_) = vbMagenta Then
Picture1.PSet (X_, Y_), Picture3.Point(X_, Y_)
End If
Next Y_
Next X_
Shape1.BackColor = vbRed
Shape1.BorderColor = vbRed
End Sub

Private Sub Form_Load()
Command8.Caption = "Layer -2"
Command9.Caption = "Layer -1"
Command10.Caption = "Layer 0"
End Sub