المشاركات : 684
المواضيع 248
الإنتساب : Dec 2013
السمعة :
18
الشكر: 381
تم شكره 381 مرات في 232 مشاركات
عندي بيكتشر واضيف الية بعد الكتابات اثناء عم البرنامج وعند الطباعة لايظهر سوي المحتوي الموجود بالبيكتشر وجميع الاضافات لاتظهر
اريد طباعة وظهور كل محتوي البيكتشر مع ضرورة وضوح الصورة
استخدم الكود الحالي لطباعة
PHP كود :
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As PrintPageEventArgs) Handles Printer.PrintPage e.Graphics.DrawImage(PictureBox1.Image, PictureBox1.Width, PictureBox1.Height) End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click PrintPreviewDialog1.Document = Printer PrintPreviewDialog1.ShowDialog() End Sub
المشاركات : 176
المواضيع 1
الإنتساب : Oct 2017
السمعة :
51
الشكر: 0
تم شكره 267 مرات في 175 مشاركات
PHP كود :
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage e.Graphics.DrawImage(PictureBox1.Image, PictureBox1.Width, PictureBox1.Height) 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 Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click PrintPreviewDialog1.Document = PrintDocument1 PrintPreviewDialog1.ShowDialog() End Sub
المشاركات : 684
المواضيع 248
الإنتساب : Dec 2013
السمعة :
18
الشكر: 381
تم شكره 381 مرات في 232 مشاركات
الف شكر الكود يعمل معي جيدا
لي سؤال اخر هل يمكن تقسيم صفحة الطباعة الي اربع صفوف وطباعة بكل صف 3 بيكتشر بحلقة تكرارية
يبقي صفحة الطباعة مثلا
1 بيكتشر 2بيكتشر 3 بيكتشر
4 بيكتشر 5بيكتشر 6بيكتشر
7 بيكتشر 8بيكتشر 9 بيكتشر
10 بيكتشر 11بيكتشر 12 بيكتشر
المشاركات : 176
المواضيع 1
الإنتساب : Oct 2017
السمعة :
51
الشكر: 0
تم شكره 267 مرات في 175 مشاركات
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
المشاركات : 684
المواضيع 248
الإنتساب : Dec 2013
السمعة :
18
الشكر: 381
تم شكره 381 مرات في 232 مشاركات
في مشكلة اولا ان الصور عددهم 4 فقط وليسو 12 صورة موزعة الصف الاول الصورة الاولي تظهر ثلاثة مرات بجوار بعض
بيكتشر 1 + الكتابات المضافة اليها بيكتشر 1 + الكتابات المضافة اليها بيكتشر 1 + الكتابات المضافة اليها
بيكتشر 2 + الكتابات المضافة اليها بيكتشر 2 + الكتابات المضافة اليها بيكتشر 2 + الكتابات المضافة اليها
وهكذا خطاء مني اسف
ثانيا الكود ظهر الصورة مشوة والا ضافات لم تظهر الا مرة واحدة الي الصورة الاولي فقط
المشاركات : 176
المواضيع 1
الإنتساب : Oct 2017
السمعة :
51
الشكر: 0
تم شكره 267 مرات في 175 مشاركات
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
Dim z As New Size(recWidth, recHeight)
For y = 0 To 3 For x = 0 To 2
If i = 1 Then img = getCard(z, PictureBox1.Image, "Text1", Today.ToLongDateString) If i = 2 Then img = getCard(z, PictureBox1.Image, "Text2", Today.ToLongDateString) If i = 3 Then img = getCard(z, PictureBox1.Image, "Text3", Today.ToLongDateString)
If i = 4 Then img = getCard(z, PictureBox2.Image, "Text4", Today.ToLongDateString) If i = 5 Then img = getCard(z, PictureBox2.Image, "Text5", Today.ToLongDateString) If i = 6 Then img = getCard(z, PictureBox2.Image, "Text6", Today.ToLongDateString)
If i = 7 Then img = getCard(z, PictureBox3.Image, "Text7", Today.ToLongDateString) If i = 8 Then img = getCard(z, PictureBox3.Image, "Text8", Today.ToLongDateString) If i = 9 Then img = getCard(z, PictureBox3.Image, "Text9", Today.ToLongDateString)
If i = 10 Then img = getCard(z, PictureBox4.Image, "Text10", Today.ToLongDateString) If i = 11 Then img = getCard(z, PictureBox4.Image, "Text11", Today.ToLongDateString) If i = 12 Then img = getCard(z, PictureBox4.Image, "Text12", Today.ToLongDateString)
e.Graphics.DrawImage(img, New Point((x * recWidth), (y * recHeight)))
i += 1
Next Next
End Sub
Function getCard(ByVal z As Size, ByVal img As Image, ByVal t1 As String, ByVal t2 As String) As Image Using b As New Bitmap(z.Width, z.Height) Using g As Graphics = Graphics.FromImage(b) g.Clear(Color.White)
g.DrawImage(img, 20, 30)
g.DrawString(t1, New Font("Arial", 10, FontStyle.Bold), Brushes.Blue, New Point(30, 70)) g.DrawString(t2, New Font("Arial", 10, FontStyle.Bold), Brushes.Brown, New Point(30, 90))
Return b.Clone End Using End Using End Function
المشاركات : 684
المواضيع 248
الإنتساب : Dec 2013
السمعة :
18
الشكر: 381
تم شكره 381 مرات في 232 مشاركات
اولا الف شكر علي مجهودك معايا وجراك اللة خيرا
الكود بدا يظبط معايا اول صف تمام جدا الخاص بالصورة والبيكتشر 1
- في مشكلة بالصورة رقم 4 بيكتشر رقم 4 لا يظهر ويتكرر بيكتشر3 بدلا منة
- الاضافات لاو صف تماما جدا ولكن الاضافات للصورة 2و3و4 لصف الاول مكررة
المشاركات : 684
المواضيع 248
الإنتساب : Dec 2013
السمعة :
18
الشكر: 381
تم شكره 381 مرات في 232 مشاركات
تم التعديل علي الكود وحل المشكلة الف شكر
|