I can turn a 32x32 square tile 45degrees and then paint that tile to the form in one straight - top to bottom - line.. The code below does that..But how exactly would I tile the entire form? I have not seen any good tutorials in vb.NET for doing this sort of thing. I could make a For Next loop to tile each line from top to bottom - but obviously that is not going to cut it. There are so many more questions I have with graphics, VB.NET, and the isometric perspective. Any help on this is appreciated. Thank you.
This is what it looks like..
[Broken External Image]:http://home.centurytel.net/ancientfaces/tile.jpg
Code:
Dim G As Graphics
initiate an object for our bitmap
Dim bmap As Bitmap
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
assign value to G
G = Me.CreateGraphics()
load our bitmap
bmap = New Bitmap("C:\graphics\grass32x32.bmp")
End Sub
Private Sub Form1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPress
Dim I As Integer
Dim y As Integer
Dim x As Integer
G.RotateTransform(45) Turn graphic 45 degrees
If e.KeyChar = "u" Then
For I = 1 To 25 Draw tile 25 times
x = x + 40
y = y + 40
G.DrawImage(bmap, x, y)
Next
End If
End Sub
[Broken External Image]:http://home.centurytel.net/ancientfaces/tile.jpg