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
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
|