Город МОСКОВСКИЙ
00:17:50

Java code to Generate QR Code and Read QR Code using Camera

Аватар
Языки программирования: от простого к сложному
Просмотры:
24
Дата загрузки:
05.12.2023 15:37
Длительность:
00:17:50
Категория:
Разное

Описание

#sirjoecabztv #tips #earnmoney #financialliteracy #java #netbeans #mysql #tutorial #qrcode

Libraries: https://drive.google.com/drive/folders/1KUYC4xOPRPO10aq73ngFoTpJQwfK8yKV?usp=share_link

Method:
public void generateQRcode(String data, String path, String charset, Map map, int h, int w) throws WriterException, IOException {

BitMatrix matrix = new MultiFormatWriter().encode(new String(data.getBytes(charset), charset), BarcodeFormat.QR_CODE, w, h);
MatrixToImageWriter.writeToFile(matrix, path.substring(path.lastIndexOf('.') + 1), new File(path));
}
-----------------------------------------------------------------------------------------
CAMERA CODE
Webcam webcam = Webcam.getDefault(); //Generate Webcam Object
webcam.setViewSize(new Dimension(320,240));
WebcamPanel webcamPanel = new WebcamPanel(webcam);
webcamPanel.setMirrored(false);
JFrame jFrame = new JFrame();
jFrame.add(webcamPanel);
jFrame.pack();
jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jFrame.setLocationRelativeTo(null);
jFrame.setVisible(true);

do{
try {
BufferedImage image = webcam.getImage();
LuminanceSource source = new BufferedImageLuminanceSource(image);
BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
Result result = new MultiFormatReader().decode(bitmap);
if(result.getText() != null){
JOptionPane.showMessageDialog(null, result.getText(), "INFORMATION", JOptionPane.INFORMATION_MESSAGE);
jFrame.setVisible(false);
jFrame.dispose();
webcam.close();
break;
}

} catch (Exception e) {
}
}while(true);

Java Introductory Programming Tutorial
1. Programming Tutorial 1 - Introduction to Java, Netbeans IDE, and Hello World #java https://youtu.be/hYHwbTCzLq0
2. Java Programming Tutorial 2 - Java Variable https://youtu.be/k37j_1RYTnQ
3. Java Programming Tutorial 3 - 8 Primitive Data Types https://youtu.be/20T1FUfZFmE
4. Java Programming Tutorial 4 - Java Type Casting https://youtu.be/oaPC2L41Ckk
5. Java Programming Tutorial 5 - Java Operators https://youtu.be/blUjEyLOC_0
6. Java Programming Tutorial 6 - Java String https://youtu.be/UdrvLQ5sCSQ
7. Java Programming Tutorial 7 - Java Math https://youtu.be/KthvTf8omaQ
8. Java Programming Tutorial 8 - Java Boolean https://youtu.be/8e8Zkdgeozk
9. Java Programming Tutorial 9 - Java If, if else, and if else if statement https://youtu.be/6rD3Ev7dUdA
10. Java Programming Tutorial 10 - Java Switch statement https://youtu.be/qFUH5zHKbuA
11. Java Programming Tutorial 11 - Java while and do-while looping structures https://youtu.be/ZUAegOXuKaU
12. Java Programming Tutorial 12 - Java For and For-each looping structures https://youtu.be/FirSaRwP-TI
13. Java Programming Tutorial 13 - Java Break and continue https://youtu.be/0mmjvlAa2Po
14. Java Programming Tutorial 14 - Java Arrays https://youtu.be/Jcb0UT0fGfY
#java #1best #programming #netbeans #mysql #tips #computertips #education
#financialliteracy #colfinancial #investagrams #invest #practicaltips ======================================================
DISCLAIMER:
The information contained on this YouTube Channel and the resources available for download/viewing through this YouTube Channel is for educational and informational purposes only. I can not guarantee that you will make money, I am just showing you different websites and methods that have the potential of making money. Any link in the description is likely an affiliate link, meaning that if you sign up or make a purchase, I will get a commission. It helps support this YouTube channel and all future content. Thank You.

Рекомендуемые видео