I know this is extremly easy but I have been messing with it for 2 days and Im going to need help on this one.
I'm suppose to re-create this splash screen by using drawline and a loop structure.
The lines need to be going vertical not horizontal.
I have the gradient figured out but I have 3 main problems. First my fill area is going the wrong way. Second I can't get the second color to fill opposite to the green. Third, I can't get the fill to be solid. I can get a solid gradient but only by using a larger pen which wont create the same smoothness as what I need.
I think Im close but ... I've went through 2 packs of marlboro and 4 liters of dr.pepper and its still not working. Here's the code I have so far.
I'm suppose to re-create this splash screen by using drawline and a loop structure.
The lines need to be going vertical not horizontal.
I have the gradient figured out but I have 3 main problems. First my fill area is going the wrong way. Second I can't get the second color to fill opposite to the green. Third, I can't get the fill to be solid. I can get a solid gradient but only by using a larger pen which wont create the same smoothness as what I need.
I think Im close but ... I've went through 2 packs of marlboro and 4 liters of dr.pepper and its still not working. Here's the code I have so far.
VB.NET:
Option Strict On
Option Explicit On
Imports System.Convert
Public Class frmSplash
Inherits System.Windows.Forms.Form
Private Sub frmSplash_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim graCurrent As Graphics = e.Graphics
Dim recCurrent As Rectangle, colCurrent As Color
Dim sbCurrent As SolidBrush, penCurrent As Pen
Dim pintXCurrent As Integer = ToInt32(Me.Width)
Dim pintYCurrent As Integer = ToInt32(Me.Height)
'fill the background black
recCurrent = New Rectangle(0, 0, Me.Width, Me.Height)
sbCurrent = New SolidBrush(Color.Black)
graCurrent.FillRectangle(sbCurrent, recCurrent)
Dim pintColorLoop As Integer = 1
pintYCurrent = 0
For pintXCurrent = 0 To Me.Width Step ToInt32(Me.Width / 100)
'If structure prevents alpha from exceeding its limits when
' creating the gradiant
If pintYCurrent < 255 Then
penCurrent = New Pen(colCurrent.FromArgb(pintYCurrent, 0, 255, 0), 5)
Else
penCurrent = New Pen(colCurrent.FromArgb(255, 0, 255, 0), 5)
End If
'Draw Lines
graCurrent.DrawLine(penCurrent, pintXCurrent, 0, pintXCurrent, pintYCurrent)
pintYCurrent = ToInt32(pintYCurrent + (Me.Height / 100))
Next
End Sub
End Class