التنبيهات التالية ظهرت :
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 864 - File: showthread.php PHP 7.4.33 (Linux)
File Line Function
/showthread.php 864 errorHandler->error



تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[VB.NET] طباعة الباركود من imagepic
#1
السلام عليكم ورحمة الله وبركاتة
عندي مشروع طباعة الباركود وشغال تمام الحمدلله
بس في مشكلة اللي هي لما باجي اكتب اسم المنتج والسعر فوق الباركود عن طريق رسم اسم المنتج وسعرة اعلى الباركود في PictureBox
وباجي اطبع مش بيظهر غير الباركود بس وادي صور للمشكلة




يعني انا عايز اطبع كامل محتويات PictureBox


وادي الكود اللي بستخدمة




كود :
Public Class bc
    Dim PrintDoc As Printing.PrintDocument = New Printing.PrintDocument()
    Dim pd_PrintDialog As New PrintDialog

    Private Sub FlatLabel5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FlatLabel5.Click
        Me.Close()
    End Sub

    Private Sub FlatStickyButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FlatStickyButton4.Click
        'اعداد الصفحة
        PageSetupDialog1.Document = PrintDoc
        PageSetupDialog1.ShowDialog()
    End Sub

    Private Sub TextBox3_TextChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged
        PicBarCode.BackgroundImage = Code128(TextBox3.Text, "A")
    End Sub
    'This is the event handler for printing bar codes
    Private Sub PrintDocHandler(ByVal sender As Object, ByVal ev As Printing.PrintPageEventArgs)
        ev.Graphics.DrawImage(PicBarCode.BackgroundImage, nud_MarginH.Value, nud_MarginW.Value, nud_MarginWBrcode.Value, nud_MarginHBrcode.Value)
    End Sub
    Private Sub FlatStickyButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FlatStickyButton2.Click
        'طباعة الباركود
        If TextBox3.Text = "" Then 'الباركود فارغ
            MsgBox("من فضلك تأكد من كتابة النص المراد تحويله الى باركود")
            Exit Sub
        Else

            pd_PrintDialog.UseEXDialog = True
            pd_PrintDialog.AllowPrintToFile = False
            'تحديد عدد النسخ المراد طباعتها.
            pd_PrintDialog.PrinterSettings.Copies = nud_Count.Value
            If pd_PrintDialog.ShowDialog = Windows.Forms.DialogResult.OK Then

                PrintDoc.PrinterSettings = pd_PrintDialog.PrinterSettings

                AddHandler PrintDoc.PrintPage, AddressOf PrintDocHandler
                'امر الطباعة
                PrintDoc.Print()

            ElseIf pd_PrintDialog.ShowDialog = Windows.Forms.DialogResult.Cancel Then
                Exit Sub

            End If
        End If
    End Sub

    Private Sub FlatStickyButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FlatStickyButton1.Click
        'معاينة قبل الطباعة
        If TextBox3.Text = "" Then 'الباركود فارغ
            MsgBox("من فضلك تأكد من كتابة كود باركود")
            Exit Sub
        Else

            AddHandler PrintDoc.PrintPage, AddressOf PrintDocHandler

            'تحديد عدد النسخ المراد طباعتها
            pd_PrintDialog.PrinterSettings.Copies = nud_Count.Value
            PrintPreviewDialog1.Document = PrintDoc

            PrintPreviewDialog1.ShowDialog()

        End If
    End Sub

    Private Sub FlatStickyButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FlatStickyButton3.Click
        'حفظ صورة الباركود
        If TextBox3.Text = "" Then 'الباركود فارغ
            MsgBox("من فضلك تأكد من كتابة النص المراد تحويله الى باركود")
            Exit Sub
        Else
            Dim SaveFileDialog1 As New SaveFileDialog()
            SaveFileDialog1.InitialDirectory = System.Environment.GetFolderPath(Environment.SpecialFolder.MyPictures) ' "c:\"
            SaveFileDialog1.Filter = "All files (*.*)|*.*|Bitmap files (*.bmp)|*.bmp"
            SaveFileDialog1.FilterIndex = 2
            SaveFileDialog1.RestoreDirectory = True
            SaveFileDialog1.ShowDialog()
            If SaveFileDialog1.FileName <> "" Then
                'PicBarCode.BackgroundImage.Save(SaveFileDialog1.FileName, System.Drawing.Imaging.ImageFormat.Bmp)
                PicBarCode.Image.Save(SaveFileDialog1.FileName, System.Drawing.Imaging.ImageFormat.Bmp)
            End If
        End If
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        'كتابة اسم المنتج على ملصق الباركود
        Dim a As Graphics = PicBarCode.CreateGraphics
        a.DrawString(TextBox1.Text, Me.Font, Brushes.Black, 110, 7)
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim a As Graphics = PicBarCode.CreateGraphics
        a.DrawString(TextBox2.Text & " " & "L.E", Me.Font, Brushes.Black, 170, 7)
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        'كتابة اسم الفئة على ملصق الباركود
        'Dim a As Graphics = PicBarCode.CreateGraphics
        'a.DrawString(TextBox4.Text, Me.Font, Brushes.Black, 70, 7)
    End Sub

End Class
إِنْ يَنْصُرْكُمُ اللَّهُ فَلَا غَالِبَ لَكُمْ وَإِنْ يَخْذُلْكُمْ فَمَنْ ذَا الَّذِي يَنْصُرُكُمْ مِنْ بَعْدِهِ وَعَلَى اللَّهِ فَلْيَتَوَكَّلِ الْمُؤْمِنُونَ

لَيْسَ لَهَا مِنْ دُونِ اللَّهِ كَاشِفَةٌ


الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
طباعة الباركود من imagepic - بواسطة Codack - 09-03-20, 11:28 PM
RE: طباعة الباركود من imagepic - بواسطة Codack - 10-03-20, 12:45 PM
RE: طباعة الباركود من imagepic - بواسطة Codack - 10-03-20, 05:28 PM
RE: طباعة الباركود من imagepic - بواسطة Codack - 11-03-20, 12:40 PM
RE: طباعة الباركود من imagepic - بواسطة Codack - 11-03-20, 01:18 PM
RE: طباعة الباركود من imagepic - بواسطة Codack - 12-03-20, 03:26 AM


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم