Initializes a new
ShiftDataCommand class object with explicit parameters.
Syntax
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)
|
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 Basic | Copy 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")
Dim command As ShiftDataCommand = New ShiftDataCommand(2, 6, 3, 8)
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