LEADTOOLS Image Processing (Leadtools.ImageProcessing.Core assembly)
LEAD Technologies, Inc

ConvertSignedToUnsignedCommand Constructor(ConvertSignedToUnsignedCommandType)

Example 





Flag that indicates how the shift will be done.
Initializes a new ConvertSignedToUnsignedCommand class object with explicit parameters. .NET support WinRT support Silverlight support
Syntax
public ConvertSignedToUnsignedCommand( 
   ConvertSignedToUnsignedCommandType type
)
'Declaration
 
Public Function New( _
   ByVal type As ConvertSignedToUnsignedCommandType _
)
'Usage
 
Dim type As ConvertSignedToUnsignedCommandType
 
Dim instance As New ConvertSignedToUnsignedCommand(type)
public ConvertSignedToUnsignedCommand( 
   ConvertSignedToUnsignedCommandType type
)
function ConvertSignedToUnsignedCommand( 
   type 
)
public:
ConvertSignedToUnsignedCommand( 
   ConvertSignedToUnsignedCommandType type
)

Parameters

type
Flag that indicates how the shift will be done.
Example
 
Public Sub ConvertSignedToUnsignedConstructorExample()
   Dim codecs As New RasterCodecs()
   codecs.ThrowExceptionsOnInvalidImages = True

   Dim leadImage As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "IMAGE2.dcm"))

   ' Prepare the command
   Dim command As ConvertSignedToUnsignedCommand = New ConvertSignedToUnsignedCommand(ConvertSignedToUnsignedCommandType.ShiftNegativeToZero)
   'convert image to unsigned.
   command.Run(leadImage)

End Sub

Public NotInheritable Class LEAD_VARS
   Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"
End Class
public void ConvertSignedToUnsignedConstructorExample()
   {
      // Load an image
      RasterCodecs codecs = new RasterCodecs();
      codecs.ThrowExceptionsOnInvalidImages = true;

      RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "IMAGE2.dcm"));

      // Prepare the command
      ConvertSignedToUnsignedCommand command = new ConvertSignedToUnsignedCommand(ConvertSignedToUnsignedCommandType.ShiftNegativeToZero);
      // convert image to unsigned.
      command.Run(image);

   }

static class LEAD_VARS
{
   public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
}
function ConvertSignedToUnsignedConstructorExample()
{
   var codecs = new Leadtools.Codecs.RasterCodecs();
   codecs.throwExceptionsOnInvalidImages = true;

   // Load the image
   var srcFileName = "Assets\\Image2.dcm";
   return Tools.AppInstallFolder().getFileAsync(srcFileName).then(function (loadFile) {
      return codecs.loadAsync(Leadtools.LeadStreamFactory.create(loadFile));
   }).then(function (image) {
      // Prepare the command
      with (Leadtools.ImageProcessing.Core) {
         var command = new ConvertSignedToUnsignedCommand(ConvertSignedToUnsignedCommandType.shiftNegativeToZero);
         // convert image to unsigned.
         command.run(image);
      }
   });
}
[TestMethod]
public async Task ConvertSignedToUnsignedConstructorExample()
{
   // Load an image
   RasterCodecs codecs = new RasterCodecs();
   codecs.ThrowExceptionsOnInvalidImages = true;
   // Load the image
   string srcFileName = @"Assets\Image2.dcm";
   StorageFile loadFile = await Tools.AppInstallFolder.GetFileAsync(srcFileName);
   RasterImage image = await codecs.LoadAsync(LeadStreamFactory.Create(loadFile));

   // Prepare the command
   ConvertSignedToUnsignedCommand command = new ConvertSignedToUnsignedCommand(ConvertSignedToUnsignedCommandType.ShiftNegativeToZero);
   // convert image to unsigned.
   command.Run(image);

}
public void ConvertSignedToUnsignedConstructorExample(RasterImage image)
{
   // Prepare the command
   ConvertSignedToUnsignedCommand command = new ConvertSignedToUnsignedCommand(ConvertSignedToUnsignedCommandType.ShiftNegativeToZero);
   // convert image to unsigned.
   command.Run(image);
   image.Dispose();
}
Public Sub ConvertSignedToUnsignedConstructorExample(ByVal image As RasterImage)
   ' Prepare the command
   Dim command As ConvertSignedToUnsignedCommand = New ConvertSignedToUnsignedCommand(ConvertSignedToUnsignedCommandType.ShiftNegativeToZero)
   ' convert image to unsigned.
   command.Run(image)
   image.Dispose()
End Sub
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

ConvertSignedToUnsignedCommand Class
ConvertSignedToUnsignedCommand Members
Overload List

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.