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:
Private Sub pd_PrintPage(ByVal sender As Object, ByVal ev As System.Drawing.Printing.PrintPageEventArgs) Dim rowCount As Integer = 3 'The number of rows into which to divide the printed page Dim colCount As Integer = 2 'The number of columns into which to divide the printed page Dim regions(rowCount - 1, colCount - 1) As RectangleF 'The regions of the printed page. Dim regionHeight As Single = Convert.ToSingle(e.MarginBounds.Height / rowCount) 'The height of each region. Dim regionWidth As Single = Convert.ToSingle(e.MarginBounds.Width / colCount) 'The width of each region. For rowIndex As Integer = 0 To regions.GetUpperBound(0) Step 1 For colIndex As Integer = 0 To regions.GetUpperBound(1) Step 1 regions(rowIndex, colIndex) = New RectangleF(ev.MarginBounds.X + rowIndex * regionWidth, _ ev.MarginBounds.Y + colIndex * regionHeight, _ regionWidth, _ regionHeight) Next colIndex Next rowIndex End Sub
Maybe i need another FOR NEXT section?
THANKS




Reply With Quote