Leadtools.Windows.Media.Effects Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.8.31
GrayScaleToDuotoneCommandBitmapEffect Class
See Also  Members  
Leadtools.Windows.Media.Effects.Color Namespace : GrayScaleToDuotoneCommandBitmapEffect Class




Converts the grayscale image into a colored one by mixing or replacing the original values of the pixels with new colors. This class is available in the Raster Pro and above toolkits.

Syntax

Visual Basic (Declaration) 
Public Class GrayScaleToDuotoneCommandBitmapEffect 
   Inherits RasterCommandBitmapEffect
Visual Basic (Usage)Copy Code
Dim instance As GrayScaleToDuotoneCommandBitmapEffect
C# 
public class GrayScaleToDuotoneCommandBitmapEffect : RasterCommandBitmapEffect 
Managed Extensions for C++ 
public __gc class GrayScaleToDuotoneCommandBitmapEffect : public RasterCommandBitmapEffect 
C++/CLI 
public ref class GrayScaleToDuotoneCommandBitmapEffect : public RasterCommandBitmapEffect 

Example

Run the GrayScaleToDuotoneCommandBitmapEffect on an image.

Remarks

  • This class was designed for use with grayscale images. If the image being used is not grayscale, this method only affects those pixels or areas of the image where Red = Green = Blue.
  • This class transforms the 8-bit grayscale images into colored 8-bit images (Palette) meanwhile the 12-bit and 16-bit grayscale images are transformed into a 48-bit colored image.
  • Monotone conversion is possible by setting GrayScaleToDuotoneCommandBitmapEffectsMixingType to ReplaceOldWithNew, which clears the palette.
  • This method gives you the option of having the toolkit generate the array of colors to use or creating the array of colors to use yourself.
  • To have the toolkit generate the array of colors, pass the color to use for generating the array of gradient colors in the Color property.
    • If the image is grayscale (not binary) the GrayScaleToDuotoneCommandBitmapEffect will use the color set in the Color property and generate a 256 color gradient in NewColor.
    • If the image is not grayscale (it is color) then the GrayScaleToDuotoneCommandBitmapEffect will use the color set in the Color property and generate a 256 color gradient in NewColor. These colors will be used to change only those pixels in the color image for which Red = Green = Blue.
  • To use a user-defined array of colors:
    • If the image is binary, call GrayScaleToDuotoneCommandBitmapEffect with the two colors you wish to use in the NewColor property.
    • If the image is grayscale (not binary) call GrayScaleToDuotoneCommandBitmapEffect with the 256 colors you wish to use in the NewColor property.
    • If the image is not grayscale (it is color) call GrayScaleToDuotoneCommandBitmapEffect with the 256 colors you wish to use in the NewColor property. These colors will be used to change only those pixels in the color image for which Red = Green = Blue.
  • This class supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.
  • This class does not support signed data images.
  • This command does not support 32-bit grayscale images.

Inheritance Hierarchy

System.Object
   System.Windows.Threading.DispatcherObject
      System.Windows.DependencyObject
         System.Windows.Freezable
            System.Windows.Media.Animation.Animatable
               System.Windows.Media.Effects.BitmapEffect
                  Leadtools.Windows.Media.Effects.RasterCommandBitmapEffect
                     Leadtools.Windows.Media.Effects.Color.GrayScaleToDuotoneCommandBitmapEffect

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also