![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Mar 2005
Location: Ireland
Posts: 5
Rep Power: 0
![]() |
Am able to draw first line of eight squares but cannot create next rows:
Here is the code that im using. Private Rects() As Rectangle Protected Overrides Sub OnLoad(ByVal e As EventArgs) MyBase.OnLoad(e) Dim w As Integer = Me.pbMain.Width Dim h As Integer = Me.pbMain.Height Dim numVlines As Integer = CInt(w / 8) Dim numHLines As Integer = CInt(h / 8) Dim b As New Bitmap(w, h) Dim ppi As Single = w / 8 Dim startX As Integer = 0 Dim clr As Color = Color.Black Dim switchClr As Boolean = False Dim g As Graphics = Graphics.FromImage(b) g.Clear(Color.White) For i As Integer = 1 To numVlines If switchClr Then clr = Color.Green switchClr = False Else clr = Color.GreenYellow switchClr = True End If Dim rect As New Rectangle(startX, 0, ppi, ppi) g.FillRectangle(New SolidBrush(clr), rect) g.DrawRectangle(New Pen(Color.White), rect) ReDim Preserve Rects(i) Rects(i) = rect startX += rect.Width Next Me.pbMain.Image = b |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|