Home All Groups Group Topic Archive Search About
Author
12 Oct 2005 8:32 PM
AMDRIT
I have a picturebox that I have placed tiles on them in an isometric view
(2:1).  I would like to draw a grid on the picture box to highlight the tile
borders.

Everything that I have tried results in pretty (wierd) wireframes.

I am using the simple pic.Line (x,y)-(x1,y1) to draw my lines.  I have been
scouring all over the web for an algorithm for it, I am so lost.  Any one
out there that can help me?

  pic.AutoRedraw = False
  pic.ScaleMode = 3 'pixels
  pic.ForeColor = LineColor

  'Fill the picture box with a grid
  For X = 1 To pic.ScaleWidth Step TileSizeWidth '32
    For Y = pic.ScaleWidth To 1 Step -TileSizeHeight '32

      'I need help here, do I need two sets of loops to accomplish this?
      pic.Line (0, 0)-(0, 0)
      pic.Line (0, 0)-(0, 0)

    Next Y
  Next X

    pic.Refresh



TIA

Author
13 Oct 2005 1:27 AM
Larry Serflaten
"AMDRIT" <amd***@hotmail.com> wrote
> I have a picturebox that I have placed tiles on them in an isometric view
> (2:1).  I would like to draw a grid on the picture box to highlight the tile
> borders.
>
> Everything that I have tried results in pretty (wierd) wireframes.
>

See if this gets you a bit closer....

Private Sub Command1_Click()
Dim x, y, z

  x = Picture1.ScaleWidth \ 2
  y = Picture1.ScaleHeight * 0.9

  For z = 0 To 10
    Picture1.Line (x + (z * 300), y - (z * 100))-Step(-3000, -1000)
    Picture1.Line (x - (z * 300), y - (z * 100))-Step(3000, -1000)
  Next

End Sub


LFS