Windows # Ecco un altro esempio di routine per realizzare uno sfondo gradiente
Esempio di utilizzo: Gradient NomeForm, True/False, True/False, True/False Private Sub Gradient(K As Form, Rosso As Integer, Verde As Integer, Blu As Integer) Dim Sscale As Integer, Sstyle As Integer, Sredraw As Integer Dim i As Long, j As Long, x As Long, y As Long, pixels As Integer Sscale = K.ScaleMode Sstyle = K.DrawStyle Sredraw = K.AutoRedraw K.ScaleMode = 3 pixels = Screen.Height / Screen.TwipsPerPixelY x = pixels / 64# + 0.5 K.DrawStyle = 5 K.AutoRedraw = True For j = 0 To pixels Step x y = 240 - 245 * j \ pixels If y < 0 Then y = 0 K.Line (-2, j - 2)-(Screen.Width + 2, j + x + 3), RGB(-red * y, _ Green * y, -Blue * y), BF Next j K.ScaleMode = Sscale K.DrawStyle = Sstyle K.AutoRedraw = Sredraw End Sub Idea, coordinazione, programmazione ASP a cura di Gianluca Cannalire collaboratori: Marco Fasce, Rik Bartolini, Mauro Puddinu, Fabio Sardi, Marco Cecchini |