Page 1 of 1
Display a barcode on the screen
Posted: Sun Jul 20, 2025 6:25 am
by OSMAN
Hello friends, good work to all.
Is there a way to display a barcode on the screen?
@12,25 DCSAY "123456" FONT "MV6Code39M" or another method.
Thanks in advance.
Re: Display a barcode on the screen
Posted: Sun Jul 20, 2025 11:29 pm
by Tom
There are at least three ways to do this:
1. Use a barcode font. Barcode fonts are available for some simple barcodes like "Code 39". There are no barcode fonts for more complex barcodes or 2D-barcodes like DataMatrix or QR.
2. Create an image using a tool like "zint" (open source) and load the image into a XbpBitmap object. (
https://zint.org.uk/)
3. Do the same as in 2., but with an ActiveX component like "TBarCode".
We use the List&Label report generator in our applications, which comes with all barcodes, simply generated with one function call in a form. In order to show this on the screen, we use the storage system of L&L and export the form with the barcode in it to JPG or PDF - and show this in our app.
You may even find functions to create barcodes by yourself and show them using the GRA engine. But this will be a little work.

(Edit: You may ask ChatGPT to help you to generate Xbase++-code which shows simple barcodes like Code 39 or Code 128 or some others using Xbase++'s GRA engine. Just ask for it.)
Re: Display a barcode on the screen
Posted: Wed Jul 23, 2025 1:17 pm
by digitsoft
You have to put a * at the beginning and another at the end *
and you must have the FONT installed
@ 12,25 DCSAY "*123456*" FONT "MV6Code39M"
Re: Display a barcode on the screen
Posted: Thu Jul 24, 2025 1:59 am
by OSMAN
Tom, Nolberto Thank you for your solutions.
For now, "*12345*" will do the trick.
Re: Display a barcode on the screen
Posted: Fri Jul 25, 2025 7:53 am
by Tom
BTW, Xbase++ 2.0 contains an asset to create, draw and print 2D-barcodes like QR and DataMatrix.