5 وبـــس

  • الرئيسية
    • اخبار العالم
    • حقائق غريبة
    • مواقف وطرائف
    • تنمية بشرية
    • الصحة والحياة
    • تطبيقات الموبايل
    • برامج الكمبيوتر
    • _برامج النظام
    • _برامج الحماية
    • _برامج الميديا
    • _الاوفيس والجرافيك
    • _برامج الانترنت
    • _برامج المحادثة
    • العاب كاملة
    • الابراج

    g

    ديسمبر 31, 2022
    Dاقرء المزيد
    رسائل أحدث الصفحة الرئيسية
    الاشتراك في: التعليقات ( Atom )

    Qr2

    import java.awt.Color; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.util.Hashtable; import javax.imageio.ImageIO; import com.google.zxing.BarcodeFormat; import com.google.zxing.EncodeHintType; import com.google.zxing.WriterException; import com.google.zxing.common.BitMatrix; import com.google.zxing.qrcode.QRCodeWriter; import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; public class QRGenerator { public static void main(String[] args) { int width = 300; int height = 300; String fileType = "png"; File file = new File("qr-code." + fileType); String qrCodeText = "Hello, World!"; String filePath = "C:/Users/user/Desktop/"; try { Hashtable hintMap = new Hashtable(); hintMap.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.L); QRCodeWriter qrCodeWriter = new QRCodeWriter(); BitMatrix byteMatrix = qrCodeWriter.encode(qrCodeText, BarcodeFormat.QR_CODE, width, height, hintMap); int CrunchifyWidth = byteMatrix.getWidth(); BufferedImage image = new BufferedImage(CrunchifyWidth, CrunchifyWidth, BufferedImage.TYPE_INT_RGB); image.createGraphics(); Graphics2D graphics = (Graphics2D) image.getGraphics(); graphics.setColor(Color.WHITE); graphics.fillRect(0, 0, CrunchifyWidth, CrunchifyWidth); graphics.setColor(Color.BLACK); for (int i = 0; i < CrunchifyWidth; i++) { for (int j = 0; j < CrunchifyWidth; j++) { if (byteMatrix.get(i, j)) { graphics.fillRect(i, j, 1, 1); } } } ImageIO.write(image, fileType, file); } catch (WriterException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } System.out.println("\n\nYou have successfully created QR Code."); } }

    Qr

    QR Code Generator

    كن على تواصل معنا

    • 12356متابعين
    • 194067إعجابات
    • 419متابعين

    مشاركات عشوائية

    صفحتنا على فيسبوك

    المشاركات الشائعة

    • g

    التعليقات

    مشاركات عشوائية

    آخر المواضيع

    المشاركات الشائعة

    • g
  • ©جميع الحقوق محفوظة 5 وبـــس | تصميم خالد مصباح