//生成二维码 private void CreateQR_Click(object sender, RoutedEventArgs e) { if (txtId.Text != "") { Bitmap bitmap = BarcodeHelper.CreatQR(txtId.Text.ToString(), 70, 70); ImageSource imageSource = BarcodeHelper.loadBitmap(bitmap); img_br.Source = imageSource; } else { labIdMsg.Content = "请输入产品编号!"; txtId.Focus(); return; } }