I have some code which will divide my page into 2 x 3. I want to print picturebox1.image in all six rectangles on the page but I am trying to figure out where to put the following line.

ev.Graphics.DrawImage(PicImage.Image........

Below is the code for dividing the page into 6. I am sure this is easy, it's just that i am not getting it!!


VB Code:
  1. Private Sub pd_PrintPage(ByVal sender As Object, ByVal ev As System.Drawing.Printing.PrintPageEventArgs)
  2.  
  3.  
  4.  
  5. Dim rowCount As Integer = 3 'The number of rows into which to divide the printed page
  6.  
  7. Dim colCount As Integer = 2 'The number of columns into which to divide the printed page
  8.  
  9. Dim regions(rowCount - 1, colCount - 1) As RectangleF 'The regions of the printed page.
  10.  
  11. Dim regionHeight As Single = Convert.ToSingle(e.MarginBounds.Height / rowCount) 'The height of each region.
  12.  
  13. Dim regionWidth As Single = Convert.ToSingle(e.MarginBounds.Width / colCount) 'The width of each region.
  14.  
  15. For rowIndex As Integer = 0 To regions.GetUpperBound(0) Step 1
  16.  
  17. For colIndex As Integer = 0 To regions.GetUpperBound(1) Step 1
  18.  
  19. regions(rowIndex, colIndex) = New RectangleF(ev.MarginBounds.X + rowIndex * regionWidth, _
  20.  
  21. ev.MarginBounds.Y + colIndex * regionHeight, _
  22.  
  23. regionWidth, _
  24.  
  25. regionHeight)
  26.  
  27. Next colIndex
  28.  
  29. Next rowIndex
  30.  
  31. End Sub

Maybe i need another FOR NEXT section?

THANKS