Ejemplo n.º 1
0
        private void btRotate_Right_Click(object sender, RoutedEventArgs e)
        {
            mainImage = new RotateImage(mainImage, RotateFlipType.Rotate90FlipNone);
            Bitmap dd = mainImage.ApplyEffect();

            imgDisplayImage.Source = ImageOperations.Bitmap2ImageSource(dd);
        }
Ejemplo n.º 2
0
        private void blackAndWhite_Button_Click(object sender, RoutedEventArgs e)
        {
            mainImage = new BlackWhiteImage(mainImage);
            Bitmap dd = mainImage.ApplyEffect();

            imgDisplayImage.Source = ImageOperations.Bitmap2ImageSource(dd);
        }
Ejemplo n.º 3
0
        public static Bitmap ControlerImage2Bitmap(IimageEffects image)
        {
            Bitmap bmp;

            //you should not close the stream because the bitmap will use it;
            MemoryStream ms = new MemoryStream();

            BitmapEncoder be = image.GetEncoder();

            be.Frames.Add(BitmapFrame.Create((BitmapSource)image.controlerImage.Source));
            be.Save(ms);

            bmp = new Bitmap(ms);

            return(bmp);
        }
Ejemplo n.º 4
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            openFile.FileName = string.Empty;
            Nullable <bool> result = openFile.ShowDialog();

            if (result == true)
            {
                mainImage       = new MainImage(imgDisplayImage, openFile.FileName);
                imgDisplayImage = mainImage.controlerImage;
                tbFileName.Text = openFile.SafeFileName;

                btnSave.IsEnabled = true;
                blackAndWhite_Button.IsEnabled = true;
                btRotate_Left.IsEnabled        = true;
                btRotate_Right.IsEnabled       = true;
            }
        }
Ejemplo n.º 5
0
 public ImageDecorator(IimageEffects image)
 {
     wrapedImage = image;
 }
Ejemplo n.º 6
0
 public RotateImage(IimageEffects image, RotateFlipType flipType) : base(image)
 {
     this.flipType = flipType;
 }
Ejemplo n.º 7
0
 public BlackWhiteImage(IimageEffects image) : base(image)
 {
 }