Leadtools.ImageProcessing.Core Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.12.10
ShiftDataCommand Constructor(Int32,Int32,Int32,Int32)
See Also  Example
Leadtools.ImageProcessing.Core Namespace > ShiftDataCommand Class > ShiftDataCommand Constructor : ShiftDataCommand Constructor(Int32,Int32,Int32,Int32)




sourceLowBit
Position of the start bit that will construct the mask. The position is a zero-based number. This parameter only accepts positive values.
sourceHighBit
Position of the end bit. This is inclusive (it is part of the mask). The value should not be less than sourceLowBit. You can also pass -1, which is interpreted as "highest bit" (SourceImage->BitsPerPixel - 1). This parameter only accepts positive values.
destinationLowBit
The bit position where the selected mask will be copied into the destination image. This parameter only accepts positive values.
destinationBitsPerPixel
Bits per pixel for the destination image. The allowed values are 8, 12, or 16.
Initializes a new ShiftDataCommand class object with explicit parameters.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal sourceLowBit As Integer, _
   ByVal sourceHighBit As Integer, _
   ByVal destinationLowBit As Integer, _
   ByVal destinationBitsPerPixel As Integer _
)
Visual Basic (Usage)Copy Code
Dim sourceLowBit As Integer
Dim sourceHighBit As Integer
Dim destinationLowBit As Integer
Dim destinationBitsPerPixel As Integer
 
Dim instance As ShiftDataCommand(sourceLowBit, sourceHighBit, destinationLowBit, destinationBitsPerPixel)
C# 
public ShiftDataCommand( 
   int sourceLowBit,
   int sourceHighBit,
   int destinationLowBit,
   int destinationBitsPerPixel
)
Managed Extensions for C++ 
public: ShiftDataCommand( 
   int sourceLowBit,
   int sourceHighBit,
   int destinationLowBit,
   int destinationBitsPerPixel
)
C++/CLI 
public:
ShiftDataCommand( 
   int sourceLowBit,
   int sourceHighBit,
   int destinationLowBit,
   int destinationBitsPerPixel
)

Parameters

sourceLowBit
Position of the start bit that will construct the mask. The position is a zero-based number. This parameter only accepts positive values.
sourceHighBit
Position of the end bit. This is inclusive (it is part of the mask). The value should not be less than sourceLowBit. You can also pass -1, which is interpreted as "highest bit" (SourceImage->BitsPerPixel - 1). This parameter only accepts positive values.
destinationLowBit
The bit position where the selected mask will be copied into the destination image. This parameter only accepts positive values.
destinationBitsPerPixel
Bits per pixel for the destination image. The allowed values are 8, 12, or 16.

Example

Visual BasicCopy Code
ImageProcessing.Core.ShiftDataCommand.ShiftDataConstructor
   Public Sub ShiftDataConstructorExample()
      RasterCodecs.Startup()
      Dim codecs As New RasterCodecs()
      codecs.ThrowExceptionsOnInvalidImages = True

      Dim leadImage As RasterImage = codecs.Load("C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Beauty16.jpg")

      ' Prepare the command
      Dim command As ShiftDataCommand = New ShiftDataCommand(2, 6, 3, 8)
      ' Move 5 bits starting from bit 2 into the high bits of the affected image.
      command.Run(leadImage)
      codecs.Save(command.DestinationImage, "C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\ShiftDataResult.Bmp", RasterImageFormat.Bmp, 24)

      RasterCodecs.Shutdown()
   End Sub
C#Copy Code
ImageProcessing.Core.ShiftDataCommand.ShiftDataConstructor 
      public void ShiftDataConstructorExample() 
      { 
         // Load an image 
         RasterCodecs.Startup(); 
         RasterCodecs codecs = new RasterCodecs(); 
         codecs.ThrowExceptionsOnInvalidImages = true; 
 
         RasterImage image = codecs.Load(@"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Beauty16.jpg"); 
 
         // Prepare the command 
         ShiftDataCommand command = new ShiftDataCommand(2, 6, 3, 8); 
         // Move 5 bits starting from bit 2 into the high bits of the affected image. 
         command.Run(image); 
         codecs.Save(command.DestinationImage, @"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\ShiftDataResult.bmp", RasterImageFormat.Bmp, 24); 
 
         RasterCodecs.Shutdown(); 
      }

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