コード例 #1
0
        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);
        }
コード例 #2
0
        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();
        }