private void SaveImageLocal(string imagefilepath) { if (this.State != State.Encrypted) { MessageBox.Show("You cannot save the data if it is in plaintext mode"); return; } byte[] data = ImageStream.GetImageBytes(imagefilepath); CriboStream.SetCriboBytes(data, this.buffer); ImageStream.SetImageBytes(imagefilepath, data); }
private void OpenImageLocal(string imagepath) { byte[] data = ImageStream.GetImageBytes(imagepath); this.buffer = CriboStream.GetCriboBytes(data); BitmapImage image = new BitmapImage(); image.BeginInit(); image.CacheOption = BitmapCacheOption.OnLoad; image.UriSource = new Uri(imagepath); image.EndInit(); this.SelectedImage = image; this.State = State.Encrypted; this.UpdateText(); }