private void Encode(string text) { LSB.Encode(bitmap, text); LSB.SetWatermark(bitmap); MainImage.Source = Convert(bitmap); SaveButton.IsEnabled = true; }
public void Encode_and_decode_text_to_bitmap() { var text = "Some text that i want to pass through"; var bitmap = new Bitmap(50, 50); LSB.Encode(bitmap, text); var decoded = LSB.Decode(bitmap); Assert.AreEqual(text, decoded); }
public void All_together_now() { var text = "Some text that i want to pass through"; var key = Guid.NewGuid(); var bitmap = new Bitmap(50, 50); var encrypted = Crypter.Encrypt(text, key); LSB.Encode(bitmap, encrypted); var decoded = LSB.Decode(bitmap); var decrypted = Crypter.Decrypt(decoded, key); Assert.AreEqual(text, decrypted); }
public virtual void Encode() { var pixels = this.picture.GetPixels32(); var message = this.message + "]|["; LSB.Encode(pixels, System.Text.Encoding.UTF8.GetBytes(message), (code) => { if (code == LSB.Code.Success) { var result = new Texture2D(this.picture.width, this.picture.height); result.SetPixels32(pixels); this.onEncodeEvent.Invoke(result); } }); }