Anbindung für ZBar (QR- und Barcodes entschlüsseln)
Download
ZIP-Archiv (80 kB)
k. A.- Plattformen:
FreeBASIC 0.24.0
Quelltext enthalten- Angelegt von
TJF am 23.05.2013 • Aktueller Dateiupload vom 24.05.2013 - Alle Dateiversionen
Bewertung
Punkte: 5,0 bei 2 StimmenDer gegenständliche Download betrifft Header-Dateien und Beispielquelltext zur Nutzung der OpenSource Bibliothek libzbar (LGPLv2.1) mit FreeBasic.
libzbar ermöglicht das Entschlüsselung verschiedener optischer Binärcodes in Form von linearen Strichcodes (Barcode: EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 39, Interleaved 2 of 5) oder zweidimensionalen Punktcodes (QR-Code). Siehe auch
API Beschreibung (en).
| Original | |
|---|---|
| Webseite | |
| Dokumentation | |
| Quelltext | |
| FreeBasic | |
| Header | http://www.freebasic-portal.de/dlfiles/431/libzbar-0.10.zip |
| Beispiele | Im Archiv |
| Binaries | |
| DOS | Nicht verfügbar. |
| windows | |
| LINUX | sudo aptget install libzbar-dev |
Der Download enthält
| Header (include/zbar) | |
|---|---|
| zbar/zbar.bi | API der Bibliothek |
| zbar/zbargtk.bi | GTK+-Widget Erweiterung |
| Beispiele (examples/zbar) | |
| scan_image.bas | Decodieren einer Bilddatei (PNG-Format) |
| scan_video.bas | Decodieren eines Video-Streams (LINUX only) |
| test_gtk.bas | Decodieren von Bildern oder Video-Stream (LINUX only) mit GTK-GUI |
| *.png | Bilder verschiedener Codes zum Testen |
Beispielcode (auch im Archiv enthalten)
' This is file scan_video.bas
'
' a FreeBasic translation of a libzbar example,
' translated by TJF:
' GPL-3 (C) 2013 by Thomas[ dot ]Freiherr[ at ]gmx[ dot ]net
'
' * activate video device (LINUX only)
' * display a preview window
' * continuously scan for barcodes
' * output decoded results to stdout
' * exit when the mouse clicked or a key is pressed in the preview window
'
' For details see
' http://sourceforge.net/apps/mediawiki/zbar/index.php?title=HOWTO:_Scan_video_using_the_Processor)
#INCLUDE ONCE "zbar/zbar.bi"
SUB handler CDECL( _
BYVAL image AS zbar_image_t PTR, _
BYVAL userdata AS CONST ANY PTR)
'/* extract results */
VAR symbol = zbar_image_first_symbol(image)
WHILE symbol
'/* do something useful with results */
PRINT "decoded " & *zbar_get_symbol_name(zbar_symbol_get_type(symbol)) _
& " symbol """ & *zbar_symbol_get_data(symbol) & """"
symbol = zbar_symbol_next(symbol)
WEND
END SUB
VAR device = @"/dev/video0"
'/* create a Processor */
VAR proc = zbar_processor_create(1)
'/* configure the Processor */
zbar_processor_set_config(proc, 0, ZBAR_CFG_ENABLE, 1)
'/* initialize the Processor */
IF __FB_ARGC__ > 1 THEN device = __FB_ARGV__[1]
zbar_processor_init(proc, device, 1)
'/* setup a callback */
zbar_processor_set_data_handler(proc, @handler, 0)
'/* enable the preview window */
zbar_processor_set_visible(proc, 1)
zbar_processor_set_active(proc, 1)
'/* keep scanning until user provides key/mouse input */
zbar_processor_user_wait(proc, -1)
'/* clean up */
zbar_processor_destroy(proc)
Screenshots der GUI-Applikation




English
See
english forum thread.



FreeBASIC-Nachrichten jetzt auch über Twitter erhalten. Follow us!