⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 special128.bas

📁 条形码的设计与打印
💻 BAS
📖 第 1 页 / 共 5 页
字号:
        Case 14:
            lf.lfItalic = 255
            lf.lfWeight = 400
            lf.lfUnderline = 1
            lf.lfStrikeOut = 1
        Case 13:
            lf.lfItalic = 0
            lf.lfWeight = 700
            lf.lfUnderline = 1
            lf.lfStrikeOut = 1
        Case 12:
            lf.lfItalic = 0
            lf.lfWeight = 400
            lf.lfUnderline = 1
            lf.lfStrikeOut = 1
        Case 11:
            lf.lfItalic = 255
            lf.lfWeight = 700
            lf.lfUnderline = 0
            lf.lfStrikeOut = 1
        Case 10:
            lf.lfItalic = 255
            lf.lfWeight = 400
            lf.lfUnderline = 0
            lf.lfStrikeOut = 1
        Case 9:
            lf.lfItalic = 0
            lf.lfWeight = 700
            lf.lfUnderline = 0
            lf.lfStrikeOut = 1
        Case 8:
            lf.lfItalic = 0
            lf.lfWeight = 400
            lf.lfUnderline = 0
            lf.lfStrikeOut = 1
        Case 7:
            lf.lfItalic = 255
            lf.lfWeight = 700
            lf.lfUnderline = 1
            lf.lfStrikeOut = 0
        Case 6:
            lf.lfItalic = 255
            lf.lfWeight = 400
            lf.lfUnderline = 1
            lf.lfStrikeOut = 0
        Case 5:
            lf.lfItalic = 0
            lf.lfWeight = 700
            lf.lfUnderline = 1
            lf.lfStrikeOut = 0
        Case 4:
            lf.lfItalic = 0
            lf.lfWeight = 400
            lf.lfUnderline = 1
            lf.lfStrikeOut = 0
        Case 3:
            lf.lfItalic = 255
            lf.lfWeight = 700
            lf.lfUnderline = 0
            lf.lfStrikeOut = 0
        Case 2:
            lf.lfItalic = 255
            lf.lfWeight = 400
            lf.lfUnderline = 0
            lf.lfStrikeOut = 0
        Case 1:
            lf.lfItalic = 0
            lf.lfWeight = 700
            lf.lfUnderline = 0
            lf.lfStrikeOut = 0
        Case 0:
            lf.lfItalic = 0
            lf.lfWeight = 400
            lf.lfUnderline = 0
            lf.lfStrikeOut = 0
    End Select
           
    lf.lfCharSet = 0
    lf.lfClipPrecision = 2
    lf.lfOutPrecision = 3
    lf.lfPitchAndFamily = 2
    lf.lfQuality = 1
    lf.lfWidth = 0
    
    '创建画刷
    nfnt = CreateFontIndirect(lf)
    Dl = SelectObject(hDc, GetStockObject(NULL_BRUSH))
    Dl = SelectObject(hDc, GetStockObject(NULL_PEN))
    Dl = SetTextColor(hDc, RGB(255, 255, 255))
    Dl = SetBkMode(hDc, TRANSPARENT)
    
    Dim tm As TEXTMETRIC
    Dl = GetTextMetrics(hDc, tm)
    Th = tm.tmHeight + tm.tmExternalLeading
    If (bar.lRotation = 0) Then
        If (Not ((textdisp = "BOTTOM") And (bar.szBarCaption = ""))) Then
            rect1.Left = a
            rect1.Top = b
            rect1.Bottom = b + Th + extra
            b = b + (Th + extra)
            x = a
        Else
            x = a '//LEFT
        End If
        Dim temp$, len1%
        '制定宽度
        len1 = Len(str)
        If (len1 <> 0) Then 'if length<>0
            If (Width < 1) Then
                w = 1
                wd = 1
            Else
                w = Width
                wd = Width
            End If
            '开头字符
        
            Dl = RECTANGLE(hDc, x, b, x + wd * (r1), b + hgt)
            x = x + wd * (4 * r1)
            Dl = RECTANGLE(hDc, x, b, x + wd * r1, b + hgt)
            x = x + wd * 2 * r1
            Dl = RECTANGLE(hDc, x, b, x + wd * 4 * r2, b + hgt)
            x = x + wd * 5 * r2
            sum = sum + 94 * 1
                    
            Dim t%
            str = str2
            Dim st$, ch$, change$, t1$, t2$, t3$, chk%
            change = "n"
            t2 = (-55): t3 = (-54): t1 = (-68)
            chk = 2
            For j% = 0 To (Len(str) - 1)
                ch = Mid(str, j + 1, 1)
                st = ""

                If (st = "00") Or (ch = Chr(32)) Then
                    Dl = RECTANGLE(hDc, x, b, x + w * 2 * r1, b + hgt)
                    x = x + w * (3 * r1)
                    Dl = RECTANGLE(hDc, x, b, x + w * 2 * r2, b + hgt)
                    x = x + w * 2 * (r2 + r2)
                    Dl = RECTANGLE(hDc, x, b, x + w * 2 * r2, b + hgt)
                    x = x + w * 4 * r2
                    sum = sum + 0 * chk
                End If
                      
                If ((st = "01") Or (ch = "!")) Then
                    Dl = RECTANGLE(hDc, x, b, x + w * r2 * 2, b + hgt)
                    x = x + w * 4 * r2
                    Dl = RECTANGLE(hDc, x, b, x + w * 2 * r2, b + hgt)
                    x = x + w * (r1 + 2 * r2)
                    Dl = RECTANGLE(hDc, x, b, x + w * 2 * r2, b + hgt)
                    x = x + w * 4 * r2
                    sum = sum + 1 * chk
                End If
                  
                If ((st = "02") Or (ch = Chr(34))) Then
                    Dl = RECTANGLE(hDc, x, b, x + w * 2 * r2, b + hgt)
                    x = x + w * 2 * (r2 + r2)
                    Dl = RECTANGLE(hDc, x, b, x + w * 2 * r2, b + hgt)
                    x = x + w * 2 * (r2 + r2)
                    Dl = RECTANGLE(hDc, x, b, x + w * 2 * r2, b + hgt)
                    x = x + w * 3 * r2
                    sum = sum + 2 * chk
                End If
                        
                If ((st = "03") Or (ch = "#")) Then
                    Dl = RECTANGLE(hDc, x, b, x + w * r1, b + hgt)
                    x = x + w * (r1 + 2 * r2)
                    Dl = RECTANGLE(hDc, x, b, x + w * r1, b + hgt)
                    x = x + w * (r1 + 2 * r2)
                    Dl = RECTANGLE(hDc, x, b, x + w * 2 * r2, b + hgt)
                    x = x + w * 5 * r2
                    sum = sum + 3 * chk
                End If
                  
                If ((st = "04") Or (ch = "$")) Then
                    Dl = RECTANGLE(hDc, x, b, x + w * r1, b + hgt)
                    x = x + w * (r1 + 2 * r2)
                    Dl = RECTANGLE(hDc, x, b, x + w * r1, b + hgt)
                    x = x + w * 4 * r2
                    Dl = RECTANGLE(hDc, x, b, x + w * 2 * r2, b + hgt)
                    x = x + w * 4 * r2
                    sum = sum + 4 * chk
                End If
                    
                If ((st = "05") Or (ch = "%")) Then
                    Dl = RECTANGLE(hDc, x, b, x + w * r1, b + hgt)
                    x = x + w * 4 * r2
                    Dl = RECTANGLE(hDc, x, b, x + w * r1, b + hgt)
                    x = x + w * 3 * r2
                    Dl = RECTANGLE(hDc, x, b, x + w * 2 * r2, b + hgt)
                    x = x + w * 4 * r2
                    sum = sum + 5 * chk
                End If
                  
                If ((st = "06") Or (ch = "&")) Then
                    Dl = RECTANGLE(hDc, x, b, x + w * r1, b + hgt)
                    x = x + w * (r1 + 2 * r2)
                    Dl = RECTANGLE(hDc, x, b, x + w * 2 * r2, b + hgt)
                    x = x + w * 4 * r2
                    Dl = RECTANGLE(hDc, x, b, x + w * r1, b + hgt)
                    x = x + w * 4 * r2
                    sum = sum + 6 * chk
                End If
                  
                If ((st = "07") Or (ch = Chr(39))) Then
                    Dl = RECTANGLE(hDc, x, b, x + w * r1, b + hgt)
                    x = x + w * 3 * r2
                    Dl = RECTANGLE(hDc, x, b, x + w * 2 * r2, b + hgt)
                    x = x + w * 4 * r2
                    Dl = RECTANGLE(hDc, x, b, x + w * r1, b + hgt)
                    x = x + w * 3 * r2
                    sum = sum + 7 * chk
                End If
                  
                If ((st = "08") Or (ch = "(")) Then
                    Dl = RECTANGLE(hDc, x, b, x + w * r1, b + hgt)
                    x = x + w * 4 * r2
                    Dl = RECTANGLE(hDc, x, b, x + w * 2 * r2, b + hgt)
                    x = x + w * 4 * r2
                    Dl = RECTANGLE(hDc, x, b, x + w * r1, b + hgt)
                    x = x + w * 3 * r2
                    sum = sum + 8 * chk
                End If
                  
                If ((st = "09") Or (ch = ")")) Then
                    Dl = RECTANGLE(hDc, x, b, x + w * 2 * r2, b + hgt)
                    x = x + w * 4 * r2
                    Dl = RECTANGLE(hDc, x, b, x + w * r1, b + hgt)
                    x = x + w * 3 * r2
                    Dl = RECTANGLE(hDc, x, b, x + w * r1, b + hgt)
                    x = x + w * 4 * r2
                    sum = sum + 9 * chk
                End If
                  
                If ((st = "10") Or (ch = "*")) Then
                    Dl = RECTANGLE(hDc, x, b, x + w * 2 * r2, b + hgt)
                    x = x + w * 4 * r2
                    Dl = RECTANGLE(hDc, x, b, x + w * r1, b + hgt)
                    x = x + w * 4 * r2
                    Dl = RECTANGLE(hDc, x, b, x + w * r1, b + hgt)
                    x = x + w * 3 * r2
                    sum = sum + 10 * chk
                End If
                
                If ((st = "11") Or (ch = "+")) Then
                    Dl = RECTANGLE(hDc, x, b, x + w * 2 * r2, b + hgt)
                    x = x + w * 4 * r2
                    Dl = RECTANGLE(hDc, x, b, x + w * r1, b + hgt)
                    x = x + w * 3 * r2
                    Dl = RECTANGLE(hDc, x, b, x + w * r1, b + hgt)
                    x = x + w * 3 * r2
                    sum = sum + 11 * chk
                End If
                  
                If ((st = "12") Or (ch = ",")) Then
                    Dl = RECTANGLE(hDc, x, b, x + w * r1, b + hgt)
                    x = x + w * r2 * 2
                    Dl = RECTANGLE(hDc, x, b, x + w * 2 * r2, b + hgt)
                    x = x + w * 2 * r2
                    Dl = RECTANGLE(hDc, x, b, x + w * 3 * r2, b + hgt)
                    x = x + w * 5 * r2
                    sum = sum + 12 * chk
                End If
                  
                If ((st = "14") Or (ch = ".")) Then
                    Dl = RECTANGLE(hDc, x, b, x + w * r1, b + hgt)
                    x = x + w * 3 * r2
                    Dl = RECTANGLE(hDc, x, b, x + w * 2 * r2, b + hgt)
                    x = x + w * 4 * r2
                    Dl = RECTANGLE(hDc, x, b, x + w * 3 * r2, b + hgt)
                    x = x + w * 4 * r2
                    sum = sum + 14 * chk
                End If
                  
                If ((st = "15") Or (ch = "/")) Then
                    Dl = RECTANGLE(hDc, x, b, x + w * r1, b + hgt)
                    x = x + w * 2 * r2
                    Dl = RECTANGLE(hDc, x, b, x + w * 3 * r2, b + hgt)
                    x = x + w * 5 * r2
                    Dl = RECTANGLE(hDc, x, b, x + w * 2 * r2, b + hgt)
                    x = x + w * 4 * r2
                    sum = sum + 15 * chk
                End If
                
                If ((st = "16") Or (ch = Chr(48))) Then
                    Dl = RECTANGLE(hDc, x, b, x + w * r1, b + hgt)
                    x = x + w * 3 * r2
                    Dl = RECTANGLE(hDc, x, b, x + w * 3 * r2, b + hgt)
                    x = x + w * 4 * r2
                    Dl = RECTANGLE(hDc, x, b, x + w * 2 * r2, b + hgt)
                    x = x + w * 4 * r2
                    sum = sum + 16 * chk
                End If
                
                If ((st = "17") Or (ch = Chr(49))) Then
                    Dl = RECTANGLE(hDc, x, b, x + w * r1, b + hgt)
                    x = x + w * 3 * r2
                    Dl = RECTANGLE(hDc, x, b, x + w * 3 * r2, b + hgt)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -