Ejemplo n.º 1
0
 private void Brightness_Click(object sender, RoutedEventArgs e)
 {
     newbitmap?.Dispose();
     newbitmap = ImageHandleHelp.Brightness(bitmap);
     if (newbitmap != null)
     {
         ImageTarget.Source = ChangeBitmapToImageSource(newbitmap);
     }
 }
Ejemplo n.º 2
0
 private void De_Color_Click(object sender, RoutedEventArgs e)
 {
     if (bitmap == null)
     {
         return;
     }
     newbitmap?.Dispose();
     newbitmap = ImageHandleHelp.De_Color(bitmap);
     if (newbitmap != null)
     {
         ImageTarget.Source = ChangeBitmapToImageSource(newbitmap);
     }
 }
Ejemplo n.º 3
0
 private void Cut_Click(object sender, RoutedEventArgs e)
 {
     if (bitmap == null)
     {
         return;
     }
     newbitmap?.Dispose();
     System.Drawing.Rectangle rectangle = new System.Drawing.Rectangle(bitmap.Width / 4, bitmap.Height / 4, bitmap.Width / 2, bitmap.Height / 2);
     newbitmap = ImageHandleHelp.CutBitmap(bitmap, rectangle);
     if (newbitmap != null)
     {
         ImageTarget.Source = ChangeBitmapToImageSource(newbitmap);
     }
 }
Ejemplo n.º 4
0
        private void Fill_Click(object sender, RoutedEventArgs e)
        {
            if (bitmap == null)
            {
                return;
            }
            newbitmap?.Dispose();
            if (_openFileDialog.ShowDialog() == true)
            {
                _filepath = _openFileDialog.FileName;
            }
            Bitmap sourceBitmap = new Bitmap(_filepath);

            newbitmap = ImageHandleHelp.FillBitmap(sourceBitmap, bitmap, new System.Drawing.Point(sourceBitmap.Width / 2, 0));
            if (newbitmap != null)
            {
                ImageTarget.Source = ChangeBitmapToImageSource(newbitmap);
            }
            sourceBitmap?.Dispose();
        }