08-10-17, 02:43 AM
PHP كود :
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim recHeight As Integer = e.PageSettings.PrintableArea.Height / 4
Dim recWidth As Integer = e.PageSettings.PrintableArea.Width / 3
Dim i As Integer = 1
Dim img As Image = Nothing
For y = 0 To 3
For x = 0 To 2
If i = 1 Then img = PictureBox1.Image
If i = 2 Then img = PictureBox2.Image
If i = 3 Then img = PictureBox3.Image
If i = 4 Then img = PictureBox4.Image
If i = 5 Then img = PictureBox5.Image
If i = 6 Then img = PictureBox6.Image
If i = 7 Then img = PictureBox7.Image
If i = 8 Then img = PictureBox8.Image
If i = 9 Then img = PictureBox9.Image
If i = 10 Then img = PictureBox10.Image
If i = 11 Then img = PictureBox11.Image
If i = 12 Then img = PictureBox12.Image
e.Graphics.DrawImage(img, New Rectangle((x * recWidth), (y * recHeight), recWidth, recHeight))
i += 1
Next
Next
e.Graphics.DrawString("Text", New Font("Arial", 30, FontStyle.Bold), Brushes.Blue, New Point(100, 100))
e.Graphics.DrawString(Today.ToLongDateString, New Font("Arial", 30, FontStyle.Bold), Brushes.Brown, New Point(100, 150))
End Sub
