Leadtools Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.3.5
GrayscaleCommand Class
See Also  Members  
Leadtools.ImageProcessing Namespace : GrayscaleCommand Class




Converts a 1-, 4-, 8-, 16-, 24-, or 32-bit image to an 8-bit, 12-bit, or 16-bit grayscale image.

Syntax

Visual Basic (Declaration) 
Public Class GrayscaleCommand 
   Inherits RasterCommand
   Implements IRasterCommand 
Visual Basic (Usage)Copy Code
Dim instance As GrayscaleCommand
C# 
public class GrayscaleCommand : RasterCommand, IRasterCommand  
Managed Extensions for C++ 
public __gc class GrayscaleCommand : public RasterCommand, IRasterCommand  
C++/CLI 
public ref class GrayscaleCommand : public RasterCommand, IRasterCommand  

Example

This example will load a 24-bit image then convert it to a grayscale image with 8, 12 and 16 bits/pixel

Remarks

Support for 12 and 16-bit grayscale images is available only in the Document/Medical Imaging editions.

The resulting image can be an 8-bit, 12-bit, or 16-bit grayscale image. Once the function is complete, the RasterImage.GrayscaleMode property will indicate the type of grayscale image.

When converting to 12-bit or 16-bit grayscale, the RasterImage.GetLookupTable is not used. When converting to 8-bit grayscale, the RasterImage.GetLookupTable is used to get the RGB for each input pixel. The grayscale value corresponding to that RGB triple is used in the destination image.

This method does not support signed images.

For more information, refer to Processing an Image.

For more information, refer to Grayscale Images.

Inheritance Hierarchy

System.Object
   Leadtools.ImageProcessing.RasterCommand
      Leadtools.ImageProcessing.GrayscaleCommand

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