Пример #1
0
        public void Set_and_check_watermark()
        {
            var bitmap = new Bitmap(50, 50);

            LSB.SetWatermark(bitmap);
            Assert.True(LSB.CheckWatermark(bitmap));
        }
Пример #2
0
        private void OpenFileButton_Click(object sender, RoutedEventArgs e)
        {
            var openFileDialog = new OpenFileDialog
            {
                CheckFileExists = true,
                CheckPathExists = true,
                Filter          = FileFilter
            };

            if (openFileDialog.ShowDialog() == true)
            {
                bitmap           = (Bitmap)Image.FromFile(openFileDialog.FileName);
                MainImage.Source = new BitmapImage(new Uri(openFileDialog.FileName));

                WatermarkLabel.Text = LSB.CheckWatermark(bitmap)
                    ? "✔ Image may has encrypted text"
                    : "❌ Image has no encrypted text";

                EncryptButton.IsEnabled = true;
                DecryptButton.IsEnabled = true;
                SaveButton.IsEnabled    = false;
            }
        }