public void On_click_start_img() { Set_data(Converter_Helper.Bytes_to_binary(Converter_Helper.Img_to_byte(img_path)), Cipher_Type.Img); laundry_data.Set_data(Encoding.ASCII.GetString(Converter_Helper.Img_to_byte(img_path))); laundry_data.Set_work_bytes(Converter_Helper.Img_to_byte(img_path)); pick_controller.Ready_up(); Stand_by(); }
public void On_click_start_txt() { Set_data(Converter_Helper.Bytes_to_binary(Converter_Helper.String_to_bytes(Converter_Helper.Txt_to_string(txt_path))), Cipher_Type.Txt); laundry_data.Set_data(Converter_Helper.Txt_to_string(txt_path)); laundry_data.Set_work_bytes(Encoding.Default.GetBytes(Converter_Helper.Txt_to_string(txt_path))); pick_controller.Ready_up(); Stand_by(); }
private void Decryption_end() { title_text.text = Text_Data.Get_decrypted_end_text(); BitArray bits = null; for (int i = 0; i < decrypted.Length; i++) { if (i == 0) { bits = new BitArray(BitConverter.GetBytes(decrypted[i])); } else { bits.Append(new BitArray(BitConverter.GetBytes(decrypted[i]))); } } Set_current(bits, Calculate_sqrt_floor(bits.Length)); Create_img(current_bits, currnet_sqtr_size); left_main.SetActive(false); var bytes = Converter_Helper.Binary_to_byte(current_bits); if (cipher_type == Cipher_Type.Txt) { left_txt.SetActive(true); var txt = dmessage; left_txt_output = txt; left_txt_input_field.text = left_txt_output; } else { left_img.SetActive(true); var img = Converter_Helper.Bytes_to_img(bytes); img.Save(Application.persistentDataPath + "/img.jpeg"); WWW www = new WWW("file:///" + Application.persistentDataPath + "/img.jpeg"); Sprite sprite = Sprite.Create(www.texture, new Rect(0, 0, www.texture.width, www.texture.height), new Vector2(0, 0)); left_img_img.sprite = sprite; } }
public void On_click_left_txt_download_txt() { string path = FileBrowser.SaveFile("Save as txt", string.Empty, "txt_result", "txt"); Converter_Helper.String_to_txt(left_txt_output, path); }
public void On_click_download_img() { string path = FileBrowser.SaveFile("Save as img", string.Empty, "img_result", "jpeg"); Converter_Helper.Bitmap_to_img(bitmap, path); }
public void On_click_download_txt() { string path = FileBrowser.SaveFile("Save as txt", string.Empty, "txt_result", "txt"); Converter_Helper.String_to_txt(Converter_Helper.Bit_to_string(current_bits, currnet_sqtr_size), path); }