예제 #1
0
        public static void ReadThumbnail()
        {
            // Small or 'Thumbnail' barcode images are automatically detected by IronBarCode and corrected for wherever possible even if they have much digital noise.
            BarcodeResult SmallResult = BarcodeReader.QuicklyReadOneBarcode("ThumbnailOfBarcode.gif", BarcodeEncoding.All);

            Console.WriteLine(SmallResult.Value + " barcode thumbnail found ");
        }
예제 #2
0
        private void btnBrowseBarCode_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.InitialDirectory = "E:\\an3facsem2\\pdpf2\\FireCaffe\\FireCaffe\\bin\\Debug";
            dlg.Filter           = "Image files (*.jpeg)|*.jpeg|All Files (*.*)|*.*";
            dlg.RestoreDirectory = true;

            if (dlg.ShowDialog() == true)
            {
                string      selectedFileName = dlg.FileName;
                BitmapImage bitmap           = new BitmapImage();
                bitmap.BeginInit();
                bitmap.UriSource = new Uri(selectedFileName);
                bitmap.EndInit();
                userBarCode.Source = bitmap;
                BarcodeResult FormatsResult = BarcodeReader.QuicklyReadOneBarcode("barcode.jpeg", BarcodeEncoding.Code128);
                string        result        = FormatsResult.Text;

                ClientServices clientServices = new ClientServices();
                List <Client>  scannedClient  = clientServices.GetClientByPassword(result);
                scannedClient[0].SilverCups += 2;
                if (scannedClient[0].SilverCups >= num)
                {
                    scannedClient[0].GoldenCups += 1;
                    scannedClient[0].SilverCups  = scannedClient[0].SilverCups % 10;
                }

                clientServices.Update(scannedClient[0]);
                MessageBox.Show("User: "******" has received 2 SilverCups");
            }
        }
        public static void TryHarder()
        {
            BarcodeResult Result = BarcodeReader.QuicklyReadOneBarcode("TryHarderQR.png", BarcodeEncoding.QRCode | BarcodeEncoding.Code128, true);

            if (Result != null && Result.Text == "https://ironsoftware.com/csharp/barcode/")
            {
                Console.WriteLine("TryHarder was a success.  Read Value: " + Result.Text);
            }
        }
예제 #4
0
        public static void GetStarted()
        {
            BarcodeResult Result = BarcodeReader.QuicklyReadOneBarcode("GetStarted.png");

            if (Result != null && Result.Text == "https://ironsoftware.com/csharp/barcode/")
            {
                Console.WriteLine("GetStarted was a success.  Read Value: " + Result.Text);
            }
        }
예제 #5
0
        private void prs_barcode_btn_Click(object sender, EventArgs e)
        {
            BarcodeResult Result = BarcodeReader.QuicklyReadOneBarcode("GetStarted.png");

            if (Result != null && Result.Text == "https://ironsoftware.com/csharp/barcode/")
            {
                MessageBox.Show("vahid", "vahid");
            }
        }
예제 #6
0
        private string AnalaysQRCode(string Path)
        {
            BarcodeResult ItemId = BarcodeReader.QuicklyReadOneBarcode(Path, BarcodeEncoding.QRCode);

            if (ItemId != null)
            {
                return(ItemId.Text);
            }
            return(null);
        }
예제 #7
0
        public string BarkodOku(string sFileName)
        {
            BarcodeResult Result = BarcodeReader.QuicklyReadOneBarcode(sFileName);

            if (Result != null)
            {
                ViewBag.Barkod = Result.ToString();
                return(Result.ToString());
            }
            else
            {
                ViewBag.Barkod = "okunmadı";
                return("Okunamadı.");
            }
        }
        public Barcode ReadBarcode(string imagePath)
        {
            var barcode = BarcodeReader.QuicklyReadOneBarcode(imagePath);

            if (barcode != null)
            {
                return new Barcode {
                           BarcodeValue = barcode.Value, BarcodeType = barcode.BarcodeType
                }
            }
            ;
            else
            {
                return(null);
            }
        }
예제 #9
0
        static void Main(string[] args)
        {
            /******     WRITE     *******/
            // Create A Barcode in 1 Line of Code
            //BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeWriterEncoding.QRCode).SaveAsJpeg("D:\\svg\\QuickStart.jpg");
            /******    READ    *******/
            // Read A Barcode in 1 Line of Code.  Gets Text, Numeric Codes, Binary Data and an Image of the barcode
            BarcodeResult Result = BarcodeReader.QuicklyReadOneBarcode("D:\\svg\\BARCODE.jpg");

            // Assert that IronBarCode Works :-)
            if (Result != null)
            {
                System.Console.WriteLine(Result.Text);
            }
            Console.Read();
        }
        public override Barcode Decode()
        {
            var  t      = ConfigurationManager.AppSettings["IronBarCode.LicenseKey"];
            bool result = IronBarCode.License.IsLicensed;

            BarcodeResult QRResult = BarcodeReader.QuicklyReadOneBarcode(file);

            // Work with the results
            if (QRResult != null)
            {
                string          value       = QRResult.Value;
                Bitmap          Img         = QRResult.BarcodeImage;
                BarcodeEncoding BarcodeType = QRResult.BarcodeType;

                return(new Barcode(value, Img));
            }

            return(null);
        }
예제 #11
0
        private void selectButton_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog openFileDialog = new OpenFileDialog()
            {
                Filter = "JPG|*.jpg|PNG|*.png"
            })
            {
                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    pictureBox1.Image    = Image.FromFile(openFileDialog.FileName);
                    pictureBox1.SizeMode = PictureBoxSizeMode.AutoSize;
                    BarcodeResult result = BarcodeReader.QuicklyReadOneBarcode(pictureBox1.Image, BarcodeEncoding.QRCode | BarcodeEncoding.Code128, true);

                    if (result != null)
                    {
                        barCodeTxtBox.Text = result.ToString();
                    }
                }
            }
        }
예제 #12
0
        public static void Example4()
        {
            // Reading and Writing Binary Data

            // using System.Linq;

            //Create Some Binary Data - This example equally well for Byte[] and System.IO.Stream
            byte[] BinaryData = System.Text.Encoding.UTF8.GetBytes("https://ironsoftware.com/csharp/barcode/");

            //WRITE QR with Binary Content
            QRCodeWriter.CreateQrCode(BinaryData, 500).SaveAsImage("MyBinaryQR.png");

            //READ QR with Binary Content
            var MyReturnedData = BarcodeReader.QuicklyReadOneBarcode("MyBinaryQR.png");

            if (BinaryData.SequenceEqual(MyReturnedData.BinaryValue))
            {
                Console.WriteLine("\t Binary Data Read and Written Perfectly");
            }
            else
            {
                throw new Exception("Corrupted Data");
            }
        }
예제 #13
0
        static void Main(string[] args)
        {
            Console.WriteLine("*** BARCODE READER ***");

            string path = Environment.CurrentDirectory;

            string barcodeName, barcodeContent;

            Dictionary <int, string> menu = new();

            menu.Add(1, "Barkod Oluştur");
            menu.Add(2, "Barkodu Göster");

APoint:
            foreach (var item in menu)
            {
                Console.WriteLine("{0} - {1}", item.Key, item.Value);
            }

            byte code = 0;

            byte.TryParse(Console.ReadLine(), out code);

            switch (code)
            {
            case 1:
                Console.WriteLine("Barkodun adını giriniz: ");
                barcodeName = Console.ReadLine();

                Console.WriteLine("Barkodun içeriğini giriniz: ");
                barcodeContent = Console.ReadLine();

                BarcodeWriter.CreateBarcode(barcodeContent, BarcodeWriterEncoding.QRCode).SaveAsJpeg($"{path}\\{barcodeName}.jpg");

                Console.WriteLine("Barkod başarıyla oluşturuldu.");

                Process.Start("mspaint.exe", $"{path}\\{barcodeName}.jpg");
                goto APoint;

            case 2:
                Console.WriteLine("Barkodun adını giriniz: ");
                barcodeName = Console.ReadLine();

                BarcodeResult barcodeResult = BarcodeReader.QuicklyReadOneBarcode($"{path}\\{barcodeName}.jpg");

                if (barcodeResult != null)
                {
                    Process.Start("mspaint.exe", $"{path}\\{barcodeName}.jpg");
                    Console.WriteLine($"Barkodun içeriği: {barcodeResult.Text}");
                    goto APoint;
                }
                else
                {
                    Console.WriteLine("Barkod bulunamadı!");
                    goto APoint;
                }

            default:
                Console.WriteLine("Geçersiz giriş!");
                goto APoint;
            }
        }