void OnError(string err) { if (QRCodeManager.onErrorInvoker != null) { QRCodeManager.onErrorInvoker(err); } }
private void btn_GenerateQR_Click(object sender, EventArgs e) { this.SafeExecuteAction(() => { if (!Directory.Exists(Settings.Default.QrCodeLocation)) { MyMessageBox.ShowDialog(this, $"QR location does not exist: {Settings.Default.QrCodeLocation}. Check config.", "Robo", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { DirectoryInfo directoryInfo = new DirectoryInfo(Settings.Default.QrCodeLocation); foreach (FileInfo file in directoryInfo.GetFiles("*.jpg")) { file.Delete(); } List <Tables> tables = presenter.GetAll(); List <string> tablesCodes = new List <string>(); foreach (Tables table in tables) { tablesCodes.Add(table.Token); } string resultGenerateQR = QRCodeManager.GenerateQR(Settings.Default.QrCodeLocation, this.lbl_IPValue.Text, Settings.Default.Protocol, tablesCodes); MyMessageBox.ShowDialog(this, resultGenerateQR, "Robo", MessageBoxButtons.OK, MessageBoxIcon.Information); Process.Start(Settings.Default.QrCodeLocation); } }); }
// Start is called before the first frame update void Start() { cameraTexture = new Texture2D(appCam.pixelWidth, appCam.pixelHeight); this.qrManager = new QRCodeManager(); }
// Start is called before the first frame update void Start() { WebCamDevice[] devices = WebCamTexture.devices; webcamTex = new WebCamTexture(devices[0].name, width1, height1, fPS); webcamTex.Play(); this.qrManager2 = new QRCodeManager(); }
public static void SaveQRCodeToGallery(Texture2D qrCode) { string path; byte[] bytes = qrCode.EncodeToJPG(); // Call plugin only when running on real device if (Application.platform == RuntimePlatform.Android) { #if UNITY_ANDROID RefreshGalleryWrapper galleryWrapper = GameObject.FindObjectOfType <RefreshGalleryWrapper>(); if (galleryWrapper != null) { // check for permission if (!galleryWrapper.CheckPermissions()) { galleryWrapper.StoragePermissionRequest(); return; } path = galleryWrapper.GalleryPath; if (!string.IsNullOrEmpty(path)) { path = System.IO.Path.Combine(path, "QRCode_" + System.DateTime.Now.ToFileTime() + ".jpg"); try{ System.IO.File.WriteAllBytes(path, bytes); Debug.Log("Saved : " + path); } catch (System.Exception ex) { if (QRCodeManager.onErrorInvoker != null) { QRCodeManager.onErrorInvoker(ex.Message); } } galleryWrapper.RefreshGallery(path); } else { if (QRCodeManager.onErrorInvoker != null) { QRCodeManager.onErrorInvoker("Gallery path not found. Please check RefreshGalleryWrapper script attached to any gameobject and SDCard write permission in player settings."); galleryWrapper.StoragePermissionRequest(); } } } #endif } else if (Application.platform == RuntimePlatform.WindowsPlayer || Application.platform == RuntimePlatform.OSXPlayer || Application.platform == RuntimePlatform.LinuxPlayer || Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.WindowsEditor) { //save to pictures path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyPictures); path = System.IO.Path.Combine(path, "QRCode_" + System.DateTime.Now.ToFileTime() + ".jpg"); try{ System.IO.File.WriteAllBytes(path, bytes); Debug.Log("Saved : " + path); } catch (System.Exception ex) { if (QRCodeManager.onErrorInvoker != null) { QRCodeManager.onErrorInvoker(ex.Message); } } } }
public CafeTableBusiness(IUnitOfWork uow, QRCodeManager qRCodeManager, ZipManager zipManager) { _uow = uow; _qRCodeManager = qRCodeManager; _zipManager = zipManager; }
private void MainForm_Load(object sender, EventArgs e) { LabelAddress.Text = WalletData.Keydata.publicAddress; QRReceive.Image = QRCodeManager.CreateQR(LabelAddress.Text, 3); //Create QR based on wallet, later to be handled in the core classes }