Exemplo n.º 1
0
        private void Escanear_RegistroQR_Click(object sender, RoutedEventArgs e)
        {
            host.Child = null;
            QrEncoder qrEncoder = new QrEncoder(ErrorCorrectionLevel.H);
            QrCode    qrCode    = new QrCode();

            qrEncoder.TryEncode(CodigoQR_RegistroQR.Text, out qrCode);
            GraphicsRenderer renderer = new GraphicsRenderer(new FixedCodeSize(400, QuietZoneModules.Zero), Brushes.DarkBlue, Brushes.White);
            MemoryStream     ms       = new MemoryStream();

            renderer.WriteToStream(qrCode.Matrix, ImageFormat.Png, ms);
            var imageTemp = new Bitmap(ms);
            var image     = new Bitmap(imageTemp, new Size(new Point(400, 400)));

            QRresult_RegistroQR.BackgroundImage       = image;
            QRresult_RegistroQR.BackgroundImageLayout = ImageLayout.Stretch;
            QRresult_RegistroQR.AutoSize = true;

            host.Child = QRresult_RegistroQR;

            Guardar_RegistrosQR.IsEnabled = false;
            CodigoQR_RegistroQR.Clear();
            CodigoQR_RegistroQR.Focus();
        }
Exemplo n.º 2
0
 private void RegistroQR_Panel_Loaded(object sender, RoutedEventArgs e)
 {
     CodigoQR_RegistroQR.Focus();
     CodigoQR_RegistroQR.Text = $"{SharedData.Codin} / {SharedData.Marca} / {SharedData.Modelo} / {SharedData.Serie}";
 }