Inverts the colors in the specified image, giving it the appearance of a photographic negative.
public class InvertEffect : System.Windows.Media.Effects.ShaderEffect, System.Windows.Media.Animation.IAnimatablePublic 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.IAnimatableThis class can also be used to invert the color of a 1-bit image, making the black white and the white black.
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:\Users\Public\Documents\LEADTOOLS Images"End Class
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:\Users\Public\Documents\LEADTOOLS Images";}
using Leadtools;using Leadtools.Codecs;using Leadtools.ImageProcessing;using Leadtools.Windows.Media;using Leadtools.Windows.Media.Effects;using Leadtools.Windows.Controls;class InvertEffectExampleWindow : UserControl{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(LeadtoolsExamples.Common.ImagesPath.Path + "Cannon.jpg"));//theViewer.MouseDoubleClick += new MouseButtonEventHandler(theViewer_MouseDoubleClick);}private void theViewer_MouseDoubleClick(object sender, MouseButtonEventArgs e){InvertEffect effect = new InvertEffect();theViewer.ImageEffect = effect;}}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.ImageProcessingImports Leadtools.Windows.ControlsImports Leadtools.Windows.MediaImports Leadtools.Windows.Media.EffectsClass InvertEffectExampleWindowInherits UserControlPrivate 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(LeadtoolsExamples.Common.ImagesPath.Path + "Cannon.jpg"))End SubPrivate Sub theViewer_MouseDoubleClick(ByVal sender As Object, ByVal e As MouseButtonEventArgs)Dim effect As New InvertEffect()theViewer.ImageEffect = effectEnd SubEnd Class
<Window x:Class="InvertEffectExample"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:leadControls="clr-namespace:Leadtools.Windows.Controls;assembly=Leadtools.Windows.Controls"xmlns:leadEffects="clr-namespace:Leadtools.Windows.Media.Effects;assembly=Leadtools.Windows.Media.Effects"Height="600" Width="800"><StackPanel><leadControls:ImageViewerHorizontalAlignment="Center" VerticalAlignment="Top"ImageHorizontalAlignment="Left" ImageVerticalAlignment="Top"Source="file:///c:\users\Public\Documents\LEADTOOLS Images\cannon.jpg"><leadControls:ImageViewer.ImageEffect><leadEffects:InvertEffect/></leadControls:ImageViewer.ImageEffect></leadControls:ImageViewer></StackPanel></Window>
|
Products |
Support |
Feedback: InvertEffect Class - Leadtools.Windows.Media.Effects |
Introduction |
Help Version 19.0.2017.3.21
|

Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.