public class InvertEffect : ShaderEffect Public Class InvertEffectInherits System.Windows.Media.Effects.ShaderEffectImplements System.Windows.Media.Animation.IAnimatable
public ref class InvertEffect : public System.Windows.Media.Effects.ShaderEffect, System.Windows.Media.Animation.IAnimatable This class can also be used to invert the color of a 1-bit image, making the black white and the white black.
using Leadtools;using Leadtools.Codecs;using Leadtools.ImageProcessing;using Leadtools.Windows.Controls;using Leadtools.Windows.Media;using Leadtools.Windows.Media.Effects;class InvertEffectExampleWindow : Window{private ImageViewer theViewer;public InvertEffectExampleWindow(){StackPanel sp = new StackPanel();Content = sp;theViewer = new ImageViewer();theViewer.HorizontalAlignment = HorizontalAlignment.Center;theViewer.VerticalAlignment = VerticalAlignment.Top;theViewer.ImageHorizontalAlignment = HorizontalAlignment.Left;theViewer.ImageVerticalAlignment = VerticalAlignment.Top;sp.Children.Add(theViewer);// Load an image into the viewertheViewer.Source = new BitmapImage(new Uri(System.IO.Path.Combine(LEAD_VARS.ImagesDir, "Cannon.jpg")));Title = "Double click to use the Effect";theViewer.MouseDoubleClick += new MouseButtonEventHandler(theViewer_MouseDoubleClick);}private void theViewer_MouseDoubleClick(object sender, MouseButtonEventArgs e){InvertEffect effect = new InvertEffect();theViewer.ImageEffect = effect;Title = "Using InvertEffect";}}static class LEAD_VARS{public const string ImagesDir = @"C:\LEADTOOLS21\Resources\Images";}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.ImageProcessingImports Leadtools.Windows.ControlsImports Leadtools.Windows.MediaImports Leadtools.Windows.Media.EffectsClass InvertEffectExampleWindowInherits WindowPrivate theViewer As ImageViewerPublic Sub New()Dim sp As New StackPanel()Content = sptheViewer = New ImageViewer()theViewer.HorizontalAlignment = HorizontalAlignment.CentertheViewer.VerticalAlignment = VerticalAlignment.ToptheViewer.ImageHorizontalAlignment = HorizontalAlignment.LefttheViewer.ImageVerticalAlignment = VerticalAlignment.Topsp.Children.Add(theViewer)' Load an image into the viewertheViewer.Source = New BitmapImage(New Uri(System.IO.Path.Combine(LEAD_VARS.ImagesDir, "Cannon.jpg")))Title = "Double click to use the Effect"AddHandler theViewer.MouseDoubleClick, AddressOf theViewer_MouseDoubleClickEnd SubPrivate Sub theViewer_MouseDoubleClick(ByVal sender As Object, ByVal e As MouseButtonEventArgs)Dim effect As New InvertEffect()theViewer.ImageEffect = effectTitle = "Using InvertEffect"End SubEnd ClassPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\LEADTOOLS21\Resources\Images"End Class
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
