diff --git a/examples/official/9.x/qt_gui/README.md b/examples/official/9.x/qt_gui/README.md new file mode 100644 index 0000000..aaf0998 --- /dev/null +++ b/examples/official/9.x/qt_gui/README.md @@ -0,0 +1,51 @@ +# Python Barcode Reader with Desktop GUI +This is a cross-platform GUI barcode reader application built with `Python 3`, `PySide6`, and the [Dynamsoft Python Barcode SDK](https://www.dynamsoft.com/barcode-reader/docs/server/programming/python/). It supports `Windows`, `Linux`, `macOS` and `Raspberry Pi OS`. + + +## Prerequisites +- **OpenCV** + + ```bash + python3 -m pip install opencv-python + ``` + +- **PySide6** + + ```bash + python3 -m pip install PySide6 + ``` + +- **Dynamsoft Barcode Reader** + + ``` + python3 -m pip install dbr + ``` + +- [Dynamsoft Barcode SDK License](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr) + + +## Usage + +- **Simple Demo** + + ``` + python3 app.py license.txt + ``` + + ![Python Barcode Reader](./screenshots/simple-demo.png) + +- **Advanced Demo** + + The advanced demo supports reading barcodes from image files, webcam, and desktop screenshots: + + ``` + pyside2-uic design.ui -o design.py + python3 app_advanced.py license.txt + ``` + + ![Python Barcode Reader](./screenshots/advanced-demo.png) + + +## Blog +- [How to Create a Python Barcode Reader to Scan QR Code from Desktop Screen](https://www.dynamsoft.com/codepool/scan-qr-code-from-desktop-screen.html) +- [Advanced GUI Python Barcode Reader for Windows, Linux, macOS and Rasberry Pi OS](https://www.dynamsoft.com/codepool/gui-barcode-reader-windows-linux-macos.html) diff --git a/examples/official/9.x/qt_gui/app.py b/examples/official/9.x/qt_gui/app.py new file mode 100644 index 0000000..3b3d719 --- /dev/null +++ b/examples/official/9.x/qt_gui/app.py @@ -0,0 +1,215 @@ +#!/usr/bin/env python3 + +''' +Usage: + app.py +''' + +import sys +from PySide6.QtGui import QPixmap, QImage + +from PySide6.QtWidgets import QApplication, QLabel, QPushButton, QVBoxLayout, QWidget, QFileDialog, QTextEdit, QMessageBox, QHBoxLayout +from PySide6.QtCore import QTimer + +from barcode_manager import * +import os +import cv2 + + +class UI_Window(QWidget): + + def __init__(self): + QWidget.__init__(self) + + self.FRAME_WIDTH = 640 + self.FRAME_HEIGHT = 480 + self.WINDOW_WIDTH = 1280 + self.WINDOW_HEIGHT = 1000 + self._results = None + # Initialize Dynamsoft Barcode Reader + self._barcodeManager = BarcodeManager() + + # Initialize OpenCV camera + self._cap = cv2.VideoCapture(0) + # cap.set(5, 30) #set FPS + self._cap.set(cv2.CAP_PROP_FRAME_WIDTH, self.FRAME_WIDTH) + self._cap.set(cv2.CAP_PROP_FRAME_HEIGHT, self.FRAME_HEIGHT) + + # The current path. + self._path = os.path.dirname(os.path.realpath(__file__)) + + # Create a timer. + self.timer = QTimer() + self.timer.timeout.connect(self.nextFrameUpdate) + + # Create a layout. + layout = QVBoxLayout() + + # Add a button + self.btn = QPushButton("Load an image") + self.btn.clicked.connect(self.pickFile) + layout.addWidget(self.btn) + + # Add a button + button_layout = QHBoxLayout() + + btnCamera = QPushButton("Open camera") + btnCamera.clicked.connect(self.openCamera) + button_layout.addWidget(btnCamera) + + btnCamera = QPushButton("Stop camera") + btnCamera.clicked.connect(self.stopCamera) + button_layout.addWidget(btnCamera) + + layout.addLayout(button_layout) + + # Add a label + self.label = QLabel() + self.label.setFixedSize(self.WINDOW_WIDTH - 30, + self.WINDOW_HEIGHT - 160) + layout.addWidget(self.label) + + # Add a text area + self.results = QTextEdit() + layout.addWidget(self.results) + + # Set the layout + self.setLayout(layout) + self.setWindowTitle("Dynamsoft Barcode Reader") + self.setFixedSize(self.WINDOW_WIDTH, self.WINDOW_HEIGHT) + + # https://stackoverflow.com/questions/1414781/prompt-on-exit-in-pyqt-application + + def closeEvent(self, event): + + msg = "Close the app?" + reply = QMessageBox.question(self, 'Message', + msg, QMessageBox.Yes, QMessageBox.No) + + if reply == QMessageBox.Yes: + self.stopCamera() + event.accept() + else: + event.ignore() + + def resizeImage(self, pixmap): + lwidth = self.label.maximumWidth() + pwidth = pixmap.width() + lheight = self.label.maximumHeight() + pheight = pixmap.height() + + wratio = pwidth * 1.0 / lwidth + hratio = pheight * 1.0 / lheight + + if pwidth > lwidth or pheight > lheight: + if wratio > hratio: + lheight = pheight / wratio + else: + lwidth = pwidth / hratio + + scaled_pixmap = pixmap.scaled(lwidth, lheight) + return scaled_pixmap + else: + return pixmap + + def showMessageBox(self, text): + msgBox = QMessageBox() + msgBox.setText(text) + msgBox.exec() + + def pickFile(self): + self.stopCamera() + # Load an image file. + filename = QFileDialog.getOpenFileName(self, 'Open file', + self._path, "Barcode images (*)") + if filename is None or filename[0] == '': + self.showMessageBox("No file selected") + return + + # Read barcodes + frame, results = self._barcodeManager.decode_file(filename[0]) + if frame is None: + self.showMessageBox("Cannot decode " + filename[0]) + return + + self.showResults(frame, results) + + def openCamera(self): + + if not self._cap.isOpened(): + self.showMessageBox("Failed to open camera.") + return + + self._barcodeManager.create_barcode_process() + self.timer.start(1000./24) + + def stopCamera(self): + self._barcodeManager.destroy_barcode_process() + self.timer.stop() + + def showResults(self, frame, results): + out = '' + index = 0 + + if results is not None and results[0] is not None: + thickness = 2 + color = (0, 255, 0) + out = 'Elapsed time: ' + "{:.2f}".format(results[1]) + 'ms\n\n' + for result in results[0]: + points = result.localization_result.localization_points + out += "Index: " + str(index) + "\n" + out += "Barcode format: " + result.barcode_format_string + '\n' + out += "Barcode value: " + result.barcode_text + '\n' + out += "Bounding box: " + \ + str(points[0]) + ' ' + str(points[1]) + ' ' + \ + str(points[2]) + ' ' + str(points[3]) + '\n' + out += '-----------------------------------\n' + index += 1 + + cv2.line(frame, points[0], points[1], color, thickness) + cv2.line(frame, points[1], points[2], color, thickness) + cv2.line(frame, points[2], points[3], color, thickness) + cv2.line(frame, points[3], points[0], color, thickness) + cv2.putText(frame, result.barcode_text, + points[0], cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 0, 255)) + + frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) + image = QImage( + frame, frame.shape[1], frame.shape[0], frame.strides[0], QImage.Format_RGB888) + pixmap = QPixmap.fromImage(image) + pixmap = self.resizeImage(pixmap) + self.label.setPixmap(pixmap) + self.results.setText(out) + + def nextFrameUpdate(self): + ret, frame = self._cap.read() + + if not ret: + self.showMessageBox('Failed to get camera frame!') + return + + self._barcodeManager.append_frame(frame) + self._results = self._barcodeManager.peek_results() + + self.showResults(frame, self._results) + + +def main(): + try: + with open(sys.argv[1]) as f: + license = f.read() + BarcodeReader.init_license( + license) + except: + BarcodeReader.init_license( + "DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAxLTE2NDk4Mjk3OTI2MzUiLCJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSIsInNlc3Npb25QYXNzd29yZCI6IndTcGR6Vm05WDJrcEQ5YUoifQ==") + + app = QApplication(sys.argv) + ex = UI_Window() + ex.show() + sys.exit(app.exec()) + + +if __name__ == '__main__': + print(__doc__) + main() diff --git a/examples/official/9.x/qt_gui/app_advanced.py b/examples/official/9.x/qt_gui/app_advanced.py new file mode 100644 index 0000000..1f3f02f --- /dev/null +++ b/examples/official/9.x/qt_gui/app_advanced.py @@ -0,0 +1,432 @@ +#!/usr/bin/env python3 + +''' +Usage: + app.py +''' + +import sys +from PySide6.QtGui import QPixmap, QImage, QPainter, QPen, QColor +from PySide6.QtWidgets import QApplication, QMainWindow, QInputDialog +from PySide6.QtCore import QFile, QTimer, QEvent +from PySide6.QtWidgets import * +from design import Ui_MainWindow + +from barcode_manager import * +import os +import cv2 +from dbr import EnumBarcodeFormat, EnumBarcodeFormat_2 + + +class MainWindow(QMainWindow): + def __init__(self): + super(MainWindow, self).__init__() + self.ui = Ui_MainWindow() + self.ui.setupUi(self) + + # Initialization + self._all_data = {} + self._results = None + self._painter = None + + # Dynamsoft Barcode Reader + self._barcodeManager = BarcodeManager() + + # Create a timer. + self.timer = None + + # Open camera + self._cap = None + # self.openCamera() + + # Resolution list + self.ui.comboBox.currentTextChanged.connect(self.onComboBoxChanged) + + # The current path. + self._path = os.path.dirname(os.path.realpath(__file__)) + + # Camera button + self.ui.pushButton_open.clicked.connect(self.openCamera) + self.ui.pushButton_stop.clicked.connect(self.stopCamera) + + # Load file + self.ui.actionOpen_File.triggered.connect(self.openFile) + + # Load directory + self.ui.actionOpen_Folder.triggered.connect(self.openFolder) + + # Export template + self.ui.actionExport_template.triggered.connect(self.exportTemplate) + + # About + self.ui.actionAbout.triggered.connect(self.about) + + # Set license + self.ui.actionEnter_License_Key.triggered.connect(self.setLicense) + + # List widget + self.ui.listWidget.currentItemChanged.connect(self.currentItemChanged) + + # Template load button + self.ui.pushButton_template.clicked.connect(self.loadTemplate) + + # Template export button + self.ui.pushButton_export_template.clicked.connect(self.exportTemplate) + + self.ui.label.mouseMoveEvent = self.labelMouseMoveEvent + self.ui.label.mousePressEvent = self.labelMousePressEvent + self.ui.label.mouseReleaseEvent = self.labelMouseReleaseEvent + self._pixmap = None + self.x = 0 + self.y = 0 + self.endx = 0 + self.endy = 0 + self.clicked = False + + def paintEvent(self, event): + if self._pixmap is not None: + self.ui.label.setPixmap(self._pixmap) + # painter = QPainter(self.ui.label.pixmap()) + # xshift = self.ui.label.width() - self._pixmap.width() + # yshift = self.ui.label.height() - self._pixmap.height() + # pen = QPen() + # pen.setWidth(10) + # pen.setColor(QColor('red')) + # painter.setPen(pen) + # painter.drawRect(self.x, self.y - yshift / 2, self.endx - self.x, self.endy - self.y) + # painter.end() + + def labelMouseReleaseEvent(self, event): + self.clicked = False + + def labelMousePressEvent(self, event): + self.clicked = True + self.x = event.position().x() + self.y = event.position().y() + self.endx = self.x + self.endy = self.y + + def labelMouseMoveEvent(self, event): + if self.clicked: + self.endx = event.position().x() + self.endy = event.position().y() + + def resetCoordinates(self): + self.endx = self.x + self.endy = self.y + + def openCamera(self): + self.resetCoordinates() + + self.stopCamera() + self.setParameters() + + width = 640 + height = 480 + resolution = self.ui.comboBox.currentText() + if resolution == '640 x 480': + width = 640 + height = 480 + elif resolution == '320 x 240': + width = 320 + height = 240 + + self._cap = cv2.VideoCapture(0) + self._cap.set(cv2.CAP_PROP_FRAME_WIDTH, width) + self._cap.set(cv2.CAP_PROP_FRAME_HEIGHT, height) + width = self._cap.get(cv2.CAP_PROP_FRAME_WIDTH) + height = self._cap.get(cv2.CAP_PROP_FRAME_HEIGHT) + + if not self._cap.isOpened(): + self.showMessageBox('Error', "Failed to open camera.") + return + + if not self.ui.checkBox_syncdisplay.isChecked(): + self._barcodeManager.create_barcode_process() + + self.timer = QTimer() + self.timer.timeout.connect(self.nextFrameUpdate) + self.timer.start(1000./24) + + def stopCamera(self): + + if self._cap is not None: + self._cap.release() + self._cap = None + + if not self.ui.checkBox_syncdisplay.isChecked(): + if self.timer is not None: + self.timer.stop() + self.timer = None + + self._barcodeManager.destroy_barcode_process() + else: + if self.timer is not None: + self.timer.stop() + self.timer = None + + self._results = None + + def nextFrameUpdate(self): + ret, frame = self._cap.read() + + if not ret: + self.showMessageBox('Error', 'Failed to get camera frame!') + return + + if not self.ui.checkBox_syncdisplay.isChecked(): + self._barcodeManager.append_frame(frame) + self._results = self._barcodeManager.peek_results() + else: + frame, self._results = self._barcodeManager.decode_frame(frame) + + self.showResults(frame, self._results) + + def onComboBoxChanged(self): + self.openCamera() + + def loadTemplate(self): + filename = QFileDialog.getOpenFileName(self, 'Open template', + self._path, "*.json") + if filename is None or filename[0] == '': + # self.showMessageBox('Open File...', "No file selected") + return + + with open(filename[0]) as f: + template = f.read() + self.ui.textEdit_template.setText(template) + + def appendFile(self, filename): + + if filename not in self._all_data: + item = QListWidgetItem() + item.setText(filename) + self.ui.listWidget.addItem(item) + self._all_data[filename] = None + + def currentItemChanged(self, current, previous): + filename = current.text() + self.decodeFile(filename) + + def setParameters(self): + # Get template + template = self.ui.textEdit_template.toPlainText() + self._barcodeManager.set_template(template) + + # Get barcode types + types = 0 + types2 = 0 + if (self.ui.checkBox_code39.isChecked()): + types |= EnumBarcodeFormat.BF_CODE_39 + if (self.ui.checkBox_code93.isChecked()): + types |= EnumBarcodeFormat.BF_CODE_93 + if (self.ui.checkBox_code128.isChecked()): + types |= EnumBarcodeFormat.BF_CODE_128 + if (self.ui.checkBox_codabar.isChecked()): + types |= EnumBarcodeFormat.BF_CODABAR + if (self.ui.checkBox_itf.isChecked()): + types |= EnumBarcodeFormat.BF_ITF + if (self.ui.checkBox_ean13.isChecked()): + types |= EnumBarcodeFormat.BF_EAN_13 + if (self.ui.checkBox_ean8.isChecked()): + types |= EnumBarcodeFormat.BF_EAN_8 + if (self.ui.checkBox_upca.isChecked()): + types |= EnumBarcodeFormat.BF_UPC_A + if (self.ui.checkBox_upce.isChecked()): + types |= EnumBarcodeFormat.BF_UPC_E + if (self.ui.checkBox_industrial25.isChecked()): + types |= EnumBarcodeFormat.BF_INDUSTRIAL_25 + if (self.ui.checkBox_qrcode.isChecked()): + types |= EnumBarcodeFormat.BF_QR_CODE + if (self.ui.checkBox_pdf417.isChecked()): + types |= EnumBarcodeFormat.BF_PDF417 + if (self.ui.checkBox_aztec.isChecked()): + types |= EnumBarcodeFormat.BF_AZTEC + if (self.ui.checkBox_maxicode.isChecked()): + types |= EnumBarcodeFormat.BF_MAXICODE + if (self.ui.checkBox_datamatrix.isChecked()): + types |= EnumBarcodeFormat.BF_DATAMATRIX + if (self.ui.checkBox_gs1.isChecked()): + types |= EnumBarcodeFormat.BF_GS1_COMPOSITE + if (self.ui.checkBox_patchcode.isChecked()): + types |= EnumBarcodeFormat.BF_PATCHCODE + if (self.ui.checkBox_dotcode.isChecked()): + types2 |= EnumBarcodeFormat_2.BF2_DOTCODE + if (self.ui.checkBox_postalcode.isChecked()): + types2 |= EnumBarcodeFormat_2.BF2_POSTALCODE + + self._barcodeManager.set_barcode_types(types) + self._barcodeManager.set_barcode_types_2(types2) + + def decodeFile(self, filename): + self.resetCoordinates() + self.ui.statusbar.showMessage(filename) + + self.stopCamera() + self.setParameters() + + # Read barcodes + frame, results = self._barcodeManager.decode_file(filename) + if frame is None: + self.showMessageBox('Error', 'Cannot decode ' + filename) + return + + self._all_data[filename] = results + + self.showResults(frame, results) + + def openFile(self): + filename = QFileDialog.getOpenFileName(self, 'Open File', + self._path, "Barcode images (*)") + if filename is None or filename[0] == '': + # self.showMessageBox('Open File...', "No file selected") + return + + filename = filename[0] + self.appendFile(filename) + self.decodeFile(filename) + + def openFolder(self): + dir = QFileDialog.getExistingDirectory(self, 'Open Folder', + self._path, QFileDialog.ShowDirsOnly) + if dir == '': + # self.showMessageBox('Open Folder...', "No folder selected") + return + + files = [os.path.join(dir, f) for f in os.listdir( + dir) if os.path.isfile(os.path.join(dir, f))] + if len(files) == 0: + return + + for filename in files: + self.appendFile(filename) + + self.decodeFile(files[0]) + + def setLicense(self): + key = QInputDialog.getText(self, 'License', 'Enter license key') + if key[1]: + error = self._barcodeManager.set_license(key[0]) + if error[0] != EnumErrorCode.DBR_OK: + self.showMessageBox('Error', error[1]) + else: + self.ui.statusbar.showMessage( + 'Dynamsoft Barcode Reader is activated successfully!') + + def exportTemplate(self): + filename = QFileDialog.getSaveFileName(self, 'Save File', + self._path, "Barcode Template (*.json)") + if filename is None or filename[0] == '': + # self.showMessageBox('Open File...', "No file selected") + return + + filename = filename[0] + json = self._barcodeManager.get_template() + with open(filename, 'w') as f: + f.write(json) + + self.ui.statusbar.showMessage('File saved to ' + filename) + + def resizeImage(self, pixmap): + lwidth = self.ui.label.width() + pwidth = pixmap.width() + lheight = self.ui.label.height() + pheight = pixmap.height() + + wratio = pwidth * 1.0 / lwidth + hratio = pheight * 1.0 / lheight + + if pwidth > lwidth or pheight > lheight: + if wratio > hratio: + lheight = pheight / wratio + else: + lwidth = pwidth / hratio + + scaled_pixmap = pixmap.scaled(lwidth, lheight) + return scaled_pixmap + else: + return pixmap + + def showResults(self, frame, results): + out = '' + index = 0 + + if results is not None and results[0] is not None: + if self.ui.checkBox_autostop.isChecked(): + self.stopCamera() + + thickness = 2 + color = (0, 255, 0) + out = 'Elapsed time: ' + "{:.2f}".format(results[1]) + 'ms\n\n' + for result in results[0]: + points = result.localization_result.localization_points + out += "Index: " + str(index) + "\n" + out += "Barcode format: " + result.barcode_format_string + '\n' + out += "Barcode value: " + result.barcode_text + '\n' + out += "Bounding box: " + \ + str(points[0]) + ' ' + str(points[1]) + ' ' + \ + str(points[2]) + ' ' + str(points[3]) + '\n' + out += '-----------------------------------\n' + index += 1 + + cv2.line(frame, points[0], points[1], color, thickness) + cv2.line(frame, points[1], points[2], color, thickness) + cv2.line(frame, points[2], points[3], color, thickness) + cv2.line(frame, points[3], points[0], color, thickness) + cv2.putText(frame, result.barcode_text, + points[0], cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 0, 255)) + + frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) + image = QImage( + frame, frame.shape[1], frame.shape[0], frame.strides[0], QImage.Format_RGB888) + pixmap = QPixmap.fromImage(image) + self._pixmap = self.resizeImage(pixmap) + self.ui.label.setPixmap(self._pixmap) + self.ui.textEdit_results.setText(out) + + def about(self): + self.showMessageBox( + "About", "About Dynamsoft Barcode Reader") + + def showMessageBox(self, title, content): + msgBox = QMessageBox() + msgBox.setWindowTitle(title) + msgBox.setText(content) + msgBox.exec() + + def closeEvent(self, event): + + msg = "Close the app?" + reply = QMessageBox.question(self, 'Message', + msg, QMessageBox.Yes, QMessageBox.No) + + if reply == QMessageBox.Yes: + # self._painter.end() + self.stopCamera() + + event.accept() + else: + event.ignore() + + +def main(): + try: + with open(sys.argv[1]) as f: + license = f.read() + BarcodeReader.init_license( + license) + except: + BarcodeReader.init_license( + "DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAxLTE2NDk4Mjk3OTI2MzUiLCJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSIsInNlc3Npb25QYXNzd29yZCI6IndTcGR6Vm05WDJrcEQ5YUoifQ==") + + app = QApplication(sys.argv) + + window = MainWindow() + window.show() + + sys.exit(app.exec()) + + +if __name__ == '__main__': + print(__doc__) + main() diff --git a/examples/official/9.x/qt_gui/barcode_manager.py b/examples/official/9.x/qt_gui/barcode_manager.py new file mode 100644 index 0000000..af2ab78 --- /dev/null +++ b/examples/official/9.x/qt_gui/barcode_manager.py @@ -0,0 +1,211 @@ + +from dbr import * +import cv2 +from multiprocessing import Process, Queue +import time +import numpy as np + + +def process_barcode_frame(frameQueue, resultQueue, template=None, types=0, types2=0): + # Create Dynamsoft Barcode Reader + reader = BarcodeReader() + if template != None and template != '': + error = reader.init_runtime_settings_with_string(template) + if error[0] != EnumErrorCode.DBR_OK: + print(error[1]) + + if types != 0: + settings = reader.get_runtime_settings() + settings.barcode_format_ids = types + ret = reader.update_runtime_settings(settings) + + if types2 != 0: + settings = reader.get_runtime_settings() + settings.barcode_format_ids_2 = types2 + ret = reader.update_runtime_settings(settings) + + settings = reader.get_runtime_settings() + settings.max_algorithm_thread_count = 1 + reader.update_runtime_settings(settings) + + while True: + results = None + + try: + frame = frameQueue.get(False, 10) + if type(frame) is str: + break + except: + time.sleep(0.01) + continue + + start, end = 0, 0 + try: + frameHeight, frameWidth, channel = frame.shape[:3] + start = time.time() + # results = reader.decode_buffer(frame) + results = reader.decode_buffer_manually(np.array(frame).tobytes( + ), frameWidth, frameHeight, frame.strides[0], EnumImagePixelFormat.IPF_RGB_888) + end = time.time() + except BarcodeReaderError as error: + print(error) + + try: + resultQueue.put([results, (end - start) * 1000], False, 10) + except: + pass + + +class BarcodeManager(): + def __init__(self): + self._reader = BarcodeReader() + settings = self._reader.get_runtime_settings() + settings.max_algorithm_thread_count = 1 + self._reader.update_runtime_settings(settings) + self._template = None + self._types = 0 + self._types2 = 0 + + self.frameQueue, self.resultQueue, self.barcodeScanning = None, None, None + + def __init_params(self): + if self._template != None and self._template != '': + error = self._reader.init_runtime_settings_with_string( + self._template) + if error[0] != EnumErrorCode.DBR_OK: + print(error[1]) + + if self._types != 0: + settings = self._reader.get_runtime_settings() + settings.barcode_format_ids = self._types + ret = self._reader.update_runtime_settings(settings) + + if self._types2 != 0: + settings = self._reader.get_runtime_settings() + settings.barcode_format_ids_2 = self._types2 + ret = self._reader.update_runtime_settings(settings) + + def __decode_file(self, filename): + self.__init_params() + + settings = self._reader.get_runtime_settings() + settings.intermediate_result_types = EnumIntermediateResultType.IRT_ORIGINAL_IMAGE + settings.intermediate_result_saving_mode = EnumIntermediateResultSavingMode.IRSM_MEMORY + error = self._reader.update_runtime_settings(settings) + + start = time.time() + results = self._reader.decode_file(filename) + end = time.time() + + intermediate_results = self._reader.get_all_intermediate_results() + + imageData = intermediate_results[0].results[0] + buffer = imageData.bytes + width = imageData.width + height = imageData.height + stride = imageData.stride + format = imageData.image_pixel_format + channel = 3 + if format == EnumImagePixelFormat.IPF_RGB_888: + channel = 3 + elif format == EnumImagePixelFormat.IPF_BINARY or format == EnumImagePixelFormat.IPF_GRAYSCALED or format == EnumImagePixelFormat.IPF_BINARYINVERTED: + channel = 1 + + if format == EnumImagePixelFormat.IPF_BINARY or format == EnumImagePixelFormat.IPF_BINARYINVERTED: + whiteValue = 1 + if format == EnumImagePixelFormat.IPF_BINARYINVERTED: + whiteValue = 0 + + binData = bytearray(len(buffer) << 3) + count = 0 + for pos in range(len(buffer)): + for bit in range(7, -1, -1): + if (buffer[pos] >> bit) & 0x01 == whiteValue: + binData[count] = 255 + else: + binData[count] = 0 + + count += 1 + + frame = np.ndarray((height, width, channel), + np.uint8, binData, 0, (stride << 3, channel, 1)) + else: + + frame = np.ndarray((height, width, channel), + np.uint8, buffer, 0, (stride, channel, 1)) + return frame, [results, (end - start) * 1000] + + def __decode_buffer(self, frame): + if frame is None: + return None, None + + self.__init_params() + + start = time.time() + results = self._reader.decode_buffer(frame) + end = time.time() + return frame, [results, (end - start) * 1000] + + def decode_frame(self, frame): + return self.__decode_buffer(frame) + + def decode_file(self, filename): + if filename.endswith('.gif') or filename.endswith('.pdf'): + return self.__decode_file(filename) + else: + frame = cv2.imread(filename) + return self.__decode_buffer(frame) + + def set_template(self, template): + self._template = template + + def set_barcode_types(self, types): + self._types = types + + def set_barcode_types_2(self, types): + self._types2 = types + + def create_barcode_process(self): + self.destroy_barcode_process() + + size = 1 + self.frameQueue = Queue(size) + self.resultQueue = Queue(size) + self.barcodeScanning = Process(target=process_barcode_frame, args=( + self.frameQueue, self.resultQueue, self._template, self._types, self._types2)) + self.barcodeScanning.start() + + def destroy_barcode_process(self): + if self.frameQueue != None: + self.frameQueue.put("") + self.frameQueue = None + + if self.barcodeScanning != None: + self.barcodeScanning.join() + self.barcodeScanning = None + + if self.frameQueue != None: + self.frameQueue.close() + self.frameQueue = None + + if self.resultQueue != None: + self.resultQueue.close() + self.resultQueue = None + + def append_frame(self, frame): + try: + self.frameQueue.put(frame.copy(), False, 10) + except: + pass + + def peek_results(self): + try: + return self.resultQueue.get(False, 10) + except: + return None + + def get_template(self): + return self._reader.output_settings_to_json_string() + + def set_license(self, key): + BarcodeReader.init_license(key) diff --git a/examples/official/9.x/qt_gui/design.py b/examples/official/9.x/qt_gui/design.py new file mode 100644 index 0000000..61afa3f --- /dev/null +++ b/examples/official/9.x/qt_gui/design.py @@ -0,0 +1,299 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'design.ui' +## +## Created by: Qt User Interface Compiler version 5.15.1 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide6.QtCore import * +from PySide6.QtGui import * +from PySide6.QtWidgets import * + + +class Ui_MainWindow(object): + def setupUi(self, MainWindow): + if not MainWindow.objectName(): + MainWindow.setObjectName(u"MainWindow") + MainWindow.resize(1600, 848) + sizePolicy = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Maximum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth()) + MainWindow.setSizePolicy(sizePolicy) + MainWindow.setMinimumSize(QSize(1600, 848)) + MainWindow.setMaximumSize(QSize(16777215, 16777215)) + MainWindow.setTabShape(QTabWidget.Rounded) + self.actionAbout = QAction(MainWindow) + self.actionAbout.setObjectName(u"actionAbout") + self.actionOpen_File = QAction(MainWindow) + self.actionOpen_File.setObjectName(u"actionOpen_File") + self.actionOpen_Folder = QAction(MainWindow) + self.actionOpen_Folder.setObjectName(u"actionOpen_Folder") + self.actionExport_template = QAction(MainWindow) + self.actionExport_template.setObjectName(u"actionExport_template") + self.actionEnter_License_Key = QAction(MainWindow) + self.actionEnter_License_Key.setObjectName(u"actionEnter_License_Key") + self.centralwidget = QWidget(MainWindow) + self.centralwidget.setObjectName(u"centralwidget") + sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) + sizePolicy1.setHorizontalStretch(0) + sizePolicy1.setVerticalStretch(0) + sizePolicy1.setHeightForWidth(self.centralwidget.sizePolicy().hasHeightForWidth()) + self.centralwidget.setSizePolicy(sizePolicy1) + self.gridLayout = QGridLayout(self.centralwidget) + self.gridLayout.setObjectName(u"gridLayout") + self.groupBox_camera = QGroupBox(self.centralwidget) + self.groupBox_camera.setObjectName(u"groupBox_camera") + sizePolicy2 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Preferred) + sizePolicy2.setHorizontalStretch(0) + sizePolicy2.setVerticalStretch(0) + sizePolicy2.setHeightForWidth(self.groupBox_camera.sizePolicy().hasHeightForWidth()) + self.groupBox_camera.setSizePolicy(sizePolicy2) + self.groupBox_camera.setMinimumSize(QSize(450, 150)) + self.comboBox = QComboBox(self.groupBox_camera) + self.comboBox.addItem("") + self.comboBox.addItem("") + self.comboBox.setObjectName(u"comboBox") + self.comboBox.setGeometry(QRect(180, 50, 101, 31)) + self.label_2 = QLabel(self.groupBox_camera) + self.label_2.setObjectName(u"label_2") + self.label_2.setGeometry(QRect(90, 50, 131, 31)) + font = QFont() + font.setPointSize(10) + self.label_2.setFont(font) + self.pushButton_open = QPushButton(self.groupBox_camera) + self.pushButton_open.setObjectName(u"pushButton_open") + self.pushButton_open.setGeometry(QRect(90, 90, 93, 28)) + self.pushButton_stop = QPushButton(self.groupBox_camera) + self.pushButton_stop.setObjectName(u"pushButton_stop") + self.pushButton_stop.setGeometry(QRect(190, 90, 93, 28)) + self.checkBox_autostop = QCheckBox(self.groupBox_camera) + self.checkBox_autostop.setObjectName(u"checkBox_autostop") + self.checkBox_autostop.setGeometry(QRect(90, 20, 101, 20)) + self.checkBox_syncdisplay = QCheckBox(self.groupBox_camera) + self.checkBox_syncdisplay.setObjectName(u"checkBox_syncdisplay") + self.checkBox_syncdisplay.setGeometry(QRect(210, 20, 121, 20)) + + self.gridLayout.addWidget(self.groupBox_camera, 0, 2, 1, 1) + + self.groupBox_template = QGroupBox(self.centralwidget) + self.groupBox_template.setObjectName(u"groupBox_template") + sizePolicy2.setHeightForWidth(self.groupBox_template.sizePolicy().hasHeightForWidth()) + self.groupBox_template.setSizePolicy(sizePolicy2) + self.groupBox_template.setMinimumSize(QSize(450, 200)) + self.pushButton_template = QPushButton(self.groupBox_template) + self.pushButton_template.setObjectName(u"pushButton_template") + self.pushButton_template.setGeometry(QRect(50, 20, 141, 28)) + self.textEdit_template = QTextEdit(self.groupBox_template) + self.textEdit_template.setObjectName(u"textEdit_template") + self.textEdit_template.setGeometry(QRect(10, 60, 381, 121)) + self.pushButton_export_template = QPushButton(self.groupBox_template) + self.pushButton_export_template.setObjectName(u"pushButton_export_template") + self.pushButton_export_template.setGeometry(QRect(220, 20, 141, 28)) + + self.gridLayout.addWidget(self.groupBox_template, 1, 2, 1, 1) + + self.listWidget = QListWidget(self.centralwidget) + self.listWidget.setObjectName(u"listWidget") + sizePolicy3 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Expanding) + sizePolicy3.setHorizontalStretch(0) + sizePolicy3.setVerticalStretch(0) + sizePolicy3.setHeightForWidth(self.listWidget.sizePolicy().hasHeightForWidth()) + self.listWidget.setSizePolicy(sizePolicy3) + + self.gridLayout.addWidget(self.listWidget, 0, 0, 4, 1) + + self.label = QLabel(self.centralwidget) + self.label.setObjectName(u"label") + sizePolicy4 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) + sizePolicy4.setHorizontalStretch(0) + sizePolicy4.setVerticalStretch(0) + sizePolicy4.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth()) + self.label.setSizePolicy(sizePolicy4) + self.label.setMinimumSize(QSize(800, 800)) + self.label.setMaximumSize(QSize(16777215, 16777215)) + self.label.setMouseTracking(True) + + self.gridLayout.addWidget(self.label, 0, 1, 4, 1) + + self.groupBox_barcode = QGroupBox(self.centralwidget) + self.groupBox_barcode.setObjectName(u"groupBox_barcode") + sizePolicy2.setHeightForWidth(self.groupBox_barcode.sizePolicy().hasHeightForWidth()) + self.groupBox_barcode.setSizePolicy(sizePolicy2) + self.groupBox_barcode.setMinimumSize(QSize(450, 220)) + self.groupBox_4 = QGroupBox(self.groupBox_barcode) + self.groupBox_4.setObjectName(u"groupBox_4") + self.groupBox_4.setGeometry(QRect(10, 20, 431, 111)) + self.checkBox_code39 = QCheckBox(self.groupBox_4) + self.checkBox_code39.setObjectName(u"checkBox_code39") + self.checkBox_code39.setGeometry(QRect(50, 20, 81, 20)) + self.checkBox_code39.setChecked(True) + self.checkBox_code93 = QCheckBox(self.groupBox_4) + self.checkBox_code93.setObjectName(u"checkBox_code93") + self.checkBox_code93.setGeometry(QRect(130, 20, 81, 20)) + self.checkBox_code93.setChecked(True) + self.checkBox_code128 = QCheckBox(self.groupBox_4) + self.checkBox_code128.setObjectName(u"checkBox_code128") + self.checkBox_code128.setGeometry(QRect(210, 20, 81, 20)) + self.checkBox_code128.setChecked(True) + self.checkBox_codabar = QCheckBox(self.groupBox_4) + self.checkBox_codabar.setObjectName(u"checkBox_codabar") + self.checkBox_codabar.setGeometry(QRect(300, 20, 81, 20)) + self.checkBox_codabar.setChecked(True) + self.checkBox_itf = QCheckBox(self.groupBox_4) + self.checkBox_itf.setObjectName(u"checkBox_itf") + self.checkBox_itf.setGeometry(QRect(50, 50, 81, 20)) + self.checkBox_itf.setChecked(True) + self.checkBox_ean13 = QCheckBox(self.groupBox_4) + self.checkBox_ean13.setObjectName(u"checkBox_ean13") + self.checkBox_ean13.setGeometry(QRect(130, 50, 81, 20)) + self.checkBox_ean13.setChecked(True) + self.checkBox_ean8 = QCheckBox(self.groupBox_4) + self.checkBox_ean8.setObjectName(u"checkBox_ean8") + self.checkBox_ean8.setGeometry(QRect(210, 50, 81, 20)) + self.checkBox_ean8.setChecked(True) + self.checkBox_upca = QCheckBox(self.groupBox_4) + self.checkBox_upca.setObjectName(u"checkBox_upca") + self.checkBox_upca.setGeometry(QRect(300, 50, 81, 20)) + self.checkBox_upca.setChecked(True) + self.checkBox_upce = QCheckBox(self.groupBox_4) + self.checkBox_upce.setObjectName(u"checkBox_upce") + self.checkBox_upce.setGeometry(QRect(50, 80, 81, 20)) + self.checkBox_upce.setChecked(True) + self.checkBox_industrial25 = QCheckBox(self.groupBox_4) + self.checkBox_industrial25.setObjectName(u"checkBox_industrial25") + self.checkBox_industrial25.setGeometry(QRect(130, 80, 101, 20)) + self.checkBox_industrial25.setChecked(True) + self.groupBox_5 = QGroupBox(self.groupBox_barcode) + self.groupBox_5.setObjectName(u"groupBox_5") + self.groupBox_5.setGeometry(QRect(9, 139, 431, 71)) + self.checkBox_qrcode = QCheckBox(self.groupBox_5) + self.checkBox_qrcode.setObjectName(u"checkBox_qrcode") + self.checkBox_qrcode.setGeometry(QRect(50, 10, 81, 20)) + self.checkBox_qrcode.setChecked(True) + self.checkBox_pdf417 = QCheckBox(self.groupBox_5) + self.checkBox_pdf417.setObjectName(u"checkBox_pdf417") + self.checkBox_pdf417.setGeometry(QRect(140, 10, 81, 20)) + self.checkBox_pdf417.setChecked(True) + self.checkBox_aztec = QCheckBox(self.groupBox_5) + self.checkBox_aztec.setObjectName(u"checkBox_aztec") + self.checkBox_aztec.setGeometry(QRect(220, 10, 81, 20)) + self.checkBox_aztec.setChecked(True) + self.checkBox_postalcode = QCheckBox(self.groupBox_5) + self.checkBox_postalcode.setObjectName(u"checkBox_postalcode") + self.checkBox_postalcode.setGeometry(QRect(320, 10, 91, 20)) + self.checkBox_postalcode.setChecked(True) + self.checkBox_maxicode = QCheckBox(self.groupBox_5) + self.checkBox_maxicode.setObjectName(u"checkBox_maxicode") + self.checkBox_maxicode.setGeometry(QRect(50, 40, 81, 20)) + self.checkBox_maxicode.setChecked(True) + self.checkBox_dotcode = QCheckBox(self.groupBox_5) + self.checkBox_dotcode.setObjectName(u"checkBox_dotcode") + self.checkBox_dotcode.setGeometry(QRect(140, 40, 81, 20)) + self.checkBox_dotcode.setChecked(True) + self.checkBox_patchcode = QCheckBox(self.groupBox_5) + self.checkBox_patchcode.setObjectName(u"checkBox_patchcode") + self.checkBox_patchcode.setGeometry(QRect(220, 40, 91, 20)) + self.checkBox_patchcode.setChecked(True) + self.checkBox_datamatrix = QCheckBox(self.groupBox_5) + self.checkBox_datamatrix.setObjectName(u"checkBox_datamatrix") + self.checkBox_datamatrix.setGeometry(QRect(320, 40, 91, 20)) + self.checkBox_datamatrix.setChecked(True) + self.checkBox_gs1 = QCheckBox(self.groupBox_5) + self.checkBox_gs1.setObjectName(u"checkBox_gs1") + self.checkBox_gs1.setGeometry(QRect(50, 70, 121, 20)) + self.checkBox_gs1.setChecked(True) + + self.gridLayout.addWidget(self.groupBox_barcode, 2, 2, 1, 1) + + self.textEdit_results = QTextEdit(self.centralwidget) + self.textEdit_results.setObjectName(u"textEdit_results") + sizePolicy5 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Expanding) + sizePolicy5.setHorizontalStretch(0) + sizePolicy5.setVerticalStretch(0) + sizePolicy5.setHeightForWidth(self.textEdit_results.sizePolicy().hasHeightForWidth()) + self.textEdit_results.setSizePolicy(sizePolicy5) + self.textEdit_results.setMinimumSize(QSize(450, 200)) + + self.gridLayout.addWidget(self.textEdit_results, 3, 2, 1, 1) + + MainWindow.setCentralWidget(self.centralwidget) + self.menubar = QMenuBar(MainWindow) + self.menubar.setObjectName(u"menubar") + self.menubar.setGeometry(QRect(0, 0, 1600, 26)) + self.menuAbout = QMenu(self.menubar) + self.menuAbout.setObjectName(u"menuAbout") + self.menuHelp = QMenu(self.menubar) + self.menuHelp.setObjectName(u"menuHelp") + MainWindow.setMenuBar(self.menubar) + self.statusbar = QStatusBar(MainWindow) + self.statusbar.setObjectName(u"statusbar") + MainWindow.setStatusBar(self.statusbar) + + self.menubar.addAction(self.menuAbout.menuAction()) + self.menubar.addAction(self.menuHelp.menuAction()) + self.menuAbout.addAction(self.actionOpen_File) + self.menuAbout.addAction(self.actionOpen_Folder) + self.menuAbout.addAction(self.actionExport_template) + self.menuHelp.addAction(self.actionAbout) + self.menuHelp.addAction(self.actionEnter_License_Key) + + self.retranslateUi(MainWindow) + + QMetaObject.connectSlotsByName(MainWindow) + # setupUi + + def retranslateUi(self, MainWindow): + MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"Dynamsoft Barcode Reader", None)) +#if QT_CONFIG(accessibility) + MainWindow.setAccessibleName(QCoreApplication.translate("MainWindow", u"Dynamsoft Barcode Reader", None)) +#endif // QT_CONFIG(accessibility) + self.actionAbout.setText(QCoreApplication.translate("MainWindow", u"About", None)) + self.actionOpen_File.setText(QCoreApplication.translate("MainWindow", u"Open File...", None)) + self.actionOpen_Folder.setText(QCoreApplication.translate("MainWindow", u"Open Folder...", None)) + self.actionExport_template.setText(QCoreApplication.translate("MainWindow", u"Save Template", None)) + self.actionEnter_License_Key.setText(QCoreApplication.translate("MainWindow", u"Enter License Key", None)) + self.groupBox_camera.setTitle(QCoreApplication.translate("MainWindow", u"Camera", None)) + self.comboBox.setItemText(0, QCoreApplication.translate("MainWindow", u"640 x 480", None)) + self.comboBox.setItemText(1, QCoreApplication.translate("MainWindow", u"320 x 240", None)) + + self.label_2.setText(QCoreApplication.translate("MainWindow", u"Resolution:", None)) + self.pushButton_open.setText(QCoreApplication.translate("MainWindow", u"Start", None)) + self.pushButton_stop.setText(QCoreApplication.translate("MainWindow", u"Stop", None)) + self.checkBox_autostop.setText(QCoreApplication.translate("MainWindow", u"Auto Stop", None)) + self.checkBox_syncdisplay.setText(QCoreApplication.translate("MainWindow", u"Sync Display", None)) + self.groupBox_template.setTitle(QCoreApplication.translate("MainWindow", u"Template", None)) + self.pushButton_template.setText(QCoreApplication.translate("MainWindow", u"Load Template File", None)) + self.textEdit_template.setPlaceholderText(QCoreApplication.translate("MainWindow", u"Paste template string here", None)) + self.pushButton_export_template.setText(QCoreApplication.translate("MainWindow", u"Export Template File", None)) + self.label.setText("") + self.groupBox_barcode.setTitle(QCoreApplication.translate("MainWindow", u"Barcode Types", None)) + self.groupBox_4.setTitle(QCoreApplication.translate("MainWindow", u"1D", None)) + self.checkBox_code39.setText(QCoreApplication.translate("MainWindow", u"Code 39", None)) + self.checkBox_code93.setText(QCoreApplication.translate("MainWindow", u"Code 93", None)) + self.checkBox_code128.setText(QCoreApplication.translate("MainWindow", u"Code 128", None)) + self.checkBox_codabar.setText(QCoreApplication.translate("MainWindow", u"Codabar", None)) + self.checkBox_itf.setText(QCoreApplication.translate("MainWindow", u"ITF", None)) + self.checkBox_ean13.setText(QCoreApplication.translate("MainWindow", u"EAN 13", None)) + self.checkBox_ean8.setText(QCoreApplication.translate("MainWindow", u"EAN 8", None)) + self.checkBox_upca.setText(QCoreApplication.translate("MainWindow", u"UPC A", None)) + self.checkBox_upce.setText(QCoreApplication.translate("MainWindow", u"UPC E", None)) + self.checkBox_industrial25.setText(QCoreApplication.translate("MainWindow", u"Industrial_25", None)) + self.groupBox_5.setTitle(QCoreApplication.translate("MainWindow", u"2D", None)) + self.checkBox_qrcode.setText(QCoreApplication.translate("MainWindow", u"QR Code", None)) + self.checkBox_pdf417.setText(QCoreApplication.translate("MainWindow", u"PDF417", None)) + self.checkBox_aztec.setText(QCoreApplication.translate("MainWindow", u"Aztec", None)) + self.checkBox_postalcode.setText(QCoreApplication.translate("MainWindow", u"Postal Code", None)) + self.checkBox_maxicode.setText(QCoreApplication.translate("MainWindow", u"Maxi Code", None)) + self.checkBox_dotcode.setText(QCoreApplication.translate("MainWindow", u"DotCode", None)) + self.checkBox_patchcode.setText(QCoreApplication.translate("MainWindow", u"Patch Code", None)) + self.checkBox_datamatrix.setText(QCoreApplication.translate("MainWindow", u"DataMatrix", None)) + self.checkBox_gs1.setText(QCoreApplication.translate("MainWindow", u"GS1 Composite", None)) + self.textEdit_results.setDocumentTitle("") + self.menuAbout.setTitle(QCoreApplication.translate("MainWindow", u"File", None)) + self.menuHelp.setTitle(QCoreApplication.translate("MainWindow", u"Help", None)) + # retranslateUi + diff --git a/examples/official/9.x/qt_gui/design.ui b/examples/official/9.x/qt_gui/design.ui new file mode 100644 index 0000000..b0d2313 --- /dev/null +++ b/examples/official/9.x/qt_gui/design.ui @@ -0,0 +1,679 @@ + + + MainWindow + + + + 0 + 0 + 1600 + 848 + + + + + 0 + 0 + + + + + 1600 + 848 + + + + + 16777215 + 16777215 + + + + Dynamsoft Barcode Reader + + + Dynamsoft Barcode Reader + + + QTabWidget::Rounded + + + + + 0 + 0 + + + + + + + + 0 + 0 + + + + + 450 + 150 + + + + Camera + + + + + 180 + 50 + 101 + 31 + + + + + 640 x 480 + + + + + 320 x 240 + + + + + + + 90 + 50 + 131 + 31 + + + + + 10 + + + + Resolution: + + + + + + 90 + 90 + 93 + 28 + + + + Start + + + + + + 190 + 90 + 93 + 28 + + + + Stop + + + + + + 90 + 20 + 101 + 20 + + + + Auto Stop + + + + + + 210 + 20 + 121 + 20 + + + + Sync Display + + + + + + + + + 0 + 0 + + + + + 450 + 200 + + + + Template + + + + + 50 + 20 + 141 + 28 + + + + Load Template File + + + + + + 10 + 60 + 381 + 121 + + + + Paste template string here + + + + + + 220 + 20 + 141 + 28 + + + + Export Template File + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + + 800 + 800 + + + + + 16777215 + 16777215 + + + + true + + + + + + + + + + + 0 + 0 + + + + + 450 + 220 + + + + Barcode Types + + + + + 10 + 20 + 431 + 111 + + + + 1D + + + + + 50 + 20 + 81 + 20 + + + + Code 39 + + + true + + + + + + 130 + 20 + 81 + 20 + + + + Code 93 + + + true + + + + + + 210 + 20 + 81 + 20 + + + + Code 128 + + + true + + + + + + 300 + 20 + 81 + 20 + + + + Codabar + + + true + + + + + + 50 + 50 + 81 + 20 + + + + ITF + + + true + + + + + + 130 + 50 + 81 + 20 + + + + EAN 13 + + + true + + + + + + 210 + 50 + 81 + 20 + + + + EAN 8 + + + true + + + + + + 300 + 50 + 81 + 20 + + + + UPC A + + + true + + + + + + 50 + 80 + 81 + 20 + + + + UPC E + + + true + + + + + + 130 + 80 + 101 + 20 + + + + Industrial_25 + + + true + + + + + + + 9 + 139 + 431 + 71 + + + + 2D + + + + + 50 + 10 + 81 + 20 + + + + QR Code + + + true + + + + + + 140 + 10 + 81 + 20 + + + + PDF417 + + + true + + + + + + 220 + 10 + 81 + 20 + + + + Aztec + + + true + + + + + + 320 + 10 + 91 + 20 + + + + Postal Code + + + true + + + + + + 50 + 40 + 81 + 20 + + + + Maxi Code + + + true + + + + + + 140 + 40 + 81 + 20 + + + + DotCode + + + true + + + + + + 220 + 40 + 91 + 20 + + + + Patch Code + + + true + + + + + + 320 + 40 + 91 + 20 + + + + DataMatrix + + + true + + + + + + 50 + 70 + 121 + 20 + + + + GS1 Composite + + + true + + + + + + + + + + 0 + 0 + + + + + 450 + 200 + + + + + + + + + + + + + 0 + 0 + 1600 + 26 + + + + + File + + + + + + + + Help + + + + + + + + + + + About + + + + + Open File... + + + + + Open Folder... + + + + + Save Template + + + + + Enter License Key + + + + + + diff --git a/examples/official/9.x/qt_gui/screenshots/advanced-demo.png b/examples/official/9.x/qt_gui/screenshots/advanced-demo.png new file mode 100644 index 0000000..922c8fc Binary files /dev/null and b/examples/official/9.x/qt_gui/screenshots/advanced-demo.png differ diff --git a/examples/official/9.x/qt_gui/screenshots/simple-demo.png b/examples/official/9.x/qt_gui/screenshots/simple-demo.png new file mode 100644 index 0000000..cb69653 Binary files /dev/null and b/examples/official/9.x/qt_gui/screenshots/simple-demo.png differ diff --git a/examples/official/9.x/qt_gui/template.json b/examples/official/9.x/qt_gui/template.json new file mode 100644 index 0000000..3843220 --- /dev/null +++ b/examples/official/9.x/qt_gui/template.json @@ -0,0 +1 @@ +{"ImageParameter" : { "BarcodeFormatIds" : [ "BF_ALL" ], "DeblurLevel" : 9, "Description" : "", "ExpectedBarcodesCount" : 0, "MaxAlgorithmThreadCount" : 4, "Name" : "IP_1", "Timeout" : 10000}, "Version" : "3.0"} \ No newline at end of file