I've got the following loop, which draws the image bmOffScreenImage in triangular transition from the centre of the screen. The first DrawImage starts from the centre and works towards the sides and to the top and it is working right but, the second doesn't for some reason I can't seem to figure out. The second draws same kind of triangle but works it way downwards from the centre of the screen.
Here's an ascii representation of what I'm trying to do.
I'm trying to draw the image in four triangles transitioning outwards from the centre. Here's the code that draws the upper and lower triangles. The upper triangle draws just fine but, the lower one doesn't draw and seems to be missing few horizontal lines every now and then.
The debug.print prints the all the three parameters and I don't see it skipping any coordinate values in between.
I hope the above is clear enough, otherwise I can blame it on the beer in my veins and post a screenshot to make it clearer !
Thanks for any help.
EDIT: Can't get that damned ASCII art in right format ! Anyways, here's a screenshot.
Here's an ascii representation of what I'm trying to do.
VB.NET:
- - - - - - - - -
| \ /|
| \ / |
| \ / |
| / \ |
| / \ |
| / \|
- - - - - - - - -
I'm trying to draw the image in four triangles transitioning outwards from the centre. Here's the code that draws the upper and lower triangles. The upper triangle draws just fine but, the lower one doesn't draw and seems to be missing few horizontal lines every now and then.
VB.NET:
For i = 0 To Me.Width / 2
If i <= Me.Height / 2 Then
m_Graphics.DrawImage(bmOffScreenImage, CType(Me.Width / 2, Integer) - i, CType(Me.Height / 2, Integer) - i, New Rectangle(CType(Me.Width / 2, Integer) - i, CType(Me.Height / 2, Integer) - i, 2 * i, 1), GraphicsUnit.Pixel)
m_Graphics.DrawImage(bmOffScreenImage, CType(Me.Width / 2, Integer) - i, CType(Me.Height / 2, Integer) + i - 1, New Rectangle(CType(Me.Width / 2, Integer) - i, CType(Me.Height / 2, Integer) + i - 1, 2 * i, 1), GraphicsUnit.Pixel)
Debug.Print(i & " " & CType(Me.Width / 2, Integer) - i & " " & CType(Me.Height / 2, Integer) + i)
End If
Next i
The debug.print prints the all the three parameters and I don't see it skipping any coordinate values in between.
I hope the above is clear enough, otherwise I can blame it on the beer in my veins and post a screenshot to make it clearer !
Thanks for any help.
EDIT: Can't get that damned ASCII art in right format ! Anyways, here's a screenshot.
Attachments
Last edited: