Guidance
指路人
g.yi.org
software / rapidq / Examples / Graphics & Animation / barcode / barcode / Code128 / MAKEBMP.INC

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
     DECLARE SUB makebmp (barcode AS STRING,tekst AS STRING,BLineWidth AS INTEGER,filename AS STRING)

     DIM barcode AS STRING
     DIM tekst AS STRING
     DIM BLineWidth AS INTEGER
     DIM filename AS STRING

'--------------------------------------------------------------
     SUB makebmp (barcode AS STRING,tekst AS STRING,BLineWidth AS INTEGER,filename AS STRING)

      DIM bmp AS QBITMAP
      DIM lang AS INTEGER
      DIM breedte AS INTEGER
      DIM BCount AS INTEGER
      DIM BXPOS AS INTEGER
      DIM TEKSTPOS AS INTEGER
      DIM Bcolor AS INTEGER

      breedte=LEN(barcode)*blinewidth
      lang=LEN(barcode)

      BColor=0
      bmp.Monochrome= 1
      bmp.Width=breedte
      'breedte
      bmp.Height=70
      BXPos=1
      FOR bcount= 1 TO lang

       IF MID$(barcode,BCount,1)="1" THEN bcolor=0
       IF MID$(barcode,BCount,1)="0" THEN bcolor=16777215

       bmp.FillRect (BXPos*1 , 1,(BXPos+BLineWidth) ,50 ,BColor)
       BXPos=BXPos+BLineWidth

      NEXT BCount

      tekstpos=((breedte)-(LEN(tekst)*12))/2

      bcolor=16777215
      bmp.Font.size=12
      bmp.Font.AddStyles(fsBold, fsItalic)
      bmp.TextOut (tekstpos,52,tekst, 0,16777215 )
      bmp.SaveToFile(filename)


     END SUB
'----------------------------------------------------------------------------------
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sat 2024-4-20  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2001-05-18 01:05:56